Question:- What is ADB?
Answer:- ADB stands for Android Debug Bridge. It is a command-line tool that is used to communicate with the emulator instance. ADB can control our device over USB from a computer, copy files back and forth, install and uninstall apps, run shell commands, and more.
Question:- How many ADB components?
Answer:- It is a client–server program that includes three components: A client, which runs on our development machine. We can invoke a client from a shell by issuing an ADB command. Other Android tools such as DDMS also create ADB clients. A server, which runs as a background process on our development machine. The server manages communication between the client and the ADB daemon running on an emulator or device. A daemon, which runs as a background process on each emulator or device instance.
Question:- What are the different storage methods in Android?
Answer:- 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.
Question:- 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.
Answer:- In Android, an action is a description of something that an intent sender desires. Syntax: < action android:name="string" /> Contained in: < intent-filter> Description: It adds an action to an intent filter. An < intent-filter> element must contain one or more < action> elements. If it doesnt contain any, no Intent objects will get through the filter.
Question:- What is an ANR notification in Android?
Answer:- ANR is a short form for ‘Application Not Responding’. Android systems show this dialog if an application is performing too many tasks on the main thread and has been unresponsive for a long time.
Question:- Define the three key loops when monitoring an activity.
Answer:- • Entire lifetime: An activity that happens between onCreate and onDestroy • Visible lifetime: An activity that happens between onStart and onStop • Foreground lifetime: An activity that happens between onResume and onPause
Question:- How do you find a view element in your program?
Answer:- Findviewbyid is a method that is used to find a view that is identified by the ID attribute from the XML processed inActivity.OnCreate(Bundle).
Question:- Which dialog boxes can you use in your Android application?
Answer:- • AlertDialog: It is an alert dialogue box that supports 0 to 3 buttons and a list of selectable elements. • ProgressDialog: It is an extension to AlertDialog. We can add buttons to it. It shows a progress wheel or a progress bar. • DatePickerDialog: It is used for selecting a date by the user. • TimePickerDialog: It is used for selecting time by the user.
Question:- Name the resource that is a compiled visual resource, which can be used as a background, title, or in other parts of the screen.
Answer:- Drawable is the virtual resource that can be used as a background, title, or in other parts of the screen. It is compiled into an android.graphics.drawable subclass. A drawable resource is a general concept for a graphic that can be drawn. The simplest case is a graphical file (bitmap), which would be represented in Android via a BitmapDrawable class. Drawable is stored as an individual file in one of the res/drawable folders. The ADT project creation wizard creates these folders by default. You would store bitmaps for different resolutions in the -mdpi, -hdpi, -xhdpi, and -xxhdpi subfolders of res/drawable. If these bitmaps are provided in a different folder, the Android system selects the correct one automatically based on the device configuration.
Question:- How can two Android applications share the same Linux user ID and the VM?
Answer:- The applications must sign in with the same certificate in order to share the same Linux user ID and the VM.
Question:- Can you deploy executable JARs on Android? Which packaging is supported by Android?
Answer:- 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.
Question:- Is it okay to change the name of an application after its deployment?
Answer:- 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.
Question:- How can ANR be prevented?
Answer:- 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.
Question:- How can your application perform actions that are provided by another application, e.g., sending an email?
Answer:- Intents are created to define an action that we want to perform, and they launch the appropriate activity from another application. Syntax: Intent intent = new Intent(Intent.ACTION_SEND);intent.putExtra(Intent.EXTRA_EMAIL, recipientArray); startActivity(intent);
