App

open class App : Application(source)

Main Application class for the DoomScrolling app.

Overview

This class serves as the entry point for the DoomScrolling application. It initializes essential components, manages the application lifecycle, and provides global access to application-wide resources and services.

Key Responsibilities

  • Initializes Firebase Analytics and AppMetrica for event tracking
  • Manages application context and lifecycle
  • Handles WebView configuration for multi-process scenarios
  • Provides global access to application resources

Usage

To access the application context or analytics from anywhere in the app:

// Get application context
Context context = App.getContext();

// Log an analytics event
Bundle params = new Bundle();
params.putString("screen_name", "MainActivity");
App.mFirebaseAnalytics.logEvent("screen_view", params);

Lifecycle

The application follows the standard Android application lifecycle. Key methods include:

  • onCreate - Initializes the application and its components
  • onTerminate - Called when the application is terminating
  • onLowMemory - Called when the system is running low on memory

Author

DoomScrolling Team

Since

1.0

See also

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
open var mFirebaseAnalytics: FirebaseAnalytics
Firebase Analytics instance for tracking events
Link copied to clipboard
open var TAG: String
Tag for logging purposes

Functions

Link copied to clipboard
protected open fun attachBaseContext(base: Context)
Called when the application is starting, before any activity, service, or receiver objects have been created.
Link copied to clipboard
open fun get(): App
Convenience method to get the Application instance.
Link copied to clipboard
open fun getContext(): Context
Gets the stored application context.
Link copied to clipboard
open fun getInstance(): App
Gets the singleton instance of the Application.
Link copied to clipboard
open fun init(context: Context)
Initializes the application context.
Link copied to clipboard
open fun onCreate()
Initializes the application, setting up Firebase Analytics and AppMetrica.