Correct Answer: Android uses Dalvik Virtual Machine (DVM) which requires a special bytecode We need to convert Java class files into Dalvik Executable files using an Android tool called "dx" In normal circumstances, developers will not be using this tool directly and build tools will care for the generation of DVM compatible files
2. How to select more than one option from list in android xml file? Give an example.
Correct Answer: Android Application Architecture has the following components: > Services - like Network Operation > Intent - To perform inter-communication between activities or services > Resource Externalization - such as strings and graphics > Notification signaling users - light, sound, icon, notification, dialog etc > Content Providers - They share data between applications
4. What is AIDL?What data types are supported by AIDL?
Correct Answer: - AIDL is the abbreviation for Android Interface Definition Language - It handles the interface requirements between a client and a service to communicate at the same level through interprocess communication - The process involves breaking down objects into primitives that are Android understandable AIDL supports following data types: - String - List - Map - CharSequence - All native Java data types like int,long, char and Boolean
Correct Answer: - Notification messages to the user from an Android enabled device can be displayed using Intents - There are two types of Intents - Explicit Intent, Implicit Intent Implicit Intent: - In case of Implicit Intent, an intent is just declared - It is for the platform to find an activity that can respond to it - Since the target component is not declared, it is used for activating components of other applications Explicit Intent - Explicit intent specifies the particular activity that should respond to the intent - They are used for application internal messages
6. Write code snippet to retrieve IMEI number of Android phone?
Correct Answer: TelephonyManager class can be used to get the IMEI number It provides access to information about the telephony services on the device Code TelephonyManager mTelephonyMgr = (TelephonyManager) getSystemService(ContextTELEPHONY_SERVICE); String imei = mTelephonyMgrgetDeviceId();
7. How can your application perform actions that are provided by other application e.g. sending email?
Correct Answer: Intents are created to define an action that we want to perform and the launches the appropriate activity from another application Code Intent intent = new Intent(IntentACTION_SEND); intentputExtra(IntentEXTRA_EMAIL, recipientArray); startActivity(intent);
8. How will you launch an Activity within you application?
Correct Answer: For launching an application, we will need to create an intent that explicitly defines the activity that we wish to start For example: Code Intent intent = new Intent(this, MyTestActivityclass); startActivity(intent);
Correct Answer: A NSArray?s contents can not be modified once it?s been created whereas a NSMutableArray can be modified as needed, ie items can be added/removed from it