Jahangir Alam
Jahangir Alam

Reputation: 31

Server Client Communication between Android App and PHP Server

Guys I am creating an Online Android App, my server-side is taken care with php. Everything is going good. The app is working as per my concept.

Now I need to add a new feature in my app where i means the server need to know if the user is online now in his android app. How can i achieve this. Please help me out.

In the app when a user first downloaded and run the app, he/she need to register first and then login, as soon as he logs in, I stored his login data in "SharedPreferences", so that no need for the user to login every-time he opens the app.

Any help will be appreciated. Thanks.

Upvotes: 1

Views: 162

Answers (1)

Pritesh Patel
Pritesh Patel

Reputation: 698

You can implement this method on Activity to keep knowledge that user is interacting with application (Online/Active/Not interacting, etc.). You can post your status to the server in this method.

@Override 
public void onUserInteraction() 
{ 
}

Upvotes: 2

Related Questions