Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android instructions when open the application at first time? [closed]

Do you know this enter image description here

Well I want create something like this screen. When I open for the first time the application I want open this screen and display a context.. How is possible? I don't know what search for this type of thing..

like image 256
David_D Avatar asked Nov 12 '13 10:11

David_D


People also ask

How do you start an activity only once the app is opened for the first time?

Now in the onResume() method, check if we already have the value of prevStarted in the SharedPreferences. Since it will evaluate to false when the app is launched for the first time, start the MainActivity (Which we want to appear just once) and set the value of prevStarted in the SharedPreferences.

How do I know when I installed an app for the first time?

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 my first app launch Android?

Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project. Step 2 − Add the following code to res/layout/activity_main. xml. In the above code, we have taken textview, when user open application, it will check whether it is the first time or not.


2 Answers

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    ...
    if (isFirstTime()) {
        // What you do when the Application is Opened First time Goes here
    }
    ...
}


/***
 * Checks that application runs first time and write flag at SharedPreferences 
 * @return true if 1st time
 */
private boolean isFirstTime()
{
    SharedPreferences preferences = getPreferences(MODE_PRIVATE);
    boolean ranBefore = preferences.getBoolean("RanBefore", false);
    if (!ranBefore) {
        // first time
        SharedPreferences.Editor editor = preferences.edit();
        editor.putBoolean("RanBefore", true);
        editor.commit();
    }
    return !ranBefore;
}
like image 155
Android Noob Avatar answered Oct 06 '22 09:10

Android Noob


I've found a nice library for showing a tutorial to the user about specific items on the screen, called "ShowCase view library" .

but the library quite buggy and sometimes puts its textural items outside the screen (for example when the device is rotated) .

the alternative similar library i've found is "SuperToolTips" .

like image 22
Ankit Dhadse Avatar answered Oct 06 '22 07:10

Ankit Dhadse