Answer: D i,ii,iii,&iv
Show Answer and ExplanationAnswer: C SensorManager s = (SensorManager) getSystemService(Context.SENSOR_SERVICE); Description:
Show Answer and Explanation
Answer: A It is creating sensor manager object, and fetching all sensors available in phone of all sensor types.
Description:
Answer: C event.values[0] - contains x value, event.values[1] - contains y value, event.values[2] - contains z value.
Description: Accelerometer sensor will sens the acceleration force on all 3 axes (x,y,z) and send that even to onSensorChanged().
SensorEvent object is a data structure which will contain all the information about incoming sensor event.. event.values[0] - contains x value, event.values[1] - contains y value, event.values[2] - contains z value.
Answer: A Accelerometer
Description: Accelerometer is used to find the gravitational force on all 3-axes.
Answer: C Proximity sensor
Description: Proximity sensor is used to find the the distance of an object from the phone.
Answer: A GyroScope
Description: GyroScope is used to find the motion of phone on each axis.
Answer: B i & ii
Description: Magnetometer & proximity sensors belong to positional sensor type.
Answer: C that sensor will keep running in the background, and consumes lot of battery power un-necessarily.
Description: If we forget to un-register a sensor after registering, then that sensor will keep running in the background, and consumes lot of battery power un-necessarily.
Answer: D 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.
Description: To find location of your phone there are two ways. 1.using network provider info, which makes use of nearest cell tower information or WiFi information to find location. how ever it is not so accurate but gives you nearest location details. it is faster and take less batter power. 2. GPS provider, which makes use of satellites to fetch information of your phone. it is very accurate most of the times and gives exact location details. how ever it is slow and may take more batter power. both will not cost you any thing.
Answer: D either use network provider with WiFi disabled or use lastKnownLocation.
Description: If battery is draining out, then we should not use too much of battery power. Using GPS or WiFi will take lot of battery power. so either use network provider with cell tower or use GPS and get last known location.
Answer: A if it is disabled onProviderDisabled() will be called with provider name.
Description: if GPS is disabled then onProviderDisabled() function of LocationListener class will be called with provider name.
Answer: B onStatusChanged() with status AVAILABLE will be called, write your code there based on this status.
Description: onStatusChanged() with status AVAILABLE will be called, write your code there based on this status.
Answer: C both option 1 & 2.
Description: NETWORK_PROVIDER will fetch locations either by using WiFi point or cell tower information. for cell tower we have to use COARSE_LOCATION permission and for WiFi we have to use FINELOCATION permission.
Answer: A android.location
Description: GeoCoding is part of location's package. It is not related with Maps library.
Answer: D Use option3 or use this..String locationProvider = LocationManager.GPS_PROVIDER
Location lastKnownLocation = locationManager.getLastKnownLocation(locationProvider);
Description: String locationProvider = LocationManager.NETWORK_PROVIDER;
// Or use LocationManager.GPS_PROVIDER
Location lastKnownLocation = locationManager.getLastKnownLocation(locationProvider);
This should give your last known location. Use GPS_PROVIDER for better results.
Answer: D You can uese eihter option 1 or 2 or both if required
Description: android.permission.ACCESS_FINE_LOCATION - use this if you are using GPS features in your programming. else android.permission.ACCESS_COARSE_LOCATION - use this if you are fetching locations based on career network or by using WiFi.
Answer: C android.hardware
Description:
Answer: C Use lastKnownLocatoin from location manager using some provider.
Description: Even if there are no cell tower signal, no WiFi access point, and no satellite signal, still we can find last known location using any of the above two providers. use lastKnownLocation() using locationmanager object.
Note : if GPS was turned off recently, then you can get the last known location from gps, which gives more relevant location.