Create Application Class
- 22 Aug 2024
- 1 Minute To Read
-
Print
-
DarkLight
-
PDF
Create Application Class
- Updated On 22 Aug 2024
- 1 Minute To Read
-
Print
-
DarkLight
-
PDF
Article summary
Did you find this summary helpful?
Thank you for your feedback
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:
- Open your main AndroidManifest.xml.
- 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>
- 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?