Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Check if first-time user of my App in Android

Tags:

java

android

In my App, first it shows a splash screen. After that another activity, then my main activity must be shown. This is my design plan. The second activity (i.e before main activity) must be shown for the first-time user of the app. If he/she closes the app, splash screen will redirect to main activity automatically. How do I do this? Any ideas? I am developing my app for Android phones.

like image 964
Praveen Avatar asked Apr 09 '10 14:04

Praveen


People also ask

How do you know if the app is opened for the first time Android?

There's no reliable way to detect first run, as the shared preferences way is not always safe, the user can delete the shared preferences data from the settings! a better way is to use the answers here Is there a unique Android device ID? to get the device's unique ID and store it somewhere in your server, so whenever ...

How do I find out when an app was installed for the first time?

Navigate to APPS and select the app u want by long press. And then hit the Info button on top right corner. Thats it , it will show u the modified or installed time.

Is first time launch in Android?

Android is developed by a consortium of developers known as the Open Handset Alliance and commercially sponsored by Google. It was unveiled in November 2007, with the first commercial Android device, the HTC Dream, being launched in September 2008.

How can I tell who is logged into an android app?

To check if the user is signed-in, call isConnected(). if (mGoogleApiClient != null && mGoogleApiClient. isConnected()) { // signed in.


1 Answers

You can e.g. use a sharedPreference-object to store a boolean value that tells you if this is the first time the user opens the application. Check the preference when the user starts the application, and if it returns true then show the middle screen.

private SharedPreferences mPreferences;
....
boolean firstTime = mPreferences.getBoolean("firstTime", true);
if (firstTime) { 
    SharedPreferences.Editor editor = mPreferences.edit();
    editor.putBoolean("firstTime", false);
    editor.commit();
    showMiddleActivity();
}

Something like that.

Edit: Beaten to it by jqpubliq...

like image 173
aspartame Avatar answered Oct 01 '22 06:10

aspartame