Autopilot
Autopilot allows UAirship.takeOff to be called without overriding the Application class. Typically, UAirship.takeOff must be called in Application.onCreate() so that the Airship library is ready to handle incoming events before intents are delivered to any application components. Calling takeOff directly is the simplest integration, however some application frameworks do not provide a way to extend the Application class. Autopilot allows you to provide your bootstrapping code in a way that allows the library to lazily execute it.
Autopilot will be called before onCreate on the main process. If this is too early for the application to handle takeOff, it can be delayed by overriding allowEarlyTakeOff. If delayed or if the application uses multiple processes, automaticTakeOff must be called at all application entry points (i.e., in the onCreate() method of all registered Broadcast Receivers, Activities and Services).
The default com.urbanairship.AirshipConfigOptions will be created from the airshipconfig.properties
file from the assets. To provide a different config, override createAirshipConfigOptions.
The default Autopilot behavior will call takeOff and load airship config options from the airshipconfig.properties
file in the assets directory. To use autopilot, add the following entry to the application block in the Application AndroidManifest.xml:
<meta-data android:name="com.urbanairship.autopilot"
android:value="com.urbanairship.Autopilot" />
Autopilot can be customized in order to load config from a different source or to customize the Airship instance when it is ready. To customize Autopilot, extend the class and override either allowEarlyTakeOff, onAirshipReady, or createAirshipConfigOptions methods. The class must be non-abstract, public, and it should only have a single public, no-argument constructor. Register the class by adding an entry to the application block of your manifest containing the fully qualified class name of your Autopilot implementation:
<meta-data android:name="com.urbanairship.autopilot"
android:value="com.urbanairship.push.sample.SampleAutopilot" />