Reputation: 6128
I need the users to register to my website with login and password.
basically i need to do the following
1.Connect android app with the database from a website.
2.Store some information into the database.
3.retrieve some information back from the database.
I have already experience with the standard sqlite build in android apps. The problem is, I need to let people register my website and retrive some information
Upvotes: 7
Views: 52874
Reputation: 11
You can use google firebase and Json for your project you just need to host your web-based project and you can Access your shared database. but you should make sure the database which you are using is shared a database .
Upvotes: 1
Reputation: 4960
To store or retrieve any information stored on a Database on a web server, you will need to create a simple web service that will pass the requests to the database and then return the results from the database back to Android in a format Android can understand. You can typically send the data in POST or REST and then retrieve the data in JSON format.
There is a very good example of how you could achieve that using PHP here. Here you would send requests from Android to the PHP script(hosted on the server) using POST and then the script would return the results in JSON format, which in turn can be parsed by Android to get the desired result.
This is the basic method in which complex web services like twitter, facebook and the like operate. Most of the interaction is done with REST & JSON.
Upvotes: 11
Reputation: 1934
You could use SQLLite to access the database but I don't know if its too safe for registering as you're required to supply sql database password.
Upvotes: 1
Reputation: 1753
Usually you shouldn't directly connect to a database from an app because:
Based on these points I would recommend you to put a webservice between your app and the database. This webservice could be programmed in any programming language you like. It should protect your database from unintended requests on your database.
Your app then connects to your webservice, the webservice validates the user input and stores it in the database. When you'd like to receive some data from database, you just connect to the webservice and ask for data.
Upvotes: 4
Reputation: 777
The Best way would be to use Web-Services
and implement them to handle all the Sql Queries sent from your client android Devices.
Upvotes: 1