We are building a mobile app, specifically an android app, and it needs to connect to the server to get data. It is not like twitter, we do not need to expose some kind of public apis. We just need to keep it simple and safe because user will exchange some private data with the server.
My questions is mainly on authentication. Our server will have a user database.
An application programming interface is a software intermediary that allows interaction between multiple applications. In basic terms, APIs allow apps to talk to one another and share information. APIs can also be used to extend the functionality of a mobile application as well.
By creating an API, we can make the app device-independent, which is vital when building a mobile web. You could have a website, a mobile app, and a mobile web app accessing the same data using the same API, without needing to have a backend for each app implementation.
Quick brain dump:
If you like, store the username and load it across application sessions and prompt for a password every "session" of your app.
As suggested by Nate will do it.
and 3. After successful login your API could return unique session ID (as many webapps does) which you can store in your application and submit to your API with every further request. This way as long as client keeps the session ID stored and on server side its not deleted -user doesn't need to login again.
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