Android Fundamentals
The 4 core components (Activity, Service, BroadcastReceiver, ContentProvider), Intent and Manifest
1What is an Activity in Android?
What is an Activity in Android?
回答
An Activity represents a single screen in an Android application. It's a fundamental component that manages the user interface and interactions. It must be declared in the AndroidManifest.xml to be used.
2What is the main difference between Activity and Fragment?
What is the main difference between Activity and Fragment?
回答
A Fragment is a modular and reusable sub-component that must be hosted within an Activity. An Activity is a standalone component representing a complete screen. An Activity can contain multiple Fragments, but a Fragment cannot exist without an Activity.
3What is the AndroidManifest.xml file used for?
What is the AndroidManifest.xml file used for?
回答
The AndroidManifest.xml file is essential for every Android application. It declares all app components (Activities, Services, Receivers, Providers), defines permissions, intent-filters, specifies metadata and the minimum supported Android version.
How do you declare an Activity in AndroidManifest.xml?
What is an Intent in Android?
+21 面接問題