i want to create an android application but i don't know how to use the sqlite database i already have.
In fact, i have an existing sqlite database using by an existing software application for computer. The database is stored on a server.
I want to know how i can read the database stored on the server to be always up to date when using the android application ?
I don't know if i'm clear, my english is not really good and i tryed my best to explain.
You can imagine that like a restaurant. The main application is already created but i want to develop an android application and each server has an android tablet with the application so they can access to the database when they have to.
Thank you.
you have to have the following:
Call Webservice from your android app.
the Webservice has all methods and functions that you need to interact with database on database Server.
the Webservice must return the data you need from the database server back to your android app.
Here is a good tutorial that you can start with to get clear idea in how can you use Webservice with android apps.
Related
I am new to android.i m developing an android app with database.users can insert and retrieve data from database.i just wanna know same app running on two different devices can share same SQLite database.i don’t want to share data outside the application but share data with users using app on different devices.or i have to put my application on third party server...please ans my question.
SQLite is a local database, it don't have "sync" options.
You should use a cloud server with a global database (sqlite, mysql...) and comunicate your app with the server.
The most easy way is create a Rest WebService
I'm making a native android app with has some user data that I want to be stored in a database.
I'm planning to use Heroku to host it. The app should be able to retrieve it and overwrite it.
Right now, I am very confused as to how to start working on it.
There are three parts:
1)writing the actual database: right now I'm using SQlite database browser. I have created a simple table database. I have no clue how to deploy this to Heroku...
2)writing a REST API to communicate with android app on device: I gather that I should also deploy this to Heroku?
3)Connecting with the device: ??? I have no clue how this works... do I write a REST API in my native android app too?
Very confused! thanks for reading.
You should follow these steps as per my knowledge:
The database that you create should be for the device(the one that you have created using sqlitebrowser.
Create a separate database at the server side and create an api that'll perform CRUD operations using an xml or json file to reflect the data in it in the database at server
whatever operations you perform you can do them in the local database and later after checking the internet connection write the edited valueds in xml or json format and send it to your server where it'll be synced with the server database.
I am trying to develop a real-time Android application where all contents are stored in server. So, they are available whenever a connection to Internet is available. Also, the application provides communication between users and conversations are stored in the server as well. Nothing is locally stored.
However, I am still cannot decide which database type I can use. I intended to use SQLite but I am not sure if I can really use it or not.
Could you please guide me to the proper database type to my application.
Appreciate your time and efforts.
As its upto you which database you use.
you may Install Lamp (For Linux) or WAMP(for window) . This is a nice database tool and very easy to handle and easy linked with PHP for various database function
I recently developed something similar to what you are talking about and here is what I would suggest you to go for.
Use SQL server to manage the data on your desktop and create a web-service in .Net on Visual Studio.
(Note that as others have already mentioned, it really does not matter what is the database you are using in your server end, because eventually the data is going to come to the Android application from the server in form of either xml or json in the web-service., regardless of what database you are using. So it is totally your wish which database you want to use.)
Then connect to the web-service in your application and set/get data from the remote Database, using SOAP.
Link on how to make a web-service in .NET (does not include the implementation in Android).
Links on how to connect your service with Android : this, this and this.
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!