I am currently developing an Android application and trying to improve the start time. For this, I use the Systrace tool .
When you first start the application (immediately after installation), it takes ~ 40 seconds to start, and I get this trace:

As you can see, there is a 30 second purple tag with a title bindApplication.
After that, I close the application (selected from recent actions) and open it again. This time the tag bindApplicationis only 4 seconds long:

- Does anyone know if this is normal for the first run?
- What can I do to improve it?
, bindApplication - onCreate App, , .
: onCreate : Parse, Crashlytics, Timber, ParseFacebookUtils Google Analytics.
EDIT:
:
public class MyApp extends Application {
private Tracker tracker;
@Override public void onCreate() {
super.onCreate();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
Trace.beginSection("MyApp");
}
Fabric.with(this, new Crashlytics());
Parse.enableLocalDatastore(this);
ParseObject.registerSubclass( ... );
Parse.Configuration.Builder parseConfigBuilder = new Parse.Configuration.Builder(this).applicationId(
getString(R.string.parse_application_id))
.server(getString(R.string.parse_server_url));
if (BuildConfig.DEBUG) {
Timber.plant(new DebugTree());
Parse.setLogLevel(Parse.LOG_LEVEL_VERBOSE);
parseConfigBuilder.addNetworkInterceptor(new ParseLogInterceptor());
}
Parse.initialize(parseConfigBuilder.build());
ParseFacebookUtils.initialize(this);
ParseInstallation.getCurrentInstallation().saveInBackground();
AnalyticsManager.getInstance().init(this);
AnalyticsManager.getInstance().debugMode(BuildConfig.DEBUG);
if (BuildConfig.DEBUG) {
StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder()
.detectAll()
.penaltyLog()
.build());
StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder().
detectAll()
.penaltyLog()
.build());
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
Trace.endSection();
}
}
synchronized public Tracker getDefaultTracker() {
if (tracker == null) {
GoogleAnalytics analytics = GoogleAnalytics.getInstance(this);
tracker = analytics.newTracker(R.xml.global_tracker);
}
return tracker;
}
}