java Interview Question

Q1. Why cannot you run standard Java bytecode on Android?
A. 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.

Q2. Can you deploy executable JARs on Android? Which packaging is supported by Android?
A. No. Android platform does not support JAR deployments. Applications are packed into Android Package (.apk) using Android Asset Packaging Tool (aapt) and then deployed on to Android platform. Google provides Android Development Tools for Eclipse that can be used to generate Android Package.

Q3. Android application can only be programmed in Java?
A. False. You can program Android apps in C/C++ using NDK .

Q4. What are Dalvik Executable files?
A. Dalvik Executable files have .dex extension and are zipped into a single .apk file on the device.

Q5. How does Android system track the applications?
A. Android system assigns each application a unique ID that is called Linux user ID. This ID is used to track each application.

Comments

Popular posts from this blog

What is string immutability?