Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialMohamad Moukhallalati
353 PointsAndroid / Database
Greetings , does the android track has any tutorial for database connectivity ( NOT SQL LITE) , online database connectivity . Let's say that i'm wroking on an app and i want to put it online , what db is recommended to use or given on treehouse ? Please bear with me . Thank you <3
2 Answers
Ben Atkinson
6,540 PointsI don't think they do but there is a really good tutorial at https://www.simplifiedcoding.net/android-mysql-tutorial-to-perform-basic-crud-operation/ This uses MySQL/PHP and JSON but it gives you all the required steps, and as long as you know Java you should be sweet.
christopher vaughan
1,411 PointsI'm relatively new to android programming, so I could be wrong, but I have years of experience with programming web based systems and mysql and I think the basic premise of the question might be incorrect. When you use sqlite in an android app, both the database and the app live on the device, which is why you can access the db directly.
However, when we're consuming a remote data set (mysql db for instance), you'd wanna use something like a restful API to manage that. The link Ben shared is sort of a simplified api setup, and I think that's probably the "best practices" way to do it. So as a "track" for what you want I'd suggest checking out the json handling classes and then going through the link ben shared.
as a sidenote on json consumption, you could use json server to manage a really simple setup if you just wanted to whitebox your idea with your own data as you learn. (https://github.com/typicode/json-server)
Mohamad Moukhallalati
353 PointsThank you !
Mohamad Moukhallalati
353 PointsMohamad Moukhallalati
353 PointsThank you , will definitely check that one !