Manual migration

Use the following instructions to migrate if you integrated manually.

  1. In your main Activity, remove the creation of the LocalyticsSession() or LocalyticsAmpSession() member object in the Activity's onCreate() method. This should be removed in all other Activity classes as well.
    public void onCreate(Bundle savedInstanceState)
    {
       super.onCreate(savedInstanceState);
       setContentView(R.layout.main);
      
       // Remove the following line
       this.localyticsSession = new LocalyticsAmpSession(this.getApplicationContext());
    }
  2. If you don't have a custom Application class, create one, and specify the name in your AndroidManifest.xml.
    <application
       android:name=".MyApplication"
       android:icon="@drawable/ic_launcher"
       android:label="@string/app_name">
  3. In your Application's onCreate() method, integrate Localytics.
    public class MyApplication extends Application
    {
       @Override
       public void onCreate()
       {
          super.onCreate();
     
          // Integrate Localytics
          Localytics.integrate(this);
       }
    }