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
Create a DatabaseCreate "SQLiteDatabase" object. Open or Create a database and create a connection. Perform insert, update or delete operation. Create a Cursor to display data from the table of the database.
Yes, you just need to use the Firebase config of same project.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With