Back to project page noxdroidandroidapp.
The source code is released under:
MIT License
If you think the Android project noxdroidandroidapp listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package dk.itu.noxdroid.util; // w w w . ja v a 2 s. c o m import android.app.ActivityManager; import android.app.ActivityManager.RunningServiceInfo; import android.content.Context; public class SensorDataUtil { // Sensor output // 2.2 ? 0.5 ?A/ppm /** * * @param a the output in muA received from the sensor * @return the sensor data point converted to mu grames per sq. meter */ public static float muAtoMuGrames(float a) { return (float ) 1880.0f * a / 2.2f; } public static boolean isServiceRunning(Context context, Class<?> service) { ActivityManager manager = (ActivityManager) context.getSystemService(context.ACTIVITY_SERVICE); for (RunningServiceInfo rs : manager.getRunningServices(Integer.MAX_VALUE)) { if (service.equals(rs.service.getClass())) { return true; } } return false; } }