Top
Create Application Class
  • 22 Aug 2024
  • 1 Minute To Read
  • Dark
    Light
  • PDF

Create Application Class

  • Dark
    Light
  • PDF

Article summary

The Application class in Android is the base class within an Android app that contains all other components such as activities and services.

While integrating Whatfix Mobile SDK with your Android app, you need to start the Whatfix Mobile SDK in your Application class inside the onCreate() function.

If you haven't created the Application class, use the following steps to create it:

  1. Open your main AndroidManifest.xml.
  2. Add android:name=".NewApplicationClass" to your <application> tag.
<manifest xmlns:android="<http://schemas.android.com/apk/res/android>"
    package="is.leap.android.test">
   <application
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:name=".NewApplicationClass">
        ...
    </application>
</manifest>
  1. Hover your cursor over android:name=".NewApplicationClass" or press Alt + Enter or Option + Enter and select Create class NewApplicationClass.
Java

import android.app.Application;

public class NewApplicationClass extends Application {
   @Override
   public void onCreate() {
      super.onCreate();
      // TODO: Start Leap SDK here
   }
}

Kotlin

import android.app.Application

class NewApplicationClass : Application() {
   override fun onCreate() {
      super.onCreate()
      // TODO: Add Leap SDK initialization here
   }
}


Was this article helpful?

Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.