PhoneGap Interview Questions and Answers

PhoneGap Interview Questions and Answers

Last updated on 24th Oct 2020, Blog, Interview Question

About author

Ranjith (Sr Technical Manager )

He is a Proficient Technical Expert for Respective Industry Domain & Serving 8+ Years. Also, Dedicated to Imparts the Informative Knowledge's to Freshers. He Share's this Blogs for us.

(5.0) | 11236 Ratings 2320

If you have practical knowledge of web applications using Phonegap technology, then you can search for jobs as a Mobile App developer on our ACTE page. Here you will get all the information about Phonegap jobs such as job vacancies at different locations. You can search and apply for the best ones based on your qualifications, skills and experience. In a Phonegap job you will learn to develop hybrid apps and get a chance to know about the architecture of a mobile app. A Phonegap job will help you gain experience in designing and building applications for the Android platforms, along with APIs and third-party libraries. To apply for the Phonegap job log on to the wisdom jobs page and go through the application process given there. Also prepare well for your job interview by reading the Phonegap job interview questions and answers which are provided there.

1.State some advantages of Android.

Ans:

Below are some advantages of Android:

  • Low investment and better returns: Android development has a low entry barrier and is suitable for new developers looking to become proficient in the programming field.
  • Free SDK: One of the most prominent features of Android is that the Software Development Kit is open source and is provided free of charge, which eradicates the cost of licensing, distribution and development fee.
  • Easy Adoption: Android applications are scripted in Java, which is one of the most used programming languages in the world.
  • Reusable: Android components can be reused and even replaced by the framework.
  • Multi-Platform Support: The Android platform supports major OSs such as Linux, Mac OS, and Windows.
  • Support for Wearable Devices: The market is now flooded with wearable devices and Android has emerged as leading support for such devices that are now readily available in the market.

2.What is Android Runtime?

Ans:

Android Runtime (ART) is an application used by the Android OS as a runtime environment. It has now replaced Dalvik, a discontinued process Virtual Machine (VM). ART translates the bytecode of the application into native instructions, which are carried out by the device’s runtime environment.

Subscribe For Free Demo

Error: Contact form not found.

3.Explain the dialog boxes supported on Android?

Ans:

Android supports four dialog boxes

  • AlertDialog: The most suggested dialog box, the AlertDialog supports 0-3 buttons, along with a list of selectable items, such as radio buttons and checkboxes.
  • DatePickerDialog: Used for the selection of date by the user
  • TimePickerDIalog: Used for the selection of time by the user
  • ProgressDialog: Used to display a progress bar and is an extension of the AlertDIalog. It also supports the addition of buttons.

4.Explain Sensors in Android?

Ans:

Android-based devices have an assortment of built-in-sensors in them, which measure certain parameters such as motion, orientation and more. These sensors help in the monitor of positioning and movement of the device through their high accuracy. The sensors can be both software and hardware-based on nature. The three prominent categories of sensors in Android devices are:

  • Position Sensor: It is used to measure the physical position of the Android device. This includes orientation sensors and magnetometers.
  • Motion Sensors: These sensors include gravity, rotational activity and acceleration sensors which measure the rotation of the device or the acceleration and much more.
  • Environmental Sensor: It includes sensors that measure temperature, pressure, humidity, and other environmental factors.

5.What are some of the disadvantages of Android?

Ans:

Below are some disadvantages of the Android Operating System

  • Fake Applications: There are thousands of fake apps available on the market at any given time, which when installed may try to steal your data.
  • Streamlining issues: There are a variety of Android devices available in the market, with different screen sizes and dimensions, but more importantly, different Android Operating Systems. Every application developer has to constantly work towards updating their application for the new OS but with various OS versions and upgrades, the process is quite difficult. An application which runs smoothly on one version of the Android OS might crash on a different Android OS.
  • Background Processes: The abundance of running processes in the background is always an issue, as they eat up the battery quickly.

6.Name some testing scenarios which be tested on real devices and not on emulators.

Ans:

Emulators are devices which are used to perform tasks comparable to that of real Android devices, and are used to decrease the cost of testing. But some scenarios can only be performed on real devices and not on emulators. These scenarios include:

  • Messaging
  • Bluetooth
  • Mounting and unmounting the memory card
  • Validation of battery scenarios
  • Memory related issues
  • Validation of the performance

7.What is Context?

Ans:

The Context in Android, as its name suggests, in the context of the current state of your application or object. The context comes with services such as giving access to databases and preferences, resolving resources and much more. There are two types of context:

  • Activity Context: This context is attached to the lifecycle of an activity. It should be used when you are passing the context in the scope of an activity or you need the context whose lifecycle is attached to the current context.
  • Application Context: This context is attached to the lifecycle of an application. The application context can be used where you need a context whose lifecycle is separate from the current context or when you are passing a context beyond the scope of activity.

8.How do you find memory leaks in an application on the Android platform?

Ans:

To find memory leaks in an application on Android, the Android Device Manager (ADM) is used by the Android Studio. When you open ADM in Android Studio, you can see parameters such as heap size and memory analysis along with many others while you run an application.

9.State the architecture of an Android application?

Ans:

Any Android application has the following components:

  • Notification- Features such as light, sound, icons and more
  • Services- To perform background functionalities
  • Intent- To perform inter-connection between activities and mechanisms that pass on data
  • Resource Externalization- Features such as strings and graphics
  • Content Providers- To share data between applications

10.If an application is crashing frequently, how will you troubleshoot it?

Ans:

If an Android application is crashing frequently, you can do the following:

  • Free Memory: As there is a limited amount of space on mobile devices, you can try by freeing up memory space for the application to function properly.
  • Compatibility Check: It may not be a hardware problem, but more of a software issue. It is not always possible to test an application for all devices and OS system. There might be a chance that the application is not compatible with your OS. Check the compatibility on the application’s Google Play Store page.
  • Memory Management: Some applications run perfectly on one mobile device but may crash on other devices. This is where processing power, memory management and CPU speed comes into play. Check the application memory requirements if application is constantly crashing.
  • App Data Usage: If an application is crashing frequently, you can delete the application’s data, which will clear its cache memory and allow some free space on your device and might boost the app’s performance.

11.Explain DDMS in brief?

Ans:

The Dalvik Debug Monitor Server (DDMS) is a debugging tool in Android Studio. It has a wide range of debugging features, such as:

  • Port forwarding
  • Location data spoofing
  • Screen capture
  • Logcat
  • Radio state information
  • Thread and Heap information

The DDMS tool is now deprecated and Android now suggests the users use Android Profiler instead.

12.Explain the difference between implicit and explicit intent?

Ans:

Below is the difference between the two intents

  • Explicit Intent: An explicit intent is where you inform the system about which activity or system component it should use to generate a response to this intent.
  • Implicit Intent: An implicit intent allows you to declare the action you wish to carry out, after which the Android system will check which components are registered to handle that specific action.

13.What is the AndroidManifest.xml file and why do you need this?

Ans:

The AndroidManifest.xml file contains information about the application, which is then provided to the Android system. This data may include the package name, components such as activity, services, content providers and more. This file executes the following tasks:

  • Providing a unique name to the Java package
  • Describing various components of the application, such as activity, services and more. It also defines the classes which will implement these components
  • Declaring the Android API which will be used by the application
  • Contains the library file details linked to the application

14.Explain different launch modes in Android?

Ans:

Below are the different launch modes in Android

  • Standard: This launch mode generates a new instance of the activity in the task from which it originated. It is possible to create multiple instances of the same activity, which can be added to the same or different tasks.
  • SingleTop: This launch mode is similar to the Standard launch mode, except if there exists a previous instance of the activity on the top of the stack, then a new instance will not be created, but the intent will be sent to the existing instance of the activity.
  • SingleTask: This launch mode will always create a new task and push a new instance to the task as the root one.
  • SingleInstance: This launch mode is the same as the SingleTask launch mode but the system doesn’t launch any new activities in the same task. In a scenario where the new activity is launched, it is launched in a separate task.

15.State the components which are necessary for a New Android Project?

Ans:

When a new Android project is created, the following components are required:

  • Manifest: Contains the xml file
  • Build/: Contains build output
  • Res/: Contains non-code resources such as bitmap images, UI strings and more
  • Src/: Contains the code and resources
  • Assets/: Contains a file which can be converted into an .apk file

16.What is the importance of setting up permission in Android application development?

Ans:

If the code is accessible to anyone and without restrictions, there may be a scenario where the code is compromised, resulting in defect leakage. Once the permissions are set, the code becomes available to authorized users only.

17.Explain the term ANR in Android

Ans:

The term ANR is short for Application Not Responding. It is displayed as a notification by the Android OS every time the application stops responding to the user action for a considerable amount of time.

18.What are the different data types supported by AIDL?

Ans:

AIDL or Android Interface Definition Language facilitates the communication between the client and service. Data Types supported by AIDL are as follows:

  • String
  • List
  • Map
  • charSequence
  • INT, Long, Char, Boolean (Java data types)

19.Name the different data storage options available on the Android platform?

Ans:

Android platform provides a variety of data storage options which can be used depending upon the need of the user. The storage options are:

20.What is an Android System?

Ans:

An Android System is an open-source operating system. It is developed to be used on smartphones and tablets. Android System is based on the Linux Kernel system, which offers the developers to create and run applications that can perform essential as well as advanced functions.

21.Define the architecture of Android?

Ans:

The Android architecture consists of four components.

These are:

  • Linux Kernel.
  • Libraries.
  • Android applications.
  • Android Framework.

22.What is the full form of AAPT? Explain AAPT?

Ans:

The full form of AAPT is Android Asset Packaging Tool. This tool is used by developers that offer them the ability to deal with the zip-compatible archives. Hence the process of creation, extraction, and viewing of the contents easier with this tool in application.

23.What is an “Emulator” in Android?

Ans:

An “Emulator” in android helps the developers to play around an interface that acts as a real mobile device. This way, it becomes easier for the developers to write and test different codes for the application. The process of debugging also becomes possible through emulators. Hence, emulators provide a safe platform for testing codes in their early phases as well as in the later stage when the bugs need to be dealt with.

24.Difference between RecyclerView and Listview/Gridview?

Ans:

RecyclerView:

  • Horizontal scrolling is supported.
  • Recycler can be used as a list or grid format depending on the requirement.
  • Recycler view gives optimized memory usage, it will allocate data only to the list of data shown on screen and extra 2 on top and bottom of the list.

Listview:

  • Horizontal scrolling is not supported.
  • Listview cannot be used as gridview.
  • It allocates memory for all the items in the list and hence memory is not optimized.

25.What is Card View?

Ans:

Card view is a UI element which displays the data in card format with corner radius and drops shadow elevation.

26.What are SQLite and its methods?

Ans:

SQLite is a relational open source database which comes inbuilt in android devices which enables you to store, retrieve, manipulate and delete data.

Using SQLite android application can run in offline mode also. Sqlite is implemented in our project by extending the class with SqliteOpenHelper class which overrides 2 methods i.e;

  • oncreate(): Where the database is created along with its version.
  • onUpgrade(): It is supporting function of onCreate() when the version has updated the changes in a database will be performed in an on upgrade method without disturbing the existing one.
Course Curriculum

Learn Experts Curated Phonegap Training to Build Your Skills & Ability

  • Instructor-led Sessions
  • Real-life Case Studies
  • Assignments
Explore Curriculum

27.Difference between Picasso and glide?

Ans:

Picasso:

  • Doesn’t support gif image.
  • Downloads the image and stores a full image in cache.
  • Less memory efficient compared to Glide.

Glide :

  • Supports Gif images.
  • Downloads the image, resize it to imageview size and stores in a disk cache.
  • More memory efficient.

28.Difference between volley and Retrofit?

Ans:

Volley:

  • Volley as caching mechanism
  • Volley enables retry policy
  • In Volley, JSON response is parsed manually.
  • Volley as inbuilt image loader support

Retrofit:

  • Retrofit doesn’t have caching mechanism
  • Retrofit doesn’t support retry policy.
  • Volley supports automatic parsing.
  • Retrofit doesn’t have inbuilt image loader support, which can be performed by using Picasso/glide library.

29.What is web service and how do you achieve it?

Ans:

Application Web Service uses Soap or REST as a means of communication.

Webservice in android can be achieved by making API call. To make an API call we can use libraries like volley, retrofit, and OK HTTP etc.

30.What is Service and types of services?

Ans:

Service is an Android component which runs in the background even when the application that started service is destroyed.

DFF

There are two types of service :

  • Bound Service: It is bound with the application and destroyed when the application or service is killed.
  • UnBound Service: It is not bound with the application, once the service is started it runs in the background even when the application which started the service is destroyed.

31.What is a singleton and what is its use?

Ans:

Singleton ensures only single instances/object will be created which can be used by all the other classes. It helps save memory since only one object is created.

32.What is a broadcast receiver?

Ans:

Broadcast Receivers are one which receives the message from other application or system itself.

Ex: The notification which we get when a battery is charged.

33.How to make a responsive application which is used in mobile and tablet?

Ans:

The application can be made responsive my creating two different layouts with same name and id’s.

  • res/layout/main_activity.xml       # For phones
  • res/layout/main_activity_tablet.xml # For tablets
  • And calling it in your java class.
  • public class MyActivity extends Activity {
  • @Override protected void onCreate(Bundle savedInstanceState) {
  • super.onCreate();
  • Configuration config = getResources().getConfiguration();
  • if (config.smallestScreenWidthDp >= 600) {
  • setContentView(R.layout.main_activity_tablet);
  • } else {
  • setContentView(R.layout.main_activity);
  • }
  • }
  • }

34.What is the limit of data storage in sqlite?

Ans:

Maximum data SQLite can store depends on the storage space of your device.

35.What is intent service?

Ans:

Intent Service is used in the long task where there is no communication with the main thread. Intentservice runs on a separate worker thread.

36.What is the use of Bundle savedInstanceState?

Ans:

savedInstanceState is a method parameter of on creates a method which saves the state of the activity.

Ex: When the activity goes into the background the state of the activity will be paused, which is stored in savedInstanceState and helps to revoke the activity from the same state.

37.What is Android?

Ans:

It is an open source operating system that is primarily used on mobile devices such as mobile phones and tablets. It is a Linux kernel-based system that contains rich components that allow developers to create and run applications that can do basic and advanced functions.

38.What is Google Android SDK?

Ans:

Google Android SDK is an instrument that developers need to encrypt and write to applications on Android-enabled devices. It has a graphical interface system that enables the Android-enabled environment to check their code and fix them.

39.Describe the Android Framework

Ans:

The main feature of Android Framework is Android Framework. All classes and methods required by developers to view applications in Android environment can be found here.

40.What is AAP?

Ans:

AAPT shortened to Android property packaging tool. This tool provides developers with the ability to handle zip-compatible archives, including the creation, extraction and viewing of its contents.

41.What is the importance of keeping an Emulator in the Android environment?

Ans:

The developer creates a “drama” around an interface that acts as a real mobile device. They can write and test codes, and even bugs. They are a safe place for testing numbers in the initial design phase.

42.Which programming language is used for Android App development?

Ans:

Java is the official programming language for Android App development. It is also possible to develop in C/ c++ language using  NDK (Android Native Development). However, the major parts of Android are written in Java programming language and the APIs are also designed primarily from Java.

43.What is APK format?

Ans:

The APK file or Android application package is the compressed file format that is used to distribute and install application software and middleware onto Google’s Android operating system. The file has .apk extension and has all the application code, resource files, certificates, and other files, compressed in it.

44.What is the life cycle of android activity?

Ans:

User navigates between different screen or app, it goes through different states in their lifecycle. So an activity lifecycle consists of 7 different methods of android.app.Activity class 

45.Define intents in Android. What are the different types of intents?

Ans:

An Intent is an “intention” to do an action.  An intent is a messaging object you can use to request an action from another app component.

Methods are used to deliver intents to different components:

  • context.startActivity(): To start an activity
  • context.startService(): To start a service
  • context.sendBroadcast(): To deliver a broadcast

Types of Intent:

  • Implicit Intent: Implicit intent is when the target component is not defined in the intent and the android system has to evaluate the registered components based on the intent data.
  • Explicit Intent: Explicit intent is when an application defines the target component directly in the intent.

46.What is the difference between an implicit intent and explicit intent?

Ans:

Implicit Intent is used whenever you are performing an action. For example, send email, SMS, dial number or you can use a Uri to specify the data type. For example:

Explicit, on the other hand, helps you to switch from one activity to another activity(often known as the target activity). It is also used to pass data using putExtra method and retrieved by other activity by getIntent().getExtras() methods.

47.What is an Android Framework?

Ans:

Android Framework is an essential part of the Android Architecture. It is a set of APIs that allows developers to write apps and has the following components:

ServicesComponents that conduct long-running operations in the background, without the inclusion of a user interface.

ServicesComponents that conduct long-running operations in the background, without the inclusion of a user interface.
IntentObjects that initiate actions from other app components, either within your program (explicit intents) or through another piece of software on the device (implicit intents).
ActivitiesComponents that provide users with screens on which they can interact with objects and perform actions. This is the base from which Intents can be deployed.
Content ProvidersComponents that enable users to access data within an app such as audio, video, images, contact information, etc.
OthersApp widgets and Processes and Threads

48.What is the difference between File, Class, and Activity in android?

Ans:

The difference between them are as follows:

  • File is a block of arbitrary information or resources for storing information. It can be any file type.
  • Class is a compiled form of .Java file which Android uses to produce an executable apk.
  • Activity is the equivalent of a Frame/Window in GUI toolkits. It is not a file or a file type but just a class that can be extended in Android to load UI elements on view.

49.What is Google Android SDK? What are the tools placed in android SDK?

Ans:

The Google Android SDK is a toolset that provides a developer the API libraries and tools required to build, test, and debug apps for Android in Windows, Mac or Linux. The tools placed in Android SDk are:

  • Android Emulator
  • DDMS: Dalvik Debug Monitoring Services
  • AAPT: Android Asset Packaging tool
  • ADB: Android debug bridge

50.What is a Toast? Write its syntax.

Ans:

  • Toast notification is a message that pops up on the window.
  • It only covers the expanse of space required for the message and the user’s recent activity remains visible and interactive.
  • The notification automatically fades in and out and does not accept interaction events.

51.What is an ANR? What are some measures you can take to avoid ANR?

Ans:

ANR stands for ‘Application Not Responding’. This dialogue is displayed if the main thread in the application has been unresponsive for a long time and in the following conditions:

  • When there is no response to an input event after 5 seconds.
  • When a broadcast receiver is not done executing within 10 seconds.

Following measures can be taken to avoid ANR:

  • To avoid ANR, an app should perform a lengthy database or networking operations in separate threads.
  • One technique is to create a child thread to prevent the Android system from concluding a code that has been unresponsive for a long period of time. Most of the actual workings of the codes can be placed within the child thread to ensure that the main thread runs with minimal unresponsive time.
  • For background task-intensive apps, you can alleviate pressure from the UI thread by using the IntentService.
Course Curriculum

Get PhoneGap Course with In-Depth Industry Topics By Expert Trainers

Weekday / Weekend BatchesSee Batch Details

52.What is AAPT?

Ans:

AAPT is short for Android Asset Packaging Tool. This tool provides developers with the ability to deal with zip-compatible archives, which includes creating, extracting as well as viewing its contents.

53.What is the use of WebView in Android?

Ans:

WebView is a view that displays web pages inside your application. According to Android, “this class is the basis upon which you can roll your own web browser or simply display some online content within your Activity. It uses the WebKit rendering engine to display web pages and includes methods to navigate forward and backward through a history, zoom in and out, perform text searches and more. In order to add WebView to your application, you have to add <WebView>element to your XML layout file.

54.What are the different kinds of context in Android?

Ans:

Context defines the current state of an App. Context provides access to creating new activity instances, access databases, start a service, etc. There is a base class ApplicationContext, and subclasses for components: Activity, Service.

55.Explain in brief about the important file and folder when you create a new app?

Ans:

  • App: It describes the fundamental characteristics of the app and defines each of its components.
  • java: This contains the .java source files for your project. By default, it includes an MainActivity.java source file. Under this, you create all the activities which have .java extensions and all the code behind the application. MainActivity.java is the actual file which gets converted to a dalvik executable and runs your app.
  • res: It is a directory for files that define your app’s user interface. You can add TextView, button etc to build the GUI and use its various attributes like android:layout_width, android:layout_height etc which are used to set its width and height. 
  • Gradle Scripts: This is an auto-generated file which contains compileSdkVersion, buildToolsVersion, applicationId, minSdkVersion, targetSdkVersion, versionCode and versionName

56.What are the different storage methods in Android?

Ans:

Android offers several options to see persistent application data.

They are:

  • Shared Preferences: Store private primitive data in key-value pairs
  • Internal Storage: Store private data on the device memory
  • External Storage: Store public data on the shared external storage
  • SQLite Databases: Store structured data in a private database

57.Can you deploy executable JARs on android? Which package is supported by it?

Ans:

No, Android does not support JAR deployments. Applications are packed into Android Package(.apk) using Android Asset Packaging Tool (APT) and then deployed on to the Android platform.

58.What is a Service? How is it implemented?

Ans:

A service in android is a background process which is used to perform long-running operations. Let’s say, a service of location is active in the background while the user is in a different application. So it does not disturb the user interaction with an activity. Now, services are classified into two types, namely:

  • Local: This service is accessed from within the application.
  • Remote:This service is accessed remotely from other applications running on the same device.

It is implemented as a subclass of Service class as follows :

  • public class MyService extends Service {
  • }

59.What is a Sticky Intent?

Ans:

A Sticky Intent is a broadcast from sendStickyBroadcast() method which floats around even after the broadcast, allowing others to collect data from 

60.Explain Folder, File & Description of Android Apps?

Ans:

  • src: contains the .java source files for your project.
  • gen: contains the .R file, a compiler-generated file that references all the resources found in your project.
  • bin: contains the Android package files .apk built by the ADT during the build process and everything else needed to run an Android application.
  • res/drawable-hdpi: this is a directory for drawable objects that are designed for high-density screens.
  • res/layout: this is a directory for files that define your app’s user interface.
  • res/values: this is a directory for other various XML files that contain a collection of resources, such as strings and colors definitions.
  • AndroidManifest.xml: this is the manifest file which describes the fundamental characteristics of the app and defines each of its components.

61.What is the difference between a fragment and an activity?

Ans:

Activity is typically a single, focused operation that a user can perform such as dial a number, take a picture, send an email, view a map etc.

Fragment is a modular section of an activity, with its own lifecycle and input events, and which can be added or removed at will. Also, a fragment’s lifecycle is directly affected by its host activity’s lifecycle i.e. when the activity is paused, so are all fragments in it, and when the activity is destroyed, so are all of its fragments.

62.Can you change the name of an application after its deployment?

Ans:

It is not recommended to change the application after its deployment. This may break some functionality.

63.What database is used in Android? How does it differ from client-server database management systems?

Ans:

SQLite is the open-source relational database. The SQLite engine is serverless, transactional, and self-contained. 

Instead of the typical client-server relationship of most database management systems, the SQLite engine is integrally linked with the application. The library can also be called dynamically and makes use of simple function calls that reduce latency in database access.

64.What is DDMS?

Ans:

DDMS stands for Dalvik Debug Monitor Server. It gives the following array of debugging features:

  • Port forwarding services
  • Screen capture on the device
  • Thread and heap information
  • Logcat
  • Incoming call and SMS spoofing
  • Network traffic tracking
  • Location data spoofing

65.What is the difference between Service and Thread?

Ans:

serviceThread
Service is like an Activity but has no interface.A Thread is a concurrent unit of execution.
A Service is not a separate process. It works in the background until the service or someone else explicitly stops it.By default, all components of the same application run in the same process and thread (called the “main” thread).
Service is not killed when an application is killed.Thread is killed when an Application is killed.
It exposes some of its functionality to other applications by calling Context.bindService().GOOGLE has brought in Handlers and loopers into android threads.

66.What are the containers?

Ans:

Containers, holds objects and widgets together, depending on which specific items are needed and in what particular arrangement that is wanted. Containers may hold labels, fields, buttons, or even child containers, as examples.

67.What is the importance of an emulator in Android?

Ans:

  • The emulator lets you play around an interface that acts as if it were an actual device.
  • It let you write and test codes, and even debug.
  • It acts as a safe place for testing codes especially if its in the early design phase.

68.Name the four essential states of an activity.

Ans:

The four essential states of activity are:

  • Active: if the activity is at the foreground
  • Paused: if the activity is at the background and still visible
  • Stopped: if the activity is not visible and therefore is hidden or obscured by another activity
  • Destroyed: when the activity process is killed or completed terminated

69.What is the difference between a regular bitmap and a nine-patch image?

Ans:

A nine-patch image, unlike bitmap, can be resized and used as background or other image sizes for the target device. The Nine-patch refers to the way you can resize the image: 4 corners that are unscaled, 4 edges that are scaled in 1 axis, and the middle one that can be scaled into both axes. This is what differentiates a nine-patch image from a regular bitmap.

70.What are the core building blocks of android?

Ans:

  • Activity : An Activity is the screen representation of any application in Android.  Each activity has a layout file where you can place your UI.
  • Content Provider: Content providers share data between applications.
  • Service: It is a component that runs in the background to perform long-running operations without interacting with the user and it even works if application is destroyed.
  • Broadcast Receivers: It respond to broadcast messages from other applications or from the system itself. These messages are sometime called events or intents.

71.What are the dialog boxes that are supported in Android?

Ans:

Android supports four dialog boxes:

  • AlertDialog: An alert dialog box supports zero to three buttons and a list of selectable elements, including checkboxes and radio buttons. Among the other dialog boxes, the most suggested dialog box is the alert dialog box.
  • ProgressDialog: This dialog box displays a progress wheel or a progress bar. It is an extension of AlertDialog and supports adding buttons.
  • DatePickerDialog: This dialog box is used for selecting a date by the user.
  • TimePickerDialog: This dialog box is used for selecting time by the user.

72.What does APK stand for? 

Ans:

APK stands for Android Packaging Kit. The Android packaging key is compressed with classes, UI’s, supportive assets and manifest. All these files are compressed to a single file which is called APK.

73.What is a sticky broadcast? Give an example.

Ans:

A sticky broadcast is used for communicating between applications. These broadcasts happen without the user being notified. The Android OS normally treats each application as if it were a separate user. Here’s an example: When you call registerReceiver() for that action — even with a null BroadcastReceiver — you get the Intent that was last broadcast for that action. Hence, you can use this to find the state of the battery without necessarily registering for all future state changes in the battery.

74.What is Dalvik Virtual Machine (DVM)?

Ans:

  • Dalvik is the name of Android’s virtual machine.
  • The Dalvik VM is an interpreter-only virtual machine that executes files in the Dalvik Executable (.dex) format.
  • The virtual machine is register-based and can run classes compiled by Java language compiler that have been altered into its native format using the included ‘dx’ tool.
  • The Dalvik core class library is envisioned to provide a familiar development base for those used to programming with Java Standard Edition, but is geared explicitly for the needs of a small mobile device.

75.What are the exceptions in android?

Ans:

  • InflateException: When error conditions occur this exception is thrown.
  • Surface.OutOfResourceException: When a Surface is not created or resized, this exception is thrown.
  • SurfaceHolder.BadSurfaceTypeException: When invoked on a Surface ‘SURFACE_TYPE_PUSH_BUFFERS’, this exception is thrown from lockCanvas() method.
  • WindowManager.BadTokenException: This exception is thrown at the time of trying to view an invalid WindowManager.LayoutParamstoken

76.What is a content provider? How is it implemented?

Ans:

  • Content providers manage access to a structured set of data. It is the standard interface that connects data in one process with code running in another process.
  • They encapsulate the data and provide mechanisms for defining data security.
  • Content providers are used to share the data between different applications.

It is implemented as a subclass of ContentProviderclass and must implement a standard set of APIs that enable other applications to perform transactions.

  • public class MyContentprovider extends ContentProvider {
  • public void onCreate(){}
  •  }

77.What is the significance of the .dex files?

Ans:

  • Android programs are compiled into ‘.dex’ (Dalvik Executable) files, which are zipped into a single .apk file on the device.
  • ‘.dex’ files can be created by translating compiled applications written in Java.
  • (.dex) is a format that is optimized for effective storage and memory-mappable executions. 

78.How are escape characters used as an attribute?

Ans:

Escape characters are preceded by double backslashes. For example – a newline character is created using ‘n’.

79.What does ADB stand for?

Ans:

ADB stands for Android Debug Bridge. It is a command line tool that is used to communicate with the emulator instance. ADB can control your device over USB from a computer, copy files back and forth, install and uninstall apps, run shell commands, and more.

It is a client-server program that includes three components:

  • Client: which runs on your development machine. You can invoke a client from a shell by issuing an ADB command. Other Android tools such as DDMS also create ADB clients.
  • Server, which runs as a background process on your development machine. The server manages communication between the client and the ADB daemon running on an emulator or device.
  • Daemon, which runs as a background process on each emulator or device instance.

80.Can you list and explain the four Java classes related to using sensors on the Android platform?

Ans:

  • Sensor Manager: This class provides methods regarding the registration of sensor event listeners, the management of data acquisition, and calibration. It also provides methods for accessing and listing sensors.
  • Sensor: This class creates an instance of a specific sensor, providing methods that allow you to determine its capabilities.
  • Sensor Event: This class provides information on a sensor event by creating a sensor event object.
  • Sensor Event Listener: This interface provides two callback methods that can receive notifications of sensor events.

81.What is an Activitycreator?

Ans:

An Activitycreator is an initial step towards the creation of the Android project. It consists of the shell script that can be used for creating a new file system that is necessary for writing codes within the Android system.

82.What are the activities in Android?

Ans:

The activities are referred to as a window to the user interface. It helps in the display of output or could even ask for inputs so that the dialog boxes and other roles can be performed to create a user interface.

83.What are intents in the Android system?

Ans:

Intents in Android system displays the notification messages to the users from an Android enabled device such as smartphone, tablet, etc. This way, attempts are made to alert the user, and response can be expected as per the intents.

84.Is there any difference between activities and services?

Ans:

Yes, there are a lot of differences between activities and services. These differences are stated as under:

ActivitiesServices
These are closedThese are open
These can be terminated at any timeThese cannot be terminated at any time
They are designed to run before the scenesThese are designed to run behind the scenes
They are dependentThey act independently
They are not continuousThey are not continuous

85.What is the use of XML based layouts?

Ans:

The XML based layouts help inconsistent and standard format for setting up of GUI definition format. The layout details are placed in XML files, and the other items are put in source files.

86.Define containers in the Android system?

Ans:

The containers in the Android system helps in holding objects and widgets together so that the specific items and arrangements can be fulfilled. These containers include labels, buttons, fields, etc.

87.Do we need Android in the mobile market?

Ans:

Yes, we need Android in the mobile market because it helps the users of smartphones to download applications that can provide a variety of services. The developers make various applications year after year. Android system gives them a platform from which they can display these applications to the smartphone users and find potential customers out of them. Android system offers paid and free applications for the users that could secure their data, act as a platform for information, and provide a variety of services as per the needs of the customers.

Phonegap Sample Resumes! Download & Edit, Get Noticed by Top Employers! Download

88.Is there any disadvantage to the Android System? List them all.

Ans:

Yes, there are several disadvantages to the Android system. These are listed below.

  • There is no policy on how the application can be adapted with the operating system versions and upgrades on smartphones.
  • Not all applications can run on every kind of operating system of smartphones. Thus the download could cause loss of data, time, and download facility.
  • Some of the applications in the Android system may not fit the screen of all kinds of smartphones.
  • The Android system offers such applications as well, which tends to collect user data. This may cause leaking of vital personal information data from smartphone users.
  • Android systems could offer download applications which may not be backed by credible sources and could cause harm to the mobile device.

89.What is the full form of ADB? Define ADB?

Ans:

The full form of ADB is Android Debug Bridge. ADB helps the developers in creating remote shell commands. The main function of ADB is to allow and control the communication process towards the emulator port and later getting a response from it.

90.What are the states in an activity?

Ans:

There are four states in an activity. These include the following.

  • Active state: In this state, the activity is in the foreground.
  • Paused state: In this state, the activity is in the background and visible.
  • Stopped state: in this state, the activity is in the background but no visible or even hidden or obscure other activities.
  • Destroyed state: In this state, the activity is completely terminated or killed or removed.

91.What is the full form of ANR? Define ANR?

Ans:

The full form of ANR is Application Not Responding. ANR is a dialogue that appears on the screen of the application user on its electronic device. It seems when the application is unresponsive for a more extended period.

92.What are the permissions in the application development process?

Ans:

The permissions in the application development process include restrictions that are imposed to protect the data and code. These permissions are applied to protect the application from getting compromised, attacked by viruses, steal away users’ information, and to cause bug defects.

93.What are the intent filters?

Ans:

The intent filters are the vital components of the Android system because it helps in responding, filtering, and receiving the right information inputs.

Are you looking training with Right Jobs?

Contact Us

Popular Courses