I am trying to make a tutorial app with the help of Android, but I am confused where I should put the whole content (topic details). Actually I want to use it with the help of SQLite database. I used hashmap in my app.
if you really want to store your data on app, then SQL is best option. Otherwise you can use Remote server to store data. and SQLite for offline access to already viewed data.
Related
I want to store data locally in the phone after parsing it from JSON API and then make a button to synchronize that data whenever I need to so that the content can be used offline.
If you want to store data object locally, then you can make use of Realm DB. Below link explains how to use Realm DB https://www.androidhive.info/2016/05/android-working-with-realm-database-replacing-sqlite-core-data/
Right now, the best option to store bunch of data locally is using sqlite. You can search for it. There is a bunch of tutorials for it. Also, you can also use Room library which makes it really easy to create sqlite databases and interact with it.
I m developing an app similar to uber with android as front-end with rest api to serve data which is stored in mysql.
I would like to know if sqlite is used instead of mysql to achieve the above process because of the reasons sqlite exist in phone and data 'll be deleted after uninstalling the app.
sqlite database in android is used to store data which will not be stored in the backend but inside your phone only which you would not like to fetch from network everytime! for instance- user's ride history or user specific data. Although they'll need to be updated in regular interval.
In mysql you would need to store the backend data. so these two are two different things.
i hope you understand the diff among these and if you don't you should read a lot about these.
What I need the app to do is to store data in a database and let any user fetch the data. I am not sure how SQLite works but from what I know is that it is server-less. With the database being serverless, how do multiple users, other users, access the same data if it is not stored on a server?
look for backend and a service - parse.com or similar.
SQLite is installed on all android systems, and any app which wishes to create and use a database may do so. This however, is only stored locally on the device.
If you wish to share and synchronize data across multiple devices, that is a different issue all to itself. Indeed it will very likely involve a central server somewhere along the line.
Perhaps start your reading at d.android.com
I have a simple question for you, What if I want to develop an Android Application which uses a database for storing the data and retrieving those data, I know that there is an option to use SQLite, as I know SQLite is something which stores the data in a device , or you can say within a system somewhere, what about if I wanna store some data from one device and retrieve those data from another device?? I mean what is the best way of having a single Database which will communicate with all the devices? to be clear, using SQLite it seems to me like more as a local database not a global.
Thank you!
Lulzim
I've just written a short Android app which stores userdata in the phone-side sqlite database.
What I'd like to be able to do is to add this to an online database (I currently have a mysql database with my webhosts, but if there's any easier way then I'm open to suggestions), but it'll be subject to condition (Such as if a certain value doesn't already exist). I'd also like to be able to get data from this online database too to be added to the sqlite database on the phone.
I've had a look around and people seem to suggest using php as a go-between for that, but is that the easiest way? there aren't any mysql helper classes that could just interface directly or anything?
Newbie question I know, but the project was to teach myself how Android works so getting stuck in is the way to go..
Cheers!
Yes; using PHP is an example of an easier way to go. You need to create web services which allow you to interact between the android phone and a MySQL database. To my knowledge you can't go directly to a database hook; as you need to have something that can hook in. Also it would be a security issue if you put on each and all of your phones the connection information for your database.
Think if you had to change the host of your DB as your traffic grew large that you needed to upgrade; this would be a new update in the store and all clients would need to update this; otherwise you would be maintaining two code bases.
By using PHP you are able to create that middle level and easily interact with the DB.
Here is a quick article on creating REST PHP Web Service. Tutorial
Good Luck!