I do not know exactly how to explain that, but when many apps are first launched, usually the user can scroll through 3 or 4 screens that "preview"/"quick tour" the app before the user actually logs into the app. How can I achieve that in Android?
You don't need a library. What you can do is use a ViewPager That has different screens explaining different parts of the app.
In order to make sure that this only runs once you can have the following code in your FirstRunActivity's onCreate() method:
boolean firstRun = getPreferences(Context.MODE_PRIVATE).getBoolean("firstRun", true);
if (!firstRun) {
Intent mainAppIntent = new Intent(getApplicationContext(), MainActivity.class);
startActivity(mainAppIntent);
finish();
return;
}
// Set up ViewPager and first run stuff
After the first run has been completed and the user is in the app, then you set firstRun in SharedPreferences to false like so:
getPreferences(Context.MODE_PRIVATE)
.edit()
.putBoolean("firstRun", false)
.commit();
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