Junior — Middle
Kus asub tavaliselt programmi sisenemispunkt koodis?
sobes.tech AI
Vastus AI-lt
In Android applications, the entry point of the program is usually located in a class that inherits from Application or in the main Activity.
- Application class — is created once when the application starts and initializes global settings and dependencies.
- MainActivity — is the first activity that is launched and displayed to the user.
In the Android manifest (AndroidManifest.xml), it is specified which activity is the main one using an intent filter:
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
Thus, the entry point is the onCreate() method in MainActivity or in the Application class, where the application logic begins.