step counter

// Step 3: Implement [url removed, login to view] method

public void onSensorChanged(SensorEvent event) {

Sensor sensor = [url removed, login to view];

float[] values = [url removed, login to view];

int value = -1;

SharedPreferences setting = getSharedPreferences(PREFS_NAME,0);

DecimalFormat df = new DecimalFormat("#.###");

String myheight = [url removed, login to view]("Height","");

String myweight = [url removed, login to view]("Weight","");

double onestep = ( [url removed, login to view]);//one step in mile

// Calorie calculations from equation: (METs x 3.5 x body weight in kg)/200 = calories/minute

double oneSetpCalPerOneKilo = [url removed, login to view];

// if user walk 1 mile and weight is 1 kg he/she will burn [url removed, login to view]

double calTest = [url removed, login to view](myweight);

double oneStepCalories = (oneSetpCalPerOneKilo*calTest)/(2112);

// 2112 steps in one mile if steps length is 30 inches

// if user weight is 70 kilogram and walk 1 mile 70*[url removed, login to view] = [url removed, login to view] calories burn

// in one mile Total steps are 2112

if ([url removed, login to view] > 0) {

value = (int) values[0];

}

if ([url removed, login to view]() == Sensor.TYPE_STEP_COUNTER) {

[url removed, login to view]("" + value);

[url removed, login to view]("" + [url removed, login to view](onestep * value));

[url removed, login to view]("" + [url removed, login to view](oneStepCalories * value));

} else if ([url removed, login to view]() == Sensor.TYPE_STEP_DETECTOR) {

[url removed, login to view]("" + value);

[url removed, login to view]("" + [url removed, login to view](onestep * value));

[url removed, login to view]("" + [url removed, login to view](oneStepCalories * value));

}

startService(new Intent(this, [url removed, login to view]));

}

Habilidades: Android, Linux, Mobile App Development, PHP, Área de trabalho do Windows