Android interview questions

Android interview questions Download Android interview questions PDF

Android interview questions

The four initial stages of the activity are as followed:

  • Active: If the activity is in the foreground that means it is running on the device.
  • Paused: When the activity is at the background and is still visible on the screen.
  • Stopped: when the activity is not visible and is actually hidden by another activity that is running on the device.
  • Destroyed: when the activation process is killed or is terminated, it’s considered to be completely destroyed.

Default resources contain the default string and files. If this resource is not present the error will keep occurring, and the app will not be able to run. Resources are placed in subdirectories under the project res/ directory. Moreover, therefore helps the app to function in the desired conditions.

In a general term, the container means some object that can be used to hold or to procure. In a similar manner here, containers are used to hold objects and the widgets altogether.It depends on which specific item is it required and what kind of arrangement is needed. It can be used to hold labels, fields or buttons.

Android supports C++, C. The app can be developed in C or C++ using Android NDK (Native development kit). This makes system works faster.

The important items for Android projects are:

  • AndroidManifest.xml
  • Build.xml
  • Bin/
  • Src/
  • Res/assets/

Every application should have an Androidmanifest.xml file at the root of the project source set. This file describes the essential information required by the user for the app to the Android build tools. Apart from this, it is required for the following reasons:

  • To give permission that the application requires to ensure the access is protected.
  • To provide with the hardware and software features, which the app requires when installing from Google play etc.

A nine- patch image allows the resizing of the image that can be used as background or other image size requirements for the target device. The nine- patch refers to the way one can resize the image. It can be done in the in the following manners

  • 4-image corner unscaled one.
  • Four edges, scaled in 1 axis
  • The last middle one that can be scaled into both the axes.

Fragments are reusable in nature and is a portion of an activity. In other words, it is modular that can be combined or is movable in an activity.

Few of the disadvantages of Android in the mobile market are as follows:

  • Developers can write and register apps that will only run under the Android environment.
  • With the growing popularity and demand for the Android mobile devices, developers can easily take advantage of this trend by uploading the app on the market for the distribution purpose, and people can download it.

It is an instruction for Android OS that specifies how the activity should be launched or performed. The activities are performed into two areas, which are:

  • Tasks: It’s a collection of activities, with which the users interact when they perform certain jobs. An application contains a number of activities.
  • Back Stack: Back stack in a back stack the activities are arranged with the order in which each is opened. This maintained stack called back stack.

Terminating or killing the foreground activity is the last and final savior. It is generally desirable or is the best time to kill this activity when it is consuming too much of memory. When the memory paging state is reached by the activity, it is killed so that the interface can sustain the responsiveness of the user of the application.

Android provides some options to save or store the app data. Here the choice depends on the specific needs and requirement of space by the users.

Few of the data storage options available on Android are as follows:

  • Internal file storage: stores the private file on the device file system.
  • External file storage: stores the file on the shared external file system.
  • Shared preferences: stores the private primitive data in key-value pairs.
  • Databases: stores the structured data in a private database.

To expose one app’s data to other apps, the content provider can be used.

Portable Wi-Fi hotspot allows the users to share a mobile Internet connection with another device. Using an Android powered phone as a Wi-Fi hotspot user can use their laptop to connect to the Internet using the same access point.