Steps count extension

Hello all

can any one help me to convert this code kodular IDE for extension as i am getting error

some one help me how we can arrange this code according to kodular IDE

/The app should check if the permission is granted already/
if (ContextCompat.checkSelfPermission(thisActivity, Manifest.permission.ACTIVITY_RECOGNITION)
!= PackageManager.PERMISSION_GRANTED) {
// Permission is not granted
}
/To request the permission/
ActivityCompat.requestPermissions(thisActivity,
arrayOf(Manifest.permission.ACTIVITY_RECOGNITION),
MY_PERMISSIONS_REQUEST_ACTIVITY_RECOGNITION);

/* app can read the current daily step*/
private class VerifyDataTask extends AsyncTask<Void, Void, Void> {
protected Void doInBackground(Void… params) {

    long total = 0;

    PendingResult<DailyTotalResult> result = Fitness.HistoryApi.readDailyTotal(mClient, DataType.TYPE_STEP_COUNT_DELTA);
    DailyTotalResult totalResult = result.await(30, TimeUnit.SECONDS);
    if (totalResult.getStatus().isSuccess()) {
        DataSet totalSet = totalResult.getTotal();
        total = totalSet.isEmpty()
                ? 0
                : totalSet.getDataPoints().get(0).getValue(Field.FIELD_STEPS).asInt();
    } else {
        Log.w(TAG, "There was a problem getting the step count.");
    }

    Log.i(TAG, "Total steps: " + total);

    return null;
}

}

Kodular already has a pedometer

Selection_999(766)

Hi peter,

Thank you yes i have used that component but problem is if just touch or shake u r mobile it will count the steps that y i need this extension as i heard google fit will count the steps 80% accurate and if u shake mobile fast then only it will count else not please help me on this.

hi peter Any solution please helpp me

i think @Deep_Host can Help You in this, Because he is Good in Coding And Making Extensions.

Hi @ImranTariq

Ya i know thats y i have sent so many email to @Deep_Host but he is not replying if any one help me in this

i am not good in coding else i could help you i think he is busy in there work or he is not checking there inbox try to message to group of kodular extension developers or contact @Deep_Host at there youtube channel

@Deep_Host please help me bro

1 Like

@hammerhai

Hi Meteorcoder could you help me on this extension