Jul.11
Interview: Android – Core
Question: What is Context?
Context is an abstract class whose implementation is provided by the Android system. It allows access to application-specific resources and classes, as well as up-calls for application-level operations such as launching activities, broadcasting and receiving intents, etc.
Question: What is Gradle?
Android Studio uses Gradle, an advanced build toolkit, to automate and manage the build process, while allowing us to define flexible custom build configurations. Each build configuration can define its own set of code and resources, while reusing the parts common to all versions of our application.
Question: What is Activity?
Activity represents a single screen with a user interface. An Android application may contain one or more activities.
Lifecycle of activity:
onCreate() is called when activity is first created.
onStart() is called when activity is becoming visible to the user.
onResume() is called when activity will start interacting with the user.
onPause() is called when activity is not visible to the user.
onStop() is called when activity is no longer visible to the user.
onRestart() is called after your activity is stopped, prior to start.
onDestroy() is called before the activity is destroyed.
Question: What is ARMv7?
ARMv7 is optimized for battery consumption. ARM64 is an evolution of the original ARM architecture which supports 64-bit processing. ARMx86 is not battery friendly but it is more powerful than others.
Question: What are DVM and JVM?
DVM = Dalvik Virtual Machine.
JVM = Java Virtual Machine.
Android uses DVM which runs on low memory. DVM uses own byte code and runs .dex file.
Question: What are App Components?
App Components are the essential building blocks. Each component is an entry point through which the system or a user can enter our app. Some components depend on others.
Each component we create must declare a corresponding XML element in the manifest file.
There are four types of app components:
<activity> for each subclass of Activity.
<service> for each subclass of Service.
<receiver> for each subclass of BroadcastReceiver.
<provider> for each subclass of ContentProvider.