Base 1 Flashcards

Android Interview Cheat I

1
Q

What is Application?

A

The Application class in Android is the base class within an Android app that contains all other components such as activities and services. The Application class, or any subclass of the Application class, is instantiated before any other class when the process for your application/package is created.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is Context?

A

A Context is a handle to the system; it provides services like resolving resources, obtaining access to databases and preferences, and so on. An Android app has activities. Context is like a handle to the environment your application is currently running in.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is Application Context?

A

This context is tied to the lifecycle of an application. The application context can be used where you need a context whose lifecycle is separate from the current context or when you are passing a context beyond the scope of an activity.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is Activity Context

A

This context is available in an activity. This context is tied to the lifecycle of an activity. The activity context should be used when you are passing the context in the scope of an activity or you need the context whose lifecycle is attached to the current context.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is Armv7?

A

There are 3 CPU architectures in Android. ARMv7 is the most common as it is optimised for battery consumption. ARM64 is an evolved version of that that supports 64-bit processing for more powerful computing. ARMx86, is the least used for these three, since it is not battery friendly. It is more powerful than the other two.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Why bytecode cannot be run in Android?

A

Android uses DVM (Dalvik Virtual Machine ) rather using JVM(Java Virtual Machine).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is a BuildType in Gradle? And what can you use it for?

A

Build types define properties that Gradle uses when building and packaging your Android app.

A build type defines how a module is built, for example whether ProGuard is run.
A product flavour defines what is built, such as which resources are included in the build.
Gradle creates a build variant for every possible combination of your project’s product flavours and build types
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Explain the build process in Android:

A

1- First step involves compiling the resources folder (/res) using the aapt (android asset packaging tool) tool. These are compiled to a single class file called R.java. This is a class that just contains constants.

2- Second step involves the java source code being compiled to .class files by javac, and then the class files are converted to Dalvik bytecode by the “dx” tool, which is included in the sdk ‘tools’. The output is classes.dex.

3- The final step involves the android apkbuilder which takes all the input and builds the apk (android packaging key) file.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the Android Application Architecture?

A

1- Services − It will perform background functionalities

2- Intent − It will perform the inter connection between activities and the data passing mechanism

3- Resource Externalization − strings and graphics

4- Notification − light, sound, icon, notification, dialog box and toast

5- Content Providers − It will share the data between applications

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Describe activities

A

Activities are basically containers or windows to the user interface.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly