Service with temperature sensor
Hi, do someone know how could I make this service to read the temperature each 10 seconds and then show it on the log?
public class Servicio extends JobService {
@Override
public boolean onStartJob(JobParameters params) {
return false;
}
@Override
public boolean onStopJob(JobParameters params) {
return false;
}
private Handler mJobHandler = new Handler(new Handler.Callback() {
@Override
public boolean handleMessage( Message msg ) {
Toast.makeText( getApplicationContext(),
"JobService task running", Toast.LENGTH_SHORT )
.show();
jobFinished( (JobParameters) msg.obj, false );
return true;
}
} );
}
This discussion has been closed.
Comments