JavaRush /Java Blog /Random EN /7 Frequently Asked Android Questions and Answers for Java...

7 Frequently Asked Android Questions and Answers for Java Developers

Published in the Random EN group
In this article, we'll look at some of the most commonly asked Android interview questions. The profession of Android application developer is in high demand. The following questions are very common in interviews for mid-level and entry-level Android developers. They are simple in nature, and are great for reviewing and practicing before going to an Android interview. 7 Frequently Asked Android Questions and Answers for Java Developers - 1

Question 1: What is the difference between a regular png image and a 9-patch?

This is one of the most popular Android interview questions. It is asked to developers with 1-2 to 5 years of experience. The answer is that it is a resizable bitmap resource that can be used for backgrounds or other images on the device. The NinePatch class provides the ability to render an image in nine areas. The extension of such images is .9.png . They can be expanded in nine ways: 4 corners are not scaled, 4 edges are scaled along one axis, and the middle area is scaled along both axes. Question 2: What is ANR notification in Android? ANR is short for Application Not Responding . Systems running on the Android operating system show this dialog box if the application is performing a very resource-intensive task on the main thread and remains unresponsive for an extended period of time.

Question 3: When is the onResume() method called?

Method onResume()is one of the activity life cycle methods. It is called when an activity comes to the foreground. You can override this method in your activity to execute code when the activity starts, restarts, or comes to the foreground. Here's a clear diagram explaining the execution sequence of various callback methods in Android, including onResume():
7 Frequently Asked Android Questions and Answers for Java Developers - 2

Question 4: What is the difference between implicit and explicit intent?

Intent or Intent basically refers to messages that are transmitted between components (Activities, Services, Broadcast Receivers, Content Providers) . There are two types of intentions: implicit and explicit . Let's figure out what their differences are. 1) Implicit: Implicit intents are when calling default system intents such as sending an email, SMS, dialing a phone number, for example:
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 is used to move from one activity to another, for example, from activity firstto activity second:
Intent intent = new Intent(first.this, second.class);
startactivity(intent);
You can learn more about explicit and implicit intent in the book Introduction to Android Development By John Sonmez.

Question 5: What is APK format?

An APK file is a compressed file AndroidManifest.XMLwith the extension .apk. It contains application code (.dex files), resource files, and other files compressed into a single file.

Question 6: What is Dalvik Virtual Machine?

Just like Java applications run on Oracle HotSpot JVM or Azul JVM , Android applications run on Dalvik Virtual Machine (DVM) . Essentially, it is an analogue of a Java machine developed by Google and optimized for. working with RISC processors .

Question 7: How does an Android application run on a mobile device running Android operating system?

Because Android applications are most often coded in Java, they are compiled first and then executed, but the virtual machine for which their bytecode is generated is different from the standard JVM. The Dalvik virtual machine is used to run Android applications.
7 Frequently Asked Android Questions and Answers for Java Developers - 3
Comments
TO VIEW ALL COMMENTS OR TO MAKE A COMMENT,
GO TO FULL VERSION