I have been developing a number of Android activities in a project in Eclipse.
I am now following a tutorial to achieve push notifications and I need to create a new Android Application (extends Application in the code).
However, when trying to create this application it does not run properly. Does the class name need to be the same as the project title?
When trying to run this on my phone it crashes.
My code is below: (ApplicationLoader is not the name of the App/Project)
public class ApplicationLoader extends Application {
@Override
public void onCreate() {
super.onCreate();
//Configure your application
//
// This can be done in code as illustrated here,
// or you can add these settings to a properties file
// called airshipconfig.properties
// and place it in your "assets" folder
AirshipConfigOptions options = AirshipConfigOptions.loadDefaultOptions(this);
options.developmentAppKey = --my development app key
options.productionAppKey = --my production app key
options.inProduction = false; //determines which app key to use
Logger.logLevel = Log.VERBOSE;
// Take off initializes the services
UAirship.takeOff(this, options);
PushManager.enablePush();
PushPreferences prefs = PushManager.shared().getPreferences();
Logger.info("My Application onCreate - App APID: " + prefs.getPushId());
}
}
If your application name is ApplicationLoader (defined under application tag in your AndroidManifest) then Application Class name should also be ApplicationLoader