Accenture Interview Questions For Android Developer

1 What is the life cycle of Android activity?

  • OnCreate(): It is called when activity is created. Using this, the views are created and data is collected from bundles.
  • OnStart(): It is called if the activity is becoming visible to the user. It may be succeeded by onResume() if the activity comes to the foreground, or onStop() if it becomes hidden.
  • OnResume(): It is called when the activity will start an interaction with the user.
  • OnPause(): This is called when the activity is moving to the background but hasn’t been killed yet.
  • OnStop(): This is called when an activity is no longer visible to the user.
  • OnDestroy(): This is called when the activity is finished or destroyed.
  • OnRestart(): This is called after the activity has been stopped, prior to it being started again.
  • Android-based devices have a collection of built-in sensors in them, which measure certain parameters like motion, orientation, and many more through their high accuracy. The sensors can be both hardware and software based on nature. There are three prominent categories of sensors in Android devices. They are:

  • Position Sensor: It is used for measuring the physical position of the Android device. This has orientation sensors and magnetometers.
  • Motion Sensors: These sensors consist of gravity, rotational activity, and acceleration sensors which measure the rotation of the device or the acceleration, etc.
  • Environmental Sensor: It includes sensors that measure temperature, humidity, pressure, and other environmental factors.
  • 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.

    Master Most in Demand Skills Now !

    1 Explain the dialog boxes supported on Android.

    Android supports four dialog boxes. They are:

  • AlertDialog:
    • The AlertDialog supports 0-3 buttons, along with a list of selectable items such as checkboxes and radio buttons.
    • It is used when you want to ask the user about taking a decision between yes or no in response to any particular action taken by the user, by remaining in the same activity and without changing the screen.
  • DatePickerDialog:
    • It is used for selecting the date by the user.
  • TimePickerDialog:
    • Used for selecting the time by the user.
  • ProgressDialog:
    • It is an extension of the AlertDialog and is used to display a progress bar. It also supports the addition of buttons.
    • This class was deprecated in API level 26 because it prevents the user from interacting with the application. Instead of this class, we can use a progress indicator such as ProgressBar, which can be embedded in the user interface of your application.
  • What is the use of Bundle in Android?

    Bundles are used to pass the required data between various Android activities. These are like HashMap that can take trivial data types. Below code shows how to transfer a piece of data by using bundle:

    What is action in Android?

    In Android, an action is a description of something that an intent sender desires.

    Syntax:

    Contained in:

    Description: It adds an action to an intent filter. An element must contain one or more elements. If it doesn’t contain any, no Intent objects will get through the filter.

    Have you got more queries? Come to our Community and get them clarified today!

    Webinar | Interview Preparation Strategies | Accenture

    Related Posts

    Leave a Reply

    Your email address will not be published. Required fields are marked *