How to login(or check if a user is already logged in ) in wordpress from my own android app

Viewed 41

I have designed a simple android app which based on some input from the user redirects the user to certain part of my wordpress site.

The problem that I am facing is that before that, I need to check if the user is already logged in and if not to give him the possibilit to log in.

I checked around and everyone is talking about the android app but I need the login to be done from my own app.

Any idea/orientation how that can be done?

1 Answers

You'll need to make use of SharedPreferences which will login user at first then when the app is closed and launched again, it'll not tell the user to login. SharedPreferences will collect key values in strings and boolean then it'll save user data when the app is relaunched in the onCreate method of an Activity or in the onCreate view of a Fragment.

Remember to commit after each preference. Try to check out this YouTube playlist link: Playlist Link and search for SharedPreferences tutorials

Related