Android Client Application Startup Time

While the Urban Airship library should not significantly add to your application's start up time, the time it takes can be minimized.

The majority of startup time is taken up by reading configuration details from your AirshipConfig.properties file. This file read from storage is the most significant use of time in the start up process.

Fortunately, reading the configuration data from disk can be bypassed. In the onCreate method in the Application class, you can provide configuration information programmatically.

You can also configure your notification factory and push enabled status in onAirshipReady which allows the configurations to occur on a different thread preventing additional blocks on the main thread.

AirshipConfigOptions options = new AirshipConfigOptions();
options.inProduction = true/false;
options.developmentAppKey = "YOUR DEV APP KEY";
options.developmentAppSecret = "YOUR DEV APP SECRET";
options.productionAppKey = "YOUR PROD APP KEY";
options.productionAppSecret = "YOUR PROD APP SECRET";
options.gcmSender = "YOUR GCM SENDER ID";
    
UAirship.takeOff(this, options, new UAirship.OnReadyCallback() { @Override public void onAirshipReady(UAirship airship) { // Perform any airship configurations here
// Create a customized default notification factory DefaultNotificationFactory defaultNotificationFactory = new DefaultNotificationFactory(getApplicationContext());
defaultNotificationFactory.setSmallIconId(R.drawable.ic_notification); defaultNotificationFactory.setColor(NotificationCompat.COLOR_DEFAULT);
// Set it airship.getPushManager().setNotificationFactory(defaultNotificationFactory);
// Enable Push airship.getPushManager().setUserNotificationsEnabled(true); } });
As seen in the example above, the Airship Config Options must be set before the call to takeOff.

Related Content