What is the difference between DVM and JVM? Why Android opted for DVM?
Android team preferred DVM over JVM because of below given reasons.
1. Though JVM is free it was under GPU license, which is not good for Android as most of the Android is under Apache license.
2. JVM was designed by keep desktops in mind. So it is too heavy for embedded devices.
3. DVM takes less memory, runs & loads faster compared to JVM.
4. Since mobile devices have lot of limitations like low CPU speed and less Memory, it is always better not to use heavy components like JVM.
Which layer does Dalvik Virtual Machine sit?
Every android application runs in DVM. To run an application it requires memory, process, threads and other resources. But all these resources are under control of kernel. So DVM has to interact with driver layer for memory and thread management, it sits just above driver layer (that is.. it sits in library layer)
What is the importance of version code and version name attributes in manifest file?
Version no and name will be useful when you upload some application to play store and wanted to update it. When you are upgrading your application then you can increment the version number so that users of your application will get notification on their phones about the latest updates available.
Give two examples for configuration changes in Android?
configuration changes include: rotating the phone, having virtual keypad on, and changing language settings in settings.
What is the difference between implicit intent and explicit intent, give one example?
Implicit intent - Intent with out target component name; Explicit intent - Intent with target component name.
How to make a phone call from an android application?
Intent in = new Intent();
in.setAction(Intent.ACTION_CALL);
in.setData(Uri.parse("tel:12345"));
startActivity(in);
What is the difference between intent, sticky intent, and pending intent?
intent - is a message passing mechanism between components of android, except for Content Provider. You can use intent to start any component.
Sticky Intent - Sticks with android, for future broad cast listeners. For example if BATTERY_LOW event occurs then that intent will be stick with android so that if any future user requested for BATTER_LOW, it will be fired;
Pending Intent - If you want some one to perform any Intent operation at future point of time on behalf of you, then we will use Pending Intent. Eg: Booking a ticket at late night when your application is not running. In this scenario we will create a pending intent to start a service which can book tickets at late night and hand it over to Alarm Manager to fire it at that time.
What type of kernel is used in Android?
Linux modified kernel (Monolithic) is used in Android.
What is r.java in android? What does it contain?
all resources located in res folder are mostly .xml files, which will not be understood by java compiler. So aapt (android application packaging) tool will convert all those xml files and other resources into a java file, which has identification numbers(pointers) to all those resources. if we want to access any resource from the code, then we can access through this R.java file. full form is Resource.java file.
What is APK in android, and What does .apk file contains?
APK - Application Package file. It is a file format used to distribute and install android applications.
.apk will contain single .dex file, zipped resources, other non java library files (c/c++). .dex file will internally contains converted .class files. other wise .apk will not contains .class files.
No comments:
Post a Comment