Friday, 20 January 2017

Top 10 Recent Android Interview Questions Answers for Java Programmers



1. When does onResume() method called?
Another frequently asked android interview question. onResume() method is an activity lifecycle method. This is called when the activity comes to the foreground. You can override this method in your activity to execute code when activity is started, restarted or comes to the foreground.

2. What is the difference between a regular .png and a nine-patch image?
Answer: This is one of the most popular Android Interview questions, asked in several interview ranging from 1 to 2 years of experience to 5 years. The answer is, It is a resizable bitmap resource that can be used for backgrounds or other images on the device. The NinePatch class permits drawing a bitmap in nine sections. The nine patch images has extension as.9.png. It allows extension in 9 ways e.g. 4 corners that are unscaled, 4 edges that are scaled in 1 axis, and the middle one that can be scaled into both axes.

3. How to share content using Android Share Intent?
Share intent is an easy and convenient way of sharing content of your application with other apps.

4. What is an action in Android?
A description of something that an Intent sender desires.

5. What is Dalvik Virtual Machine?
Just like Java application run on Oracle HotSpot JVM or Azul JVM,  Android application runs on the Dalvik Virtual Machine.

6. What is the difference between an implicit intent and explicit intent?
There are Two types of Intent implicit and explicit intent, let see some more difference between them.

1) implicit:-
Implicit intent when you call system default intent like send email, send SMS, dial number etc
e.g.:
Intent sendIntent = new Intent();
sendIntent.setAction(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_TEXT, textMessage);
sendIntent.setType("text/plain")
startactivity(sendIntent);

2) Explicit :-
Explicit intent when you call you're on application activity from one activity to another
e.g. first activity to second activity
Intent intent = new Intent(first.this, second.class);
startactivity(intent);

7. What is an ANR in Android?
Answer: ANR is short for Application Not Responding. Android systems show this dialog if the application is performing too much of task on the main thread and been unresponsive for a long period of time.

8. What is APK format?
The APK file is compressed AndroidManifest.XML file with extension.apk, Which have application code (.dex files), resource files, and other files which are compressed into single .apk file.



Previous Post
Next Post

1 comment: