Skip to content

T5750/pedometer

Repository files navigation

Build Status Releases License

homepage

Pedometer

Direct apk download

Runtime Environment

What's included

  • 计步模块(类似微信运动,支付宝计步,今日步数)
  • 步数仿支付宝余额数字累加效果
  • 计算BMI指数,仿支付宝芝麻信用分仪表盘
  • HelloChart绘制今日步数柱状图
  • 设置透明状态栏,Android Version >= 4.4
  • 备份 / 还原数据库

HelloCharts for Android

  • implementation 'com.github.lecho:hellocharts-library:1.5.8@aar'
  • lecho.lib.hellocharts.view.ColumnChartView

LeakCanary

  debugImplementation 'com.squareup.leakcanary:leakcanary-android:1.6.1'
  releaseImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.6.1'
public class ExampleApplication extends Application {
  @Override 
  public void onCreate() {
    super.onCreate();
    if (LeakCanary.isInAnalyzerProcess(this)) {
      // This process is dedicated to LeakCanary for heap analysis.
      // You should not init your app in this process.
      return;
    }
    LeakCanary.install(this);
    // Normal app init code...
  }
}

启动Activity的shell命令

adb shell am start -n [包名]/[Activity名]
adb shell am start -n com.evangel.pedometer/com.evangel.pedometer.activity.MainActivity

Android Debug Database

  1. debugImplementation 'com.amitshekhar.android:debug-db:1.0.4'
  2. Genymotion -> Configuration -> Network mode -> Bridge
  3. D/DebugDB: Open http://xxx.xxx.xxx.xxx:8080 in your browser

Logger

  1. implementation 'com.orhanobut:logger:2.2.0'
  2. Logger.addLogAdapter(new AndroidLogAdapter());
  3. Logger.d("hello");

Changed Android Studio from 3.1.4 to 3.3 Canary 5.

Tips

  • 一些不能后台的手机,需告诉用户每天早上打开一次app才可以正常计步
  • 数据库中,运动数据保存366天,TodayStepService.DB_LIMIT
  • 保存数据库的频率,TodayStepService.DB_SAVE_COUNTER
  • 卡路里,目前默认按体重60kg来进行计算
  • 设置中的提醒,仅供参考

References

License

Pedometer is Open Source software released under the Apache 2.0 license.