Sapient Company Programming

locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER,0,0,locationListener)
In this line of code, what is the use of the second and third parameter?

1) These are used to control the frequency at which the listener receives updates.
2) These are used to specify the number of location providers.
3) Both of the above
4) None of the above

Read Solution (Total 1)

Sapient Other Question

Which units of measurement is used by TYPE_TEMPERATURE?
1) celsius
2) lx
3) %
4) hPa or mbar
What will be the output of the following code?

public void onSensorChanged(SensorEvent event){
final float alpha = 0.8;
}

gravity[0] = alpha * gravity[0] + (1 - alpha) * event.values[0];
gravity[1] = alpha * gravity[1] + (1 - alpha) * event.values[1];
gravity[2] = alpha * gravity[2] + (1 - alpha) * event.values[2];
linear_acceleration[0] = event.values[0] - gravity[0];
linear_acceleration[1] = event.values[1] - gravity[1];
line

1) Runs successfully
2) Compile time error
3) Runtime error
4) None of the above