Select chapter



basics (6.papers)
activities (5.papers)
services (2.papers)
threads (2.papers)
receivers (1.papers)
advanced android (2.papers)
SQLite database (1.papers)
adapters (1.papers)
adb and ddms (1.papers)
widgets (1.papers)
fragments (1.papers)
UI (1.papers)
Hide

Sponsored Links


  

android interview questions and answers

Show Answer
Share Facebook gmail Twitter
2
How to create a sensormanager object to access and view list of sensors available in the phone?
  1. Sensor s = new Sensor();
  2. SensorManager s = new SensorManager(this);
  3. SensorManager s = (SensorManager) getSystemService(Context.SENSOR_SERVICE);
  4. Sensor s = (Sensor) getSystemService(Context.SENSOR_SERVICE);
Show Answer
Share Facebook gmail Twitter
3
What does below sensor code do?

sm = (SensorManager) getSystemService(Context.SENSOR_SERVICE);
List<Sensor> ls = sm.getSensorList(Sensor.TYPE_ALL);
  1. It is creating sensor manager object, and fetching all sensors available in phone of all sensor types.
  2. It is creating sensor manager object, and fetching all sensors available in phone of accelerometer type.
  3. It is creating sensor manager object, and fetching all sensors types supported by android.
  4. all of the above are true.
Show Answer
Share Facebook gmail Twitter
4
  How to fetch x,y,z co-ordinate values of accelerometer sensor in below function.
  Note: assume that, this is the function of Sensoreventlistener.  
  Note: assume that, this is registered to listen accelerometer sensor

public void onSensorChanged(SensorEvent event) {
                        
}
  1. call event.x, event.y, event.z to get the values.
  2. event[0] - contains x value, event[1] - contains y value, event[2] - contains z value.
  3. event.values[0] - contains x value, event.values[1] - contains y value, event.values[2] - contains z value.
  4. none of the above.
Show Answer
Share Facebook gmail Twitter
5
Which sensor is used to find gravitational force on each axes (x,y, &z).
  1. GyroScope
  2. Accelerometer
  3. Proximity sensor
  4. we can use any of the above 3 options for this requirement.
Show Answer
Share Facebook gmail Twitter
6
What is the sensor to use to find how much near is an object to your phone?
  1. GyroScope
  2. Accelerometer
  3. Proximity sensor
  4. Magnetometer
Show Answer
Share Facebook gmail Twitter
7
Which of the below is a Motion sensor?
  1. GyroScope
  2. Humidity sensor
  3. Proximity sensor
  4. Magnetometer
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
9
What will happen if a sensor is not unregistered, after using it for some time?
  1. Android will automatically switch off that sensor and stops it.
  2. Nothing will happen, but that sensor will keep running in background. With this no side-effect occurs.
  3. that sensor will keep running in the background, and consumes lot of battery power un-necessarily.
  4. Program will crash.
Show Answer
Share Facebook gmail Twitter
10
How to get phone location? which is better network provider or GPS provider?
  1. You can use satellite to fetch your locations.
  2. You can either use your cell tower information or WiFi information to know your phone location.
  3. using option 1 is faster and more accurate than second option. it also takes less battery power.
  4. using option 2 is faster than option1, but how ever it will not give you exact location compared to option 1. takes less battery power.
Show Answer
Share Facebook gmail Twitter
11
How to get the phone's location when battery is draining out? which feature is preferable to use to fetch my current location?
  1. Use Network Provider and disable WiFi.
  2. Use network provider and enable WiFi.
  3. Use GPS provider and fetch from satellites.
  4. either use network provider with WiFi disabled or use lastKnownLocation.
Show Answer
Share Facebook gmail Twitter
12
How to find whether GPS is disabled in the phone?
  1. if it is disabled onProviderDisabled() will be called with provider name.
  2. if it is disabled onStatusChanged() will be called with provider name.
  3. either one of the option1 or 2 will happen.
  4. There is no way to find it out.
Show Answer
Share Facebook gmail Twitter
13
I am travelling through a forest, and GPS satellite is not reachable, once I exit from forest to the area where satellite signal is available, then I want to perform some operation. how should I write this logic?
  1. Once satellite is available, onProviderEnabled() will be called. write your logic in that function.
  2. onStatusChanged() with status AVAILABLE will be called, write your code there based on this status.
  3. onStatusChanged() with status TEMPORARILY_UNAVAILABLE will be called, write your code there based on this status.
  4. Once satellite is available, your phone's signal strength will increase. use system properties to check when your signal will increase at that time execute that logic.
Show Answer
Share Facebook gmail Twitter
14
What are the permissions required to access phone's location using NETWORK_PROVIDER?
  1. ACCESS_FINELOCATION
  2. ACCESS_COARSE_LOCATION
  3. both option 1 & 2.
  4. we don't need to take any permission.
Show Answer
Share Facebook gmail Twitter
15
In which library GeoCoder class is located?
  1. android.location
  2. android.hardware
  3. com.google.android.maps
  4. none of the above.
Show Answer
Share Facebook gmail Twitter
16
When there is no network signal and satellite signal, How to fetch my phone last location where signal was available?
  1. Now it is impossible to find out location
  2. Still you can send SMS to find your last location
  3. String locationProvider = LocationManager.NETWORK_PROVIDER;
    Location lastKnownLocation = locationManager.getLastKnownLocation(locationProvider);
  4. Use option3 or use this..String locationProvider = LocationManager.GPS_PROVIDER
    
    Location lastKnownLocation = locationManager.getLastKnownLocation(locationProvider);
Show Answer
Share Facebook gmail Twitter
17
What are the permissions required to obtain phone locations?
  1. android.permission.ACCESS_FINE_LOCATION
  2. android.permission.ACCESS_COARSE_LOCATION
  3. Only option 1 is sufficient
  4. You can uese eihter option 1 or 2 or both if required
Show Answer
Share Facebook gmail Twitter
18
What is the package of Sensor framework class.
  1. android.kernel
  2. android.hardware
  3. android.sensor
  4. android.framework.sensor
Show Answer
Share Facebook gmail Twitter
19
How to get current phone location, with out using GPS, internet, WiFi, and cell tower.
If there is no cell tower signal, no WiFi access point, and no satellite signal; then is there any way to fetch my phone location?
  1. There is no other way.
  2. We can send an SMS to some one to get our location.
  3. Use lastKnownLocatoin from location manager using some provider.
  4. fetch locations using GPS.
Show Answer
Share Facebook gmail Twitter
Read more papers :