1. Why cannot you run the standard Java bytecode on Android?
Android uses Dalvik virtual machine (DVM) which requires a special bytecode. First of all, we have 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; build tools will care for the generation of DVM compatible files.
2. Can Android applications only be programmed in Java?
No, not necessarily. We can program Android apps using the Native Development Kit (NDK) in C/C++. The NDK is a toolset that allows us to implement parts of our app using native code languages such as C and C++. Typically, good use cases for NDK are CPU-intensive applications such as game engines, signal processing, and physics simulation.
3. Where will you declare your activity so the system can access it?
Activity is to be declared in the manifest file. For example:<manifest></manifest> <application></application> <activity android:name=”.MyIntellipaat”>
4. What is a NinePatch (9-patch) image?
It is a resizable bitmap resource that can be used for backgrounds or other images on a device. NinePatch class permits drawing a bitmap in nine sections. The 9-patch images have an extension as .9.png. It allows extensions in 9 ways, i.e., 4 corners that are unscaled, 4 edges that are scaled in 1 axis, and the middle one that can be scaled into both axes.
5. What are the different storage methods in Android?
Android offers several different options for data persistence. Shared Preferences – Store private primitive data in key-value pairs. This sometimes gets limited as it offers only key-value pairs. You cannot save your own java types. Internal Storage – Store private data on the device memory.
6. How can two Android applications share the same Linux user ID and the VM?
The applications must sign in with the same certificate in order to share the same Linux user ID and the VM.
7. Can you deploy executable JARs on Android? Which packaging is supported by Android?
No, the Android platform does not support JAR deployments. Applications are packed into Android Package (.apk) using Android Asset Packaging Tool (AAPT) and then deployed onto the Android platform. Google provides Android Development Tools for Eclipse that can be used to generate the Android Package.
8. Is it okay to change the name of an application after its deployment?
It is not recommended to change the application name after its deployment because this action may break some functionality. For example, shortcuts will not work if you change the application name.
9. How can ANR be prevented?
One technique that prevents the Android system from concluding a code that has been unresponsive for a long period of time is to create a child thread. Within the child thread, most of the actual tasks of the codes can be placed so that the main thread runs with minimal periods of unresponsive time.
10. What database is used for the Android platform?
SQLite, an open-source, self-contained, serverless database, is embedded in Android by default.
11. Can you change an application’s name after you have deployed it?
Although you CAN change it, the real question should be “SHOULD you”? Changing an application’s name risks breaking some of its functionality.
12. Speaking of emulators, why is it so important for developers to have access to one?
Since emulators function like an actual hand-held device, developers have a good dedicated “sandbox” to safely create, edit, test, and debug new applications, seeing how they would function on a real device without having to actually risk a real device.
13. What languages does Android use?
Android-primarily uses Java, but it also supports C/C++, which, if used with Android SDK, will run faster.
14. What’s a sticky intent?
This is a broadcast using the send sticky broadcast() method. The intent sticks around after the broadcast, which allows others to collect data from it.
15. What are Activities?
These are the parts of a mobile app that a user sees and interacts with. It represents a Graphic User Interface (GUI), representing one Android screen.
16. What’s a content provider?
Content providers share information between different Android applications. They allow users to access data within an application. Examples include contact information, images, video, and audio.
17. What’s a “bundle” in Android?
Bundles are used to pass the required data to sub-folders.
18. How do you identify view elements in an android program?
Use the keyword findViewById.
19. What is AAPT?
This is an acronym for Android Asset Packaging Tool. The tool gives developers the ability to deal with zip-compatible archives, including content viewing, creation, and extraction.
20. What is ADB?
This acronym stands for Android Debug Bridge (a tool found in SDK). It’s a command-line tool used to communicate between the emulator instances.
21. What does APK mean?
It’s short for Android Packaging Kit. Every file in the Android packaging key is compressed into a single file, the APK.