├── settings.gradle ├── open_fit-web.png ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── app ├── src │ └── main │ │ ├── res │ │ ├── drawable-hdpi │ │ │ ├── open_add.png │ │ │ ├── open_btc.png │ │ │ ├── open_btd.png │ │ │ ├── open_del.png │ │ │ ├── open_fit.png │ │ │ ├── open_off.png │ │ │ ├── open_rem.png │ │ │ ├── open_run.png │ │ │ ├── open_sms.png │ │ │ ├── open_alarm.png │ │ │ ├── open_bike.png │ │ │ ├── open_clock.png │ │ │ ├── open_email.png │ │ │ ├── open_heart.png │ │ │ ├── open_help.png │ │ │ ├── open_info.png │ │ │ ├── open_phone.png │ │ │ ├── open_play.png │ │ │ ├── open_sleep.png │ │ │ ├── open_stand.png │ │ │ ├── open_sync.png │ │ │ ├── open_walk.png │ │ │ ├── open_donate.png │ │ │ ├── open_location.png │ │ │ ├── open_off_noti.png │ │ │ ├── open_reject.png │ │ │ ├── open_settings.png │ │ │ ├── open_weather.png │ │ │ └── open_fit_notification.png │ │ ├── drawable-mdpi │ │ │ ├── open_add.png │ │ │ ├── open_btc.png │ │ │ ├── open_btd.png │ │ │ ├── open_del.png │ │ │ ├── open_fit.png │ │ │ ├── open_off.png │ │ │ ├── open_rem.png │ │ │ ├── open_run.png │ │ │ ├── open_sms.png │ │ │ ├── open_alarm.png │ │ │ ├── open_bike.png │ │ │ ├── open_clock.png │ │ │ ├── open_email.png │ │ │ ├── open_heart.png │ │ │ ├── open_help.png │ │ │ ├── open_info.png │ │ │ ├── open_phone.png │ │ │ ├── open_play.png │ │ │ ├── open_sleep.png │ │ │ ├── open_stand.png │ │ │ ├── open_sync.png │ │ │ ├── open_walk.png │ │ │ ├── open_donate.png │ │ │ ├── open_location.png │ │ │ ├── open_off_noti.png │ │ │ ├── open_reject.png │ │ │ ├── open_settings.png │ │ │ ├── open_weather.png │ │ │ └── open_fit_notification.png │ │ ├── drawable-xhdpi │ │ │ ├── open_add.png │ │ │ ├── open_bike.png │ │ │ ├── open_btc.png │ │ │ ├── open_btd.png │ │ │ ├── open_del.png │ │ │ ├── open_fit.png │ │ │ ├── open_help.png │ │ │ ├── open_info.png │ │ │ ├── open_off.png │ │ │ ├── open_play.png │ │ │ ├── open_rem.png │ │ │ ├── open_run.png │ │ │ ├── open_sms.png │ │ │ ├── open_sync.png │ │ │ ├── open_walk.png │ │ │ ├── open_alarm.png │ │ │ ├── open_clock.png │ │ │ ├── open_donate.png │ │ │ ├── open_email.png │ │ │ ├── open_heart.png │ │ │ ├── open_phone.png │ │ │ ├── open_reject.png │ │ │ ├── open_sleep.png │ │ │ ├── open_stand.png │ │ │ ├── open_weather.png │ │ │ ├── open_location.png │ │ │ ├── open_off_noti.png │ │ │ ├── open_settings.png │ │ │ └── open_fit_notification.png │ │ ├── drawable-xxhdpi │ │ │ ├── open_add.png │ │ │ ├── open_btc.png │ │ │ ├── open_btd.png │ │ │ ├── open_del.png │ │ │ ├── open_fit.png │ │ │ ├── open_off.png │ │ │ ├── open_rem.png │ │ │ ├── open_run.png │ │ │ ├── open_sms.png │ │ │ ├── open_alarm.png │ │ │ ├── open_bike.png │ │ │ ├── open_clock.png │ │ │ ├── open_donate.png │ │ │ ├── open_email.png │ │ │ ├── open_heart.png │ │ │ ├── open_help.png │ │ │ ├── open_info.png │ │ │ ├── open_phone.png │ │ │ ├── open_play.png │ │ │ ├── open_reject.png │ │ │ ├── open_sleep.png │ │ │ ├── open_stand.png │ │ │ ├── open_sync.png │ │ │ ├── open_walk.png │ │ │ ├── open_location.png │ │ │ ├── open_off_noti.png │ │ │ ├── open_settings.png │ │ │ ├── open_weather.png │ │ │ └── open_fit_notification.png │ │ ├── values │ │ │ ├── dimens.xml │ │ │ ├── styles.xml │ │ │ └── arrays.xml │ │ ├── values-v11 │ │ │ └── styles.xml │ │ ├── values-w820dp │ │ │ └── dimens.xml │ │ ├── values-v14 │ │ │ └── styles.xml │ │ ├── layout │ │ │ ├── checkbox.xml │ │ │ ├── fitness.xml │ │ │ └── reject_messages.xml │ │ ├── values-fr │ │ │ ├── arrays.xml │ │ │ └── strings.xml │ │ ├── menu │ │ │ └── main.xml │ │ ├── values-zh-rCN │ │ │ └── strings.xml │ │ ├── values-zh-rTW │ │ │ └── strings.xml │ │ ├── values-ko │ │ │ └── strings.xml │ │ ├── values-af │ │ │ └── strings.xml │ │ ├── values-th │ │ │ └── strings.xml │ │ ├── values-ru │ │ │ └── strings.xml │ │ ├── values-de │ │ │ └── strings.xml │ │ ├── values-pl │ │ │ └── strings.xml │ │ ├── values-pt │ │ │ └── strings.xml │ │ ├── values-nl │ │ │ └── strings.xml │ │ ├── values-it │ │ │ └── strings.xml │ │ ├── values-es │ │ │ └── strings.xml │ │ ├── values-hu │ │ │ └── strings.xml │ │ └── xml │ │ │ └── preferences.xml │ │ ├── java │ │ └── com │ │ │ └── solderbyte │ │ │ └── openfit │ │ │ ├── StartOpenFitAtBootReceiver.java │ │ │ ├── ui │ │ │ ├── DialogHelp.java │ │ │ ├── DialogPurchase.java │ │ │ ├── DialogNotificationAccess.java │ │ │ ├── ArrayAdapterWithIcon.java │ │ │ ├── ArrayAdapterFitness.java │ │ │ ├── DialogNews.java │ │ │ ├── DialogAddApplication.java │ │ │ ├── DialogDelApplication.java │ │ │ └── DialogRejectMessages.java │ │ │ ├── GPSData.java │ │ │ ├── util │ │ │ ├── OpenFitDataTypeAndString.java │ │ │ ├── OpenFitDataType.java │ │ │ ├── OpenFitTimeZoneUtil.java │ │ │ └── OpenFitIntent.java │ │ │ ├── HeartRateData.java │ │ │ ├── SleepInfo.java │ │ │ ├── PedometerTotal.java │ │ │ ├── Alarm.java │ │ │ ├── DialerListener.java │ │ │ ├── ExerciseDatabase.java │ │ │ ├── SleepData.java │ │ │ ├── SmsListener.java │ │ │ ├── Cronjob.java │ │ │ ├── MmsListener.java │ │ │ ├── PedometerData.java │ │ │ ├── ProfileData.java │ │ │ ├── HttpClient.java │ │ │ ├── ExerciseData.java │ │ │ ├── OpenFitSavedPreferences.java │ │ │ ├── Weather.java │ │ │ └── protocol │ │ │ └── OpenFitNotificationGeneralProtocol.java │ │ └── AndroidManifest.xml └── build.gradle ├── README.md ├── .gitignore ├── .classpath ├── OpenFit.iml ├── .project ├── LICENSE ├── import-summary.txt ├── gradlew.bat └── gradlew /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | -------------------------------------------------------------------------------- /open_fit-web.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/open_fit-web.png -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/open_add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-hdpi/open_add.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/open_btc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-hdpi/open_btc.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/open_btd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-hdpi/open_btd.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/open_del.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-hdpi/open_del.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/open_fit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-hdpi/open_fit.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/open_off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-hdpi/open_off.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/open_rem.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-hdpi/open_rem.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/open_run.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-hdpi/open_run.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/open_sms.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-hdpi/open_sms.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/open_add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-mdpi/open_add.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/open_btc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-mdpi/open_btc.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/open_btd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-mdpi/open_btd.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/open_del.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-mdpi/open_del.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/open_fit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-mdpi/open_fit.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/open_off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-mdpi/open_off.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/open_rem.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-mdpi/open_rem.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/open_run.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-mdpi/open_run.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/open_sms.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-mdpi/open_sms.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/open_alarm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-hdpi/open_alarm.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/open_bike.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-hdpi/open_bike.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/open_clock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-hdpi/open_clock.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/open_email.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-hdpi/open_email.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/open_heart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-hdpi/open_heart.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/open_help.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-hdpi/open_help.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/open_info.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-hdpi/open_info.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/open_phone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-hdpi/open_phone.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/open_play.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-hdpi/open_play.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/open_sleep.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-hdpi/open_sleep.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/open_stand.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-hdpi/open_stand.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/open_sync.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-hdpi/open_sync.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/open_walk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-hdpi/open_walk.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/open_alarm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-mdpi/open_alarm.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/open_bike.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-mdpi/open_bike.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/open_clock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-mdpi/open_clock.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/open_email.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-mdpi/open_email.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/open_heart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-mdpi/open_heart.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/open_help.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-mdpi/open_help.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/open_info.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-mdpi/open_info.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/open_phone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-mdpi/open_phone.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/open_play.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-mdpi/open_play.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/open_sleep.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-mdpi/open_sleep.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/open_stand.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-mdpi/open_stand.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/open_sync.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-mdpi/open_sync.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/open_walk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-mdpi/open_walk.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/open_add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-xhdpi/open_add.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/open_bike.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-xhdpi/open_bike.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/open_btc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-xhdpi/open_btc.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/open_btd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-xhdpi/open_btd.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/open_del.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-xhdpi/open_del.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/open_fit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-xhdpi/open_fit.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/open_help.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-xhdpi/open_help.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/open_info.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-xhdpi/open_info.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/open_off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-xhdpi/open_off.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/open_play.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-xhdpi/open_play.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/open_rem.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-xhdpi/open_rem.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/open_run.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-xhdpi/open_run.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/open_sms.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-xhdpi/open_sms.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/open_sync.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-xhdpi/open_sync.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/open_walk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-xhdpi/open_walk.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/open_add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-xxhdpi/open_add.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/open_btc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-xxhdpi/open_btc.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/open_btd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-xxhdpi/open_btd.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/open_del.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-xxhdpi/open_del.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/open_fit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-xxhdpi/open_fit.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/open_off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-xxhdpi/open_off.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/open_rem.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-xxhdpi/open_rem.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/open_run.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-xxhdpi/open_run.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/open_sms.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-xxhdpi/open_sms.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/open_donate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-hdpi/open_donate.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/open_location.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-hdpi/open_location.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/open_off_noti.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-hdpi/open_off_noti.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/open_reject.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-hdpi/open_reject.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/open_settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-hdpi/open_settings.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/open_weather.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-hdpi/open_weather.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/open_donate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-mdpi/open_donate.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/open_location.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-mdpi/open_location.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/open_off_noti.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-mdpi/open_off_noti.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/open_reject.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-mdpi/open_reject.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/open_settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-mdpi/open_settings.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/open_weather.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-mdpi/open_weather.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/open_alarm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-xhdpi/open_alarm.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/open_clock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-xhdpi/open_clock.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/open_donate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-xhdpi/open_donate.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/open_email.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-xhdpi/open_email.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/open_heart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-xhdpi/open_heart.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/open_phone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-xhdpi/open_phone.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/open_reject.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-xhdpi/open_reject.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/open_sleep.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-xhdpi/open_sleep.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/open_stand.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-xhdpi/open_stand.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/open_weather.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-xhdpi/open_weather.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/open_alarm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-xxhdpi/open_alarm.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/open_bike.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-xxhdpi/open_bike.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/open_clock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-xxhdpi/open_clock.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/open_donate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-xxhdpi/open_donate.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/open_email.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-xxhdpi/open_email.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/open_heart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-xxhdpi/open_heart.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/open_help.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-xxhdpi/open_help.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/open_info.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-xxhdpi/open_info.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/open_phone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-xxhdpi/open_phone.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/open_play.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-xxhdpi/open_play.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/open_reject.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-xxhdpi/open_reject.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/open_sleep.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-xxhdpi/open_sleep.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/open_stand.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-xxhdpi/open_stand.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/open_sync.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-xxhdpi/open_sync.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/open_walk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-xxhdpi/open_walk.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/open_location.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-xhdpi/open_location.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/open_off_noti.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-xhdpi/open_off_noti.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/open_settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-xhdpi/open_settings.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/open_location.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-xxhdpi/open_location.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/open_off_noti.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-xxhdpi/open_off_noti.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/open_settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-xxhdpi/open_settings.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/open_weather.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-xxhdpi/open_weather.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/open_fit_notification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-hdpi/open_fit_notification.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/open_fit_notification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-mdpi/open_fit_notification.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/open_fit_notification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-xhdpi/open_fit_notification.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/open_fit_notification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jareddlc/OpenFit/HEAD/app/src/main/res/drawable-xxhdpi/open_fit_notification.png -------------------------------------------------------------------------------- /app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 16dp 5 | 16dp 6 | 7 | 8 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Sun Mar 31 15:46:50 PDT 2019 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip 7 | -------------------------------------------------------------------------------- /app/src/main/res/values-v11/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # OpenFit 2 | Open source application for the Samsung Gear Fit 3 | 4 | ![OpenFit](https://raw.githubusercontent.com/jareddlc/OpenFit/master/open_fit-web.png) 5 | 6 | ### What is OpenFit 7 | 8 | OpenFit is an open source alternative to the Gear Fit Manager (which cannot be run natively on non-samsung devices), with hopes that it will provide most/all of the features provided by the Gear Fit Manager app and possibly even more. 9 | -------------------------------------------------------------------------------- /app/src/main/res/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 64dp 9 | 10 | 11 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Built application files 2 | *.apk 3 | *.ap_ 4 | 5 | # Files for the Dalvik VM 6 | *.dex 7 | 8 | # Java class files 9 | *.class 10 | 11 | # Generated files 12 | bin/ 13 | gen/ 14 | 15 | # Gradle files 16 | .gradle/ 17 | build/ 18 | .idea/ 19 | .idea/workspace.xml 20 | 21 | 22 | # Local configuration file (sdk path, etc) 23 | local.properties 24 | 25 | # Proguard folder generated by Eclipse 26 | proguard/ 27 | 28 | # Log Files 29 | *.log 30 | -------------------------------------------------------------------------------- /app/src/main/res/values-v14/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/layout/checkbox.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | 10 | 16 | 17 | -------------------------------------------------------------------------------- /app/src/main/res/values-fr/arrays.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Aucun périphérique appairé 5 | 6 | 7 | Aucun 8 | 9 | 10 | Aucune mise à jour 11 | Notifications °F 12 | Horloge avec météo °F 13 | Horloge avec météo + notif °F 14 | Notifications °C 15 | Horloge avec météo °C 16 | Horloge avec météo + notif °C 17 | 18 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 28 5 | 6 | defaultConfig { 7 | applicationId "com.solderbyte.openfit" 8 | minSdkVersion 19 9 | targetSdkVersion 28 10 | } 11 | 12 | buildTypes { 13 | release { 14 | minifyEnabled false 15 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' 16 | } 17 | } 18 | 19 | lintOptions { 20 | checkReleaseBuilds false 21 | } 22 | } 23 | 24 | dependencies { 25 | implementation 'com.android.support:support-v4:28.0.0' 26 | implementation 'com.google.android.gms:play-services-base:16.1.0' 27 | implementation 'com.google.android.gms:play-services-fitness:16.0.1' 28 | } 29 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 14 | 15 | 16 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /app/src/main/java/com/solderbyte/openfit/StartOpenFitAtBootReceiver.java: -------------------------------------------------------------------------------- 1 | package com.solderbyte.openfit; 2 | 3 | 4 | import android.content.BroadcastReceiver; 5 | import android.content.Context; 6 | import android.content.Intent; 7 | import android.os.Build; 8 | 9 | public class StartOpenFitAtBootReceiver extends BroadcastReceiver { 10 | 11 | @Override 12 | public void onReceive(Context context, Intent intent) { 13 | if (Intent.ACTION_BOOT_COMPLETED.equals(intent.getAction())) { 14 | Intent serviceIntent = new Intent(context, OpenFitService.class); 15 | 16 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { 17 | context.startForegroundService(serviceIntent); 18 | } else { 19 | context.startService(serviceIntent); 20 | } 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /OpenFit.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /app/src/main/res/menu/main.xml: -------------------------------------------------------------------------------- 1 | 4 | 9 | 10 | 15 | 16 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | OpenFit 4 | 5 | 6 | 7 | 8 | 9 | com.android.ide.eclipse.adt.ResourceManagerBuilder 10 | 11 | 12 | 13 | 14 | com.android.ide.eclipse.adt.PreCompilerBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.jdt.core.javabuilder 20 | 21 | 22 | 23 | 24 | com.android.ide.eclipse.adt.ApkBuilder 25 | 26 | 27 | 28 | 29 | 30 | com.android.ide.eclipse.adt.AndroidNature 31 | org.eclipse.jdt.core.javanature 32 | 33 | 34 | -------------------------------------------------------------------------------- /app/src/main/java/com/solderbyte/openfit/ui/DialogHelp.java: -------------------------------------------------------------------------------- 1 | package com.solderbyte.openfit.ui; 2 | 3 | import com.solderbyte.openfit.R; 4 | 5 | import android.app.AlertDialog; 6 | import android.app.Dialog; 7 | import android.app.DialogFragment; 8 | import android.content.DialogInterface; 9 | import android.os.Bundle; 10 | 11 | public class DialogHelp extends DialogFragment { 12 | 13 | public DialogHelp() {} 14 | 15 | @Override 16 | public Dialog onCreateDialog(Bundle savedInstanceState) { 17 | AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); 18 | builder.setTitle(R.string.dialog_title_help); 19 | builder.setMessage(R.string.dialog_message_help); 20 | builder.setPositiveButton(R.string.dialog_close_help, new DialogInterface.OnClickListener() { 21 | public void onClick(DialogInterface dialog, int index) {} 22 | }); 23 | 24 | return builder.create(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/src/main/java/com/solderbyte/openfit/ui/DialogPurchase.java: -------------------------------------------------------------------------------- 1 | package com.solderbyte.openfit.ui; 2 | 3 | import android.app.AlertDialog; 4 | import android.app.Dialog; 5 | import android.app.DialogFragment; 6 | import android.content.DialogInterface; 7 | import android.os.Bundle; 8 | 9 | import com.solderbyte.openfit.R; 10 | 11 | public class DialogPurchase extends DialogFragment { 12 | public DialogPurchase() {} 13 | 14 | @Override 15 | public Dialog onCreateDialog(Bundle savedInstanceState) { 16 | AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); 17 | builder.setTitle(R.string.dialog_title_purchase); 18 | builder.setMessage(R.string.dialog_message_purchase); 19 | builder.setPositiveButton(R.string.dialog_close_purchase, new DialogInterface.OnClickListener() { 20 | public void onClick(DialogInterface dialog, int index) {} 21 | }); 22 | 23 | return builder.create(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /app/src/main/java/com/solderbyte/openfit/GPSData.java: -------------------------------------------------------------------------------- 1 | package com.solderbyte.openfit; 2 | 3 | public class GPSData { 4 | 5 | private float totalDistance; 6 | private float speed; 7 | private float lon; 8 | private float lat; 9 | private float altitude; 10 | private float accuracy; 11 | private long timeStamp; 12 | 13 | public GPSData(float tD, float s, float lo, float la, float alt, long tS) { 14 | totalDistance = tD; 15 | speed = s; 16 | lon = lo; 17 | lat = la; 18 | altitude = alt; 19 | accuracy = 0; 20 | timeStamp = tS; 21 | } 22 | 23 | public float getTotalDistance() { return totalDistance; } 24 | 25 | public float getSpeed() { return speed; } 26 | 27 | public float getLon() { return lon; } 28 | 29 | public float getLat() { return lat; } 30 | 31 | public float getAltitude() { return altitude; } 32 | 33 | public float getAccuracy() { return accuracy; } 34 | 35 | public long getTimeStamp() { 36 | return timeStamp; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /app/src/main/res/values/arrays.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | No paired devices 5 | 6 | 7 | none 8 | 9 | 10 | No Updates 11 | Notification °F 12 | Clock Style °F 13 | Notification + Clock °F 14 | Notification °C 15 | Clock Style °C 16 | Notification + Clock °C 17 | 18 | 19 | none 20 | notification,imperial 21 | clock,imperial 22 | combo,imperial 23 | notification,metric 24 | clock,metric 25 | combo,metric 26 | 27 | 28 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Jared De La Cruz 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /app/src/main/java/com/solderbyte/openfit/util/OpenFitDataTypeAndString.java: -------------------------------------------------------------------------------- 1 | package com.solderbyte.openfit.util; 2 | 3 | public class OpenFitDataTypeAndString { 4 | String mData; 5 | OpenFitDataType mDataType; 6 | 7 | public OpenFitDataTypeAndString(OpenFitDataType pType, String s) { 8 | mDataType = pType; 9 | if(s != null) { 10 | mData = s; 11 | if(mDataType.equals(OpenFitDataType.SHORT) && mData.length() > 250) { 12 | mData = mData.substring(0, 250); 13 | return; 14 | } 15 | if(mDataType.equals(OpenFitDataType.BYTE) && mData.length() > 50) { 16 | mData = mData.substring(0, 50); 17 | return; 18 | } 19 | } 20 | } 21 | 22 | public String getData() { 23 | return mData; 24 | } 25 | 26 | public String getDataString() { 27 | return mDataType.STRING; 28 | } 29 | 30 | public OpenFitDataType getDataType() { 31 | return mDataType; 32 | } 33 | 34 | public int getDataIndex() { 35 | return mDataType.INTEGER; 36 | } 37 | 38 | public int getLength() { 39 | return mData.length(); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /app/src/main/java/com/solderbyte/openfit/HeartRateData.java: -------------------------------------------------------------------------------- 1 | package com.solderbyte.openfit; 2 | 3 | import android.os.Parcel; 4 | import android.os.Parcelable; 5 | 6 | public class HeartRateData implements Parcelable { 7 | 8 | private long timeStamp; 9 | private int heartRate; 10 | 11 | public HeartRateData(long t, int h) { 12 | timeStamp = t; 13 | heartRate = h; 14 | } 15 | 16 | public HeartRateData(Parcel source) { 17 | timeStamp = source.readLong(); 18 | heartRate = source.readInt(); 19 | } 20 | 21 | @Override 22 | public int describeContents() { 23 | return 0; 24 | } 25 | 26 | @Override 27 | public void writeToParcel(Parcel source, int flags) { 28 | source.writeLong(timeStamp); 29 | source.writeInt(heartRate); 30 | } 31 | 32 | public static final Creator CREATOR = new Creator() { 33 | public HeartRateData createFromParcel(Parcel source) { 34 | return new HeartRateData(source); 35 | } 36 | 37 | @Override 38 | public HeartRateData[] newArray(int size) { 39 | return new HeartRateData[size]; 40 | } 41 | }; 42 | 43 | public long getTimeStamp() { 44 | return timeStamp; 45 | } 46 | 47 | public int getHeartRate() { 48 | return heartRate; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /app/src/main/java/com/solderbyte/openfit/ui/DialogNotificationAccess.java: -------------------------------------------------------------------------------- 1 | package com.solderbyte.openfit.ui; 2 | 3 | import com.solderbyte.openfit.R; 4 | 5 | import android.app.AlertDialog; 6 | import android.app.Dialog; 7 | import android.app.DialogFragment; 8 | import android.content.DialogInterface; 9 | import android.content.Intent; 10 | import android.os.Bundle; 11 | 12 | public class DialogNotificationAccess extends DialogFragment { 13 | 14 | public DialogNotificationAccess() {} 15 | 16 | @Override 17 | public Dialog onCreateDialog(Bundle savedInstanceState) { 18 | AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); 19 | builder.setTitle(R.string.dialog_title_notification_access); 20 | builder.setMessage(R.string.dialog_message_notification_access); 21 | builder.setNegativeButton(R.string.dialog_close_notification_access, new DialogInterface.OnClickListener() { 22 | public void onClick(DialogInterface dialog, int index) {} 23 | }); 24 | builder.setPositiveButton(R.string.dialog_open_notification_access, new DialogInterface.OnClickListener() { 25 | public void onClick(DialogInterface dialog, int index) { 26 | startActivity(new Intent("android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS")); 27 | } 28 | }); 29 | 30 | return builder.create(); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fitness.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 16 | 17 | 21 | 22 | 27 | 28 | 33 | 34 | -------------------------------------------------------------------------------- /app/src/main/java/com/solderbyte/openfit/ui/ArrayAdapterWithIcon.java: -------------------------------------------------------------------------------- 1 | package com.solderbyte.openfit.ui; 2 | 3 | import java.util.List; 4 | 5 | import android.content.Context; 6 | import android.graphics.drawable.Drawable; 7 | import android.util.TypedValue; 8 | import android.view.View; 9 | import android.view.ViewGroup; 10 | import android.widget.ArrayAdapter; 11 | import android.widget.TextView; 12 | 13 | public class ArrayAdapterWithIcon extends ArrayAdapter { 14 | private List icons; 15 | 16 | public ArrayAdapterWithIcon(Context context, List items, List images) { 17 | super(context, android.R.layout.select_dialog_item, android.R.id.text1, items); 18 | this.icons = images; 19 | } 20 | 21 | @Override 22 | public View getView(int position, View convertView, ViewGroup parent) { 23 | View view = super.getView(position, convertView, parent); 24 | TextView textView = (TextView) view.findViewById(android.R.id.text1); 25 | //textView.setCompoundDrawablesWithIntrinsicBounds(icons.get(position), null, null, null); 26 | textView.setCompoundDrawables(icons.get(position), null, null, null); 27 | int margin = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 12, getContext().getResources().getDisplayMetrics()); 28 | textView.setCompoundDrawablePadding(margin); 29 | 30 | return view; 31 | } 32 | } -------------------------------------------------------------------------------- /app/src/main/java/com/solderbyte/openfit/SleepInfo.java: -------------------------------------------------------------------------------- 1 | package com.solderbyte.openfit; 2 | 3 | import android.os.Parcel; 4 | import android.os.Parcelable; 5 | 6 | public class SleepInfo implements Parcelable { 7 | 8 | private int index; 9 | private long timeStamp; 10 | private int status; 11 | 12 | public SleepInfo(int i, long t, int s) { 13 | index = i; 14 | timeStamp = t; 15 | status = s; 16 | } 17 | 18 | public SleepInfo(Parcel source) { 19 | index = source.readInt(); 20 | timeStamp = source.readLong(); 21 | status = source.readInt(); 22 | } 23 | 24 | @Override 25 | public int describeContents() { 26 | return 0; 27 | } 28 | 29 | @Override 30 | public void writeToParcel(Parcel source, int flags) { 31 | source.writeInt(index); 32 | source.writeLong(timeStamp); 33 | source.writeInt(status); 34 | } 35 | 36 | public static final Creator CREATOR = new Creator() { 37 | public SleepInfo createFromParcel(Parcel source) { 38 | return new SleepInfo(source); 39 | } 40 | 41 | @Override 42 | public SleepInfo[] newArray(int size) { 43 | return new SleepInfo[size]; 44 | } 45 | }; 46 | 47 | public long getTimeStamp() { 48 | return timeStamp; 49 | } 50 | 51 | public int getIndex() { 52 | return index; 53 | } 54 | 55 | public int getStatus() { 56 | return status; 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /app/src/main/java/com/solderbyte/openfit/PedometerTotal.java: -------------------------------------------------------------------------------- 1 | package com.solderbyte.openfit; 2 | 3 | import android.os.Parcel; 4 | import android.os.Parcelable; 5 | 6 | public class PedometerTotal implements Parcelable { 7 | 8 | private int steps; 9 | private float distance; 10 | private float calories; 11 | 12 | public PedometerTotal(int s, float d, float c) { 13 | steps = s; 14 | distance = d; 15 | calories = c; 16 | } 17 | 18 | public PedometerTotal(Parcel source) { 19 | steps = source.readInt(); 20 | distance = source.readFloat(); 21 | calories = source.readFloat(); 22 | } 23 | 24 | @Override 25 | public int describeContents() { 26 | return 0; 27 | } 28 | 29 | @Override 30 | public void writeToParcel(Parcel source, int flags) { 31 | source.writeInt(steps); 32 | source.writeFloat(distance); 33 | source.writeFloat(calories); 34 | } 35 | 36 | public static final Parcelable.Creator CREATOR = new Parcelable.Creator() { 37 | public PedometerTotal createFromParcel(Parcel source) { 38 | return new PedometerTotal(source); 39 | } 40 | 41 | @Override 42 | public PedometerTotal[] newArray(int size) { 43 | return new PedometerTotal[size]; 44 | } 45 | }; 46 | 47 | public int getSteps() { 48 | return steps; 49 | } 50 | 51 | public float getDistance() { 52 | return distance; 53 | } 54 | 55 | public float getCalories() { 56 | return calories; 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /app/src/main/java/com/solderbyte/openfit/ui/ArrayAdapterFitness.java: -------------------------------------------------------------------------------- 1 | package com.solderbyte.openfit.ui; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | import com.solderbyte.openfit.R; 7 | 8 | import android.content.Context; 9 | import android.graphics.Typeface; 10 | import android.graphics.drawable.Drawable; 11 | import android.view.View; 12 | import android.view.ViewGroup; 13 | import android.widget.ArrayAdapter; 14 | import android.widget.ImageView; 15 | import android.widget.TextView; 16 | 17 | public class ArrayAdapterFitness extends ArrayAdapter { 18 | 19 | private List items; 20 | private List subitems; 21 | private List icons; 22 | 23 | public ArrayAdapterFitness(Context context, List items, List subitems, ArrayList icons) { 24 | super(context, R.layout.fitness, R.id.text_1, items); 25 | this.items = items; 26 | this.subitems = subitems; 27 | this.icons = icons; 28 | } 29 | 30 | @Override 31 | public View getView(int position, View convertView, ViewGroup parent) { 32 | View view = super.getView(position, convertView, parent); 33 | 34 | TextView text1 = (TextView) view.findViewById(R.id.text_1); 35 | TextView text2 = (TextView) view.findViewById(R.id.text_2); 36 | ImageView icon = (ImageView) view.findViewById(R.id.icon); 37 | 38 | icon.setImageDrawable(icons.get(position)); 39 | text1.setText(items.get(position)); 40 | text1.setTypeface(null, Typeface.BOLD); 41 | text2.setText(subitems.get(position)); 42 | 43 | return view; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /app/src/main/java/com/solderbyte/openfit/Alarm.java: -------------------------------------------------------------------------------- 1 | package com.solderbyte.openfit; 2 | 3 | import android.content.Intent; 4 | import android.content.IntentFilter; 5 | 6 | public class Alarm { 7 | 8 | public static IntentFilter getIntentFilter() { 9 | IntentFilter alarm = new IntentFilter(); 10 | alarm.addAction("com.android.deskclock.ALARM_ALERT"); 11 | alarm.addAction("com.android.deskclock.ALARM_SNOOZE"); 12 | alarm.addAction("com.android.deskclock.ALARM_DISMISS"); 13 | alarm.addAction("com.android.deskclock.ALARM_DONE"); 14 | return alarm; 15 | } 16 | 17 | public static String getAction(Intent intent) { 18 | String action = intent.getAction(); 19 | 20 | if(action.equals("com.android.deskclock.ALARM_ALERT")) { 21 | action = "START"; 22 | } 23 | else if(action.equals("com.android.deskclock.ALARM_SNOOZE")) { 24 | action = "SNOOZE"; 25 | } 26 | else if(action.equals("com.android.deskclock.ALARM_DISMISS")) { 27 | action = "STOP"; 28 | } 29 | else if(action.equals("com.android.deskclock.ALARM_DONE")) { 30 | action = "STOP"; 31 | } 32 | else { 33 | action = "STOP"; 34 | } 35 | 36 | return action; 37 | } 38 | 39 | public static Intent snoozeAlarm() { 40 | Intent intent = new Intent(); 41 | intent.setAction("com.android.deskclock.ALARM_SNOOZE"); 42 | return intent; 43 | } 44 | 45 | public static Intent dismissAlarm() { 46 | Intent intent = new Intent(); 47 | intent.setAction("com.android.deskclock.ALARM_DISMISS"); 48 | return intent; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /app/src/main/java/com/solderbyte/openfit/ui/DialogNews.java: -------------------------------------------------------------------------------- 1 | package com.solderbyte.openfit.ui; 2 | 3 | import android.app.AlertDialog; 4 | import android.app.Dialog; 5 | import android.app.DialogFragment; 6 | import android.content.Context; 7 | import android.content.DialogInterface; 8 | import android.content.SharedPreferences; 9 | import android.os.Bundle; 10 | import android.view.LayoutInflater; 11 | import android.view.View; 12 | import android.widget.CheckBox; 13 | 14 | import com.solderbyte.openfit.R; 15 | 16 | public class DialogNews extends DialogFragment { 17 | public DialogNews() {} 18 | 19 | @Override 20 | public Dialog onCreateDialog(Bundle savedInstanceState) { 21 | AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); 22 | LayoutInflater adbInflater = LayoutInflater.from(getActivity()); 23 | View eulaLayout = adbInflater.inflate(R.layout.checkbox, null); 24 | final CheckBox dontShowAgain = (CheckBox)eulaLayout.findViewById(R.id.skip); 25 | builder.setView(eulaLayout); 26 | 27 | builder.setTitle(R.string.dialog_title_news); 28 | builder.setMessage(R.string.dialog_message_news); 29 | 30 | builder.setPositiveButton(R.string.dialog_close_news, new DialogInterface.OnClickListener() { 31 | public void onClick(DialogInterface dialog, int index) { 32 | // Store the answer in SharedPreferences 33 | SharedPreferences sharedPref = getActivity().getPreferences(Context.MODE_PRIVATE); 34 | SharedPreferences.Editor editor = sharedPref.edit(); 35 | editor.putBoolean( OpenFitActivity.OpenFitFragment.PREFERENCE_SKIP_CHANGELOG_KEY, 36 | dontShowAgain.isChecked()); 37 | editor.apply(); 38 | } 39 | }); 40 | 41 | return builder.create(); 42 | } 43 | } -------------------------------------------------------------------------------- /app/src/main/java/com/solderbyte/openfit/DialerListener.java: -------------------------------------------------------------------------------- 1 | package com.solderbyte.openfit; 2 | 3 | import com.solderbyte.openfit.util.OpenFitIntent; 4 | 5 | import android.content.Context; 6 | import android.content.Intent; 7 | import android.telephony.PhoneStateListener; 8 | import android.telephony.TelephonyManager; 9 | import android.util.Log; 10 | 11 | public class DialerListener extends PhoneStateListener { 12 | private static final String LOG_TAG = "TurquoiseBicuspid:DialerListener"; 13 | 14 | private Context context; 15 | 16 | public DialerListener(Context cntxt) { 17 | Log.d(LOG_TAG, "Dailer listening"); 18 | context = cntxt; 19 | } 20 | 21 | public void destroy() { 22 | context = null; 23 | } 24 | 25 | @Override 26 | public void onCallStateChanged(int state, String incomingNumber) { 27 | switch(state) { 28 | case TelephonyManager.CALL_STATE_IDLE: 29 | Log.d(LOG_TAG, "Phone: Idle - "+incomingNumber); 30 | Intent msgi = new Intent(OpenFitIntent.INTENT_SERVICE_PHONE_IDLE); 31 | msgi.putExtra("sender", incomingNumber); 32 | context.sendBroadcast(msgi); 33 | break; 34 | case TelephonyManager.CALL_STATE_OFFHOOK: 35 | Log.d(LOG_TAG, "Phone: Offhook - "+incomingNumber); 36 | Intent msgo = new Intent(OpenFitIntent.INTENT_SERVICE_PHONE_OFFHOOK); 37 | msgo.putExtra("sender", incomingNumber); 38 | context.sendBroadcast(msgo); 39 | break; 40 | case TelephonyManager.CALL_STATE_RINGING: 41 | Log.d(LOG_TAG, "Phone: Ringing - "+incomingNumber); 42 | Intent msg = new Intent(OpenFitIntent.INTENT_SERVICE_PHONE); 43 | msg.putExtra("sender", incomingNumber); 44 | context.sendBroadcast(msg); 45 | break; 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /app/src/main/java/com/solderbyte/openfit/ExerciseDatabase.java: -------------------------------------------------------------------------------- 1 | package com.solderbyte.openfit; 2 | 3 | import android.content.Context; 4 | import android.database.sqlite.SQLiteOpenHelper; 5 | import android.database.sqlite.SQLiteDatabase; 6 | 7 | public class ExerciseDatabase extends SQLiteOpenHelper { 8 | 9 | public static final int DATABASE_VERSION = 4; 10 | public static final String DATABASE_NAME = "exerciseInfo"; 11 | 12 | public static final String EXERCISE_TABLE = "exercise"; 13 | public static final String EXERCISE_COLS = "( id INTEGER PRIMARY KEY AUTOINCREMENT, timestampStart INTEGER, timestampEnd INTEGER, type INTEGER )"; 14 | public static final String DATA_TABLE = "gpsData"; 15 | public static final String DATA_COLS = "( id INTEGER PRIMARY KEY AUTOINCREMENT, exerciseId INTEGER, lon FLOAT, lat FLOAT, altitude FLOAT, totalDistance FLOAT, speed FLOAT, timestamp INTEGER, FOREIGN KEY (exerciseId) REFERENCES exercise(id) )"; 16 | public static final String PROFILE_TABLE = "profile"; 17 | public static final String PROFILE_COLS = "( id INTEGER, height FLOAT, weight FLOAT )"; 18 | 19 | public ExerciseDatabase(Context context) { 20 | super(context, DATABASE_NAME, null, DATABASE_VERSION); 21 | } 22 | 23 | public void onCreate(SQLiteDatabase db) { 24 | db.execSQL("CREATE TABLE " + EXERCISE_TABLE + " " + EXERCISE_COLS); 25 | db.execSQL("CREATE TABLE " + DATA_TABLE + " " + DATA_COLS); 26 | db.execSQL("CREATE TABLE " + PROFILE_TABLE + " " + PROFILE_COLS); 27 | db.execSQL("INSERT INTO " + PROFILE_TABLE + " (id, height, weight) values (1, 0, 0)"); 28 | } 29 | 30 | public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { 31 | db.execSQL("DROP TABLE IF EXISTS " + DATA_TABLE); 32 | db.execSQL("DROP TABLE IF EXISTS " + EXERCISE_TABLE); 33 | db.execSQL("DROP TABLE IF EXISTS " + PROFILE_TABLE); 34 | onCreate(db); 35 | } 36 | } 37 | 38 | -------------------------------------------------------------------------------- /app/src/main/java/com/solderbyte/openfit/SleepData.java: -------------------------------------------------------------------------------- 1 | package com.solderbyte.openfit; 2 | 3 | import android.os.Parcel; 4 | import android.os.Parcelable; 5 | 6 | public class SleepData implements Parcelable { 7 | 8 | private long startTimeStamp; 9 | private long endTimeStamp; 10 | private float efficiency; 11 | private int index; 12 | private int len; 13 | 14 | public SleepData(long st, long et, float e, int i, int l) { 15 | startTimeStamp = st; 16 | endTimeStamp = et; 17 | efficiency = e; 18 | index = i; 19 | len = l; 20 | } 21 | 22 | public SleepData(Parcel source) { 23 | startTimeStamp = source.readLong(); 24 | endTimeStamp = source.readLong(); 25 | efficiency = source.readFloat(); 26 | index = source.readInt(); 27 | len = source.readInt(); 28 | } 29 | 30 | @Override 31 | public int describeContents() { 32 | return 0; 33 | } 34 | 35 | @Override 36 | public void writeToParcel(Parcel source, int flags) { 37 | source.writeLong(startTimeStamp); 38 | source.writeLong(endTimeStamp); 39 | source.writeFloat(efficiency); 40 | source.writeInt(index); 41 | source.writeInt(len); 42 | } 43 | 44 | public static final Creator CREATOR = new Creator() { 45 | public SleepData createFromParcel(Parcel source) { 46 | return new SleepData(source); 47 | } 48 | 49 | @Override 50 | public SleepData[] newArray(int size) { 51 | return new SleepData[size]; 52 | } 53 | }; 54 | 55 | public long getStartTimeStamp() { 56 | return startTimeStamp; 57 | } 58 | 59 | public long getEndTimeStamp() { 60 | return endTimeStamp; 61 | } 62 | 63 | public float getEfficiency() { return efficiency; } 64 | 65 | public int getIndex() { 66 | return index; 67 | } 68 | 69 | public int getLen() { 70 | return len; 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /import-summary.txt: -------------------------------------------------------------------------------- 1 | ECLIPSE ANDROID PROJECT IMPORT SUMMARY 2 | ====================================== 3 | 4 | Ignored Files: 5 | -------------- 6 | The following files were *not* copied into the new Gradle project; you 7 | should evaluate whether these are still needed in your project and if 8 | so manually move them: 9 | 10 | * .gitignore 11 | * LICENSE 12 | * README.md 13 | * open_fit-web.png 14 | * proguard-project.txt 15 | 16 | Replaced Jars with Dependencies: 17 | -------------------------------- 18 | The importer recognized the following .jar files as third party 19 | libraries and replaced them with Gradle dependencies instead. This has 20 | the advantage that more explicit version information is known, and the 21 | libraries can be updated automatically. However, it is possible that 22 | the .jar file in your project was of an older version than the 23 | dependency we picked, which could render the project not compileable. 24 | You can disable the jar replacement in the import wizard and try again: 25 | 26 | android-support-v4.jar => com.android.support:support-v4:21.0.3 27 | 28 | Moved Files: 29 | ------------ 30 | Android Gradle projects use a different directory structure than ADT 31 | Eclipse projects. Here's how the projects were restructured: 32 | 33 | * AndroidManifest.xml => app/src/main/AndroidManifest.xml 34 | * res/ => app/src/main/res/ 35 | * src/ => app/src/main/java/ 36 | 37 | Next Steps: 38 | ----------- 39 | You can now build the project. The Gradle project needs network 40 | connectivity to download dependencies. 41 | 42 | Bugs: 43 | ----- 44 | If for some reason your project does not build, and you determine that 45 | it is due to a bug or limitation of the Eclipse to Gradle importer, 46 | please file a bug at http://b.android.com with category 47 | Component-Tools. 48 | 49 | (This import summary is for your information only, and can be deleted 50 | after import once you are satisfied with the results.) 51 | 52 | 53 | adb install ~/Documents/OpenFit/app-release.apk 54 | 55 | PR 56 | GoogleFit.java 57 | Fitness.java 58 | OpenFitService.java 59 | DialogFitness.java 60 | OpenFitActivity.java 61 | OpenFitIntent.java -------------------------------------------------------------------------------- /app/src/main/java/com/solderbyte/openfit/SmsListener.java: -------------------------------------------------------------------------------- 1 | package com.solderbyte.openfit; 2 | 3 | import com.solderbyte.openfit.util.OpenFitIntent; 4 | 5 | import android.content.BroadcastReceiver; 6 | import android.content.Context; 7 | import android.content.Intent; 8 | import android.os.Bundle; 9 | //import android.telephony.SmsManager; 10 | import android.telephony.SmsMessage; 11 | import android.util.Log; 12 | 13 | public class SmsListener extends BroadcastReceiver { 14 | private static final String LOG_TAG = "TurquoiseBicuspid:SmsListener"; 15 | 16 | //private static final SmsManager sms = SmsManager.getDefault(); 17 | private Context context; 18 | 19 | public SmsListener(Context cntxt) { 20 | Log.d(LOG_TAG, "SMS listening"); 21 | context = cntxt; 22 | } 23 | 24 | public void destroy() { 25 | context = null; 26 | } 27 | 28 | @Override 29 | public void onReceive(Context cntxt, Intent intent) { 30 | Log.d(LOG_TAG, "SMS: Intent received"); 31 | Bundle bundle = intent.getExtras(); 32 | if(bundle != null) { 33 | try { 34 | Object[] pdus = (Object[]) bundle.get("pdus"); 35 | 36 | for(int i=0; i 0 && (index - 15) > 0) { 34 | int newIndx = index - 15; 35 | phoneNumber = phoneNumber.substring(newIndx, index); 36 | index = phoneNumber.indexOf("+"); 37 | if(index > 0) { 38 | phoneNumber = phoneNumber.substring(index); 39 | String senderNum = phoneNumber; 40 | Log.d(LOG_TAG, "MMS: "+senderNum); 41 | Intent msg = new Intent(OpenFitIntent.INTENT_SERVICE_MMS); 42 | msg.putExtra("sender", senderNum); 43 | context.sendBroadcast(msg); 44 | } 45 | } 46 | } 47 | } 48 | } 49 | catch(Exception e) { 50 | Log.e(LOG_TAG, "Error: intent.getType()", e); 51 | } 52 | } 53 | } 54 | 55 | } -------------------------------------------------------------------------------- /app/src/main/java/com/solderbyte/openfit/PedometerData.java: -------------------------------------------------------------------------------- 1 | package com.solderbyte.openfit; 2 | 3 | import android.os.Parcel; 4 | import android.os.Parcelable; 5 | 6 | import java.util.Calendar; 7 | import java.util.Date; 8 | 9 | public class PedometerData implements Parcelable { 10 | 11 | private long timeStamp; 12 | private int steps; 13 | private float distance; 14 | private float calories; 15 | private long timeStampEnd; 16 | 17 | public PedometerData(long t, int s, float d, float c) { 18 | timeStamp = t; 19 | steps = s; 20 | distance = d; 21 | calories = c; 22 | Calendar cal = Calendar.getInstance(); 23 | Date startDate = new Date(timeStamp); 24 | cal.setTime(startDate); 25 | cal.add(Calendar.MINUTE, 10); 26 | Date endDate = cal.getTime(); 27 | timeStampEnd = endDate.getTime(); 28 | } 29 | 30 | public PedometerData(Parcel source) { 31 | timeStamp = source.readLong(); 32 | steps = source.readInt(); 33 | distance = source.readFloat(); 34 | calories = source.readFloat(); 35 | timeStampEnd = source.readLong(); 36 | } 37 | 38 | @Override 39 | public int describeContents() { 40 | return 0; 41 | } 42 | 43 | @Override 44 | public void writeToParcel(Parcel source, int flags) { 45 | source.writeLong(timeStamp); 46 | source.writeInt(steps); 47 | source.writeFloat(distance); 48 | source.writeFloat(calories); 49 | source.writeLong(timeStampEnd); 50 | } 51 | 52 | public static final Parcelable.Creator CREATOR = new Parcelable.Creator() { 53 | public PedometerData createFromParcel(Parcel source) { 54 | return new PedometerData(source); 55 | } 56 | 57 | @Override 58 | public PedometerData[] newArray(int size) { 59 | return new PedometerData[size]; 60 | } 61 | }; 62 | 63 | public void setTimeStampEnd(long ms) { 64 | timeStampEnd = ms; 65 | } 66 | 67 | public long getTimeStamp() { 68 | return timeStamp; 69 | } 70 | 71 | public long getTimeStampEnd() { 72 | return timeStampEnd; 73 | } 74 | 75 | public int getSteps() { 76 | return steps; 77 | } 78 | 79 | public float getDistance() { 80 | return distance; 81 | } 82 | 83 | public float getCalories() { 84 | return calories; 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /app/src/main/java/com/solderbyte/openfit/util/OpenFitDataType.java: -------------------------------------------------------------------------------- 1 | package com.solderbyte.openfit.util; 2 | 3 | public final class OpenFitDataType { 4 | 5 | public static final OpenFitDataType BIT; 6 | public static final OpenFitDataType BYTE; 7 | public static final OpenFitDataType DOUBLE; 8 | public static final OpenFitDataType ENUM$VALUES[]; 9 | public static final OpenFitDataType FLOAT; 10 | public static final OpenFitDataType INT; 11 | public static final OpenFitDataType LONG; 12 | public static final OpenFitDataType SHORT; 13 | public String STRING; 14 | public int INTEGER; 15 | 16 | private OpenFitDataType(String s, int i) { 17 | STRING = s; 18 | INTEGER = i; 19 | } 20 | 21 | public static OpenFitDataType valueOf(String s) { 22 | OpenFitDataType o = null; 23 | if(s.equals("BYTE")) { 24 | o = new OpenFitDataType("BYTE", 0); 25 | } 26 | else if(s.equals("SHORT")) { 27 | o = new OpenFitDataType("SHORT", 1); 28 | } 29 | else if(s.equals("INT")) { 30 | o = new OpenFitDataType("INT", 2); 31 | } 32 | else if(s.equals("LONG")) { 33 | o = new OpenFitDataType("LONG", 3); 34 | } 35 | else if(s.equals("FLOAT")) { 36 | o = new OpenFitDataType("FLOAT", 4); 37 | } 38 | else if(s.equals("DOUBLE")) { 39 | o = new OpenFitDataType("DOUBLE", 5); 40 | } 41 | else if(s.equals("BIT")) { 42 | o = new OpenFitDataType("BIT", 6); 43 | } 44 | return o; 45 | } 46 | 47 | public static OpenFitDataType[] values() { 48 | OpenFitDataType oType[] = ENUM$VALUES; 49 | int i = oType.length; 50 | OpenFitDataType fType[] = new OpenFitDataType[i]; 51 | System.arraycopy(oType, 0, fType, 0, i); 52 | return fType; 53 | } 54 | 55 | static { 56 | BYTE = new OpenFitDataType("BYTE", 0); 57 | SHORT = new OpenFitDataType("SHORT", 1); 58 | INT = new OpenFitDataType("INT", 2); 59 | LONG = new OpenFitDataType("LONG", 3); 60 | FLOAT = new OpenFitDataType("FLOAT", 4); 61 | DOUBLE = new OpenFitDataType("DOUBLE", 5); 62 | BIT = new OpenFitDataType("BIT", 6); 63 | OpenFitDataType oType[] = new OpenFitDataType[7]; 64 | oType[0] = BYTE; 65 | oType[1] = SHORT; 66 | oType[2] = INT; 67 | oType[3] = LONG; 68 | oType[4] = FLOAT; 69 | oType[5] = DOUBLE; 70 | oType[6] = BIT; 71 | ENUM$VALUES = oType; 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /app/src/main/java/com/solderbyte/openfit/ProfileData.java: -------------------------------------------------------------------------------- 1 | package com.solderbyte.openfit; 2 | 3 | import android.os.Parcel; 4 | import android.os.Parcelable; 5 | 6 | public class ProfileData implements Parcelable { 7 | 8 | private long timeStamp; 9 | private int age; 10 | private float height; 11 | private float weight; 12 | private int gender; 13 | private int birthday; 14 | private int heightUnit; 15 | private int weightUnit; 16 | private int distanceUnit; 17 | private int activity; 18 | 19 | public ProfileData(long t, int a, float h, float w, int g, int b, int hu, int wu, int du, int ac) { 20 | timeStamp = t; 21 | age = a; 22 | height = h; 23 | weight = w; 24 | gender = g; 25 | birthday = b; 26 | heightUnit = hu; 27 | weightUnit = wu; 28 | distanceUnit = du; 29 | activity = ac; 30 | } 31 | 32 | public ProfileData(Parcel source) { 33 | timeStamp = source.readLong(); 34 | age = source.readInt(); 35 | height = source.readFloat(); 36 | weight = source.readFloat(); 37 | gender = source.readInt(); 38 | birthday = source.readInt(); 39 | heightUnit = source.readInt(); 40 | weightUnit = source.readInt(); 41 | distanceUnit = source.readInt(); 42 | activity = source.readInt(); 43 | } 44 | 45 | @Override 46 | public int describeContents() { 47 | return 0; 48 | } 49 | 50 | @Override 51 | public void writeToParcel(Parcel source, int flags) { 52 | source.writeLong(timeStamp); 53 | source.writeInt(age); 54 | source.writeFloat(height); 55 | source.writeFloat(weight); 56 | source.writeInt(gender); 57 | source.writeInt(birthday); 58 | source.writeInt(heightUnit); 59 | source.writeInt(weightUnit); 60 | source.writeInt(distanceUnit); 61 | source.writeInt(activity); 62 | } 63 | 64 | public static final Parcelable.Creator CREATOR = new Parcelable.Creator() { 65 | public ProfileData createFromParcel(Parcel source) { 66 | return new ProfileData(source); 67 | } 68 | 69 | @Override 70 | public ProfileData[] newArray(int size) { 71 | return new ProfileData[size]; 72 | } 73 | }; 74 | 75 | public long getTimeStamp() { 76 | return timeStamp; 77 | } 78 | 79 | public int getAge() { 80 | return age; 81 | } 82 | 83 | public float getHeight() { 84 | return height; 85 | } 86 | 87 | public float getWeight() { 88 | return weight; 89 | } 90 | 91 | public int getGender() { 92 | return gender; 93 | } 94 | 95 | public int getBirthday() { 96 | return birthday; 97 | } 98 | 99 | public int getHeightUnit() { 100 | return heightUnit; 101 | } 102 | 103 | public int getWeightUnit() { 104 | return weightUnit; 105 | } 106 | 107 | public int getDistanceUnit() { 108 | return distanceUnit; 109 | } 110 | 111 | public int getActivity() { 112 | return activity; 113 | } 114 | } 115 | -------------------------------------------------------------------------------- /app/src/main/java/com/solderbyte/openfit/ui/DialogRejectMessages.java: -------------------------------------------------------------------------------- 1 | package com.solderbyte.openfit.ui; 2 | 3 | import android.app.AlertDialog; 4 | import android.app.Dialog; 5 | import android.app.DialogFragment; 6 | import android.content.DialogInterface; 7 | import android.content.Intent; 8 | import android.os.Bundle; 9 | import android.support.v4.content.LocalBroadcastManager; 10 | import android.util.Log; 11 | import android.view.LayoutInflater; 12 | import android.view.View; 13 | import android.view.ViewGroup; 14 | import android.widget.EditText; 15 | import android.widget.LinearLayout; 16 | import android.widget.ScrollView; 17 | 18 | import com.solderbyte.openfit.R; 19 | 20 | import java.util.ArrayList; 21 | 22 | public class DialogRejectMessages extends DialogFragment { 23 | private static final String LOG_TAG = "OpenFit:DialogRejectMessages"; 24 | private static final String INTENT_UI_REJECTMESSAGES = "com.solderbyte.openfit.ui.rejectmessages"; 25 | 26 | private ArrayList savedMessages; 27 | 28 | public DialogRejectMessages() {} 29 | 30 | public DialogRejectMessages(ArrayList sm) { 31 | savedMessages = sm; 32 | } 33 | 34 | @Override 35 | public Dialog onCreateDialog(Bundle savedInstanceState) { 36 | LayoutInflater factory = LayoutInflater.from(getActivity()); 37 | final View textEntryView = factory.inflate(R.layout.reject_messages, null); 38 | AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); 39 | builder.setTitle(R.string.dialog_edit_rejectcall_messages); 40 | builder.setView(textEntryView); 41 | final ArrayList editList = new ArrayList(); 42 | ViewGroup parentView = (ViewGroup) textEntryView; 43 | for(int i = 0; i < parentView.getChildCount(); ++i) { 44 | if(parentView.getChildAt(i) instanceof ScrollView) { 45 | ViewGroup parentViewScroll = (ViewGroup) parentView.getChildAt(i); 46 | for(int j = 0; j < parentViewScroll.getChildCount(); ++j) { 47 | ViewGroup parentViewLayout = (ViewGroup) parentViewScroll.getChildAt(j); 48 | for(int k = 0; k < parentViewLayout.getChildCount(); ++k) { 49 | if(parentViewLayout.getChildAt(k) instanceof EditText) { 50 | editList.add((EditText) parentViewLayout.getChildAt(k)); 51 | } 52 | } 53 | } 54 | } 55 | } 56 | for(int i = 0; i < this.savedMessages.size(); ++i) { 57 | editList.get(i).setText(this.savedMessages.get(i)); 58 | } 59 | builder.setPositiveButton(R.string.dialog_save_rejectcall_messages, new DialogInterface.OnClickListener() { 60 | public void onClick(DialogInterface dialog, int index) { 61 | ArrayList messages = new ArrayList(); 62 | for(int i = 0; i < editList.size(); ++i) { 63 | String strField = editList.get(i).getText().toString().trim(); 64 | if(strField.equals("")) { 65 | continue; 66 | } 67 | messages.add(strField); 68 | } 69 | Intent msg = new Intent(INTENT_UI_REJECTMESSAGES); 70 | msg.putExtra("rejectMessages", messages); 71 | LocalBroadcastManager.getInstance(getActivity()).sendBroadcast(msg); 72 | } 73 | }); 74 | builder.setNegativeButton(R.string.dialog_close_rejectcall_messages, new DialogInterface.OnClickListener() { 75 | public void onClick(DialogInterface dialog, int index) { 76 | } 77 | }); 78 | 79 | return builder.create(); 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /app/src/main/res/values-zh-rCN/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Open Fit 4 | Open Fit 5 | 增加通知程式 6 | 移除通知程式 7 | 帮助 8 | 增加通知程式 9 | 移除通知程式 10 | Open Fit 帮助 11 | 关闭 12 | 健康 13 | 关闭 14 | Open Fit 最新消息 15 | 关闭 16 | 连接情况 17 | 启用蓝牙 18 | 寻找装置 19 | 寻找蓝牙装置 20 | 寻找 Gear Fit 21 | 寻找你的装置中…请稍候 22 | 显示所有装置 23 | 选择你的 Gear Fit 24 | 选择 Gear Fit 25 | 连接 26 | 已连接 27 | 未连接 28 | 29 | 装置 30 | SMS 短讯 31 | 电话通话 32 | 时钟格式 33 | 24 小时制 34 | 12 小时制 35 | 天气更新 36 | 选择天气 37 | 选择项目 38 | 不更新 39 | 健康 40 | 健康记录 41 | 取得健康记录 42 | 通知程式列表 43 | 捐款 44 | 透过 PayPal 捐款 45 | 暂没有加入任何应用程式, 在顶部菜单中按 + 按纽加入应用程式, 请确定已授权 Open Fit 的 "通知存取权", 否则通知功能将不能运作 46 | 启动中… 47 | 扫描中… 48 | 扫描已完成, 请选择装置 49 | 正在尝试连接至: 50 | 正在取得健康记录… 51 | 蓝牙已开启 52 | 蓝牙开启失败 53 | Gear Fit 已连接 54 | Gear Fit 未连接 55 | Gear Fit 连接失败 56 | Gear Fit 连接失败 57 | Open Fit 58 | 连接至 Gear Fit 59 | 断开 Gear Fit 的连接 60 | 连接 61 | 断开连接 62 | 关闭 63 | 64 | -------------------------------------------------------------------------------- /app/src/main/res/values-zh-rTW/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Open Fit 4 | Open Fit 5 | 增加通知程式 6 | 移除通知程式 7 | 幫助 8 | 增加通知程式 9 | 移除通知程式 10 | Open Fit 幫助 11 | 關閉 12 | 健康 13 | 關閉 14 | Open Fit 最新消息 15 | 關閉 16 | 連接情況 17 | 啟用藍牙 18 | 尋找裝置 19 | 尋找藍牙裝置 20 | 尋找 Gear Fit 21 | 尋找你的裝置中…請稍候 22 | 顯示所有裝置 23 | 選擇你的 Gear Fit 24 | 選擇 Gear Fit 25 | 連接 26 | 已連接 27 | 未連接 28 | 29 | 裝置 30 | SMS 簡訊 31 | 電話通話 32 | 時鐘格式 33 | 24 小時制 34 | 12 小時制 35 | 天氣更新 36 | 選擇天氣 37 | 選擇項目 38 | 不更新 39 | 健康 40 | 健康記錄 41 | 取得健康記錄 42 | 通知程式列表 43 | 捐款 44 | 透過 PayPal 捐款 45 | 暫沒有加入任何應用程式, 在頂部目錄中按 + 按鈕加入應用程式, 請確定已授權 Open Fit 的 "通知存取權", 否則通知功能將不能運作 46 | 啟動中… 47 | 掃描中… 48 | 掃描已完成, 請選擇裝置 49 | 正在嘗試連接至: 50 | 正在取得健康記錄… 51 | 藍牙已開啟 52 | 藍牙開啟失敗 53 | Gear Fit 已連接 54 | Gear Fit 未連接 55 | Gear Fit 連接失敗 56 | Gear Fit 連接失敗 57 | Open Fit 58 | 連接至 Gear Fit 59 | 斷開 Gear Fit 的連接 60 | 連接 61 | 斷開連接 62 | 關閉 63 | 64 | -------------------------------------------------------------------------------- /app/src/main/res/values-ko/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Open Fit 4 | Open Fit 5 | 애플리케이션 추가 6 | 애플리케이션 삭제 7 | 도움말 8 | 애플리케이션 추가 9 | 애플리케이션 삭제 10 | Open Fit 도움말 11 | 닫기 12 | 피트니스 13 | 닫기 14 | Open Fit 소식 15 | 닫기 16 | 연결 17 | 블루투스 켜기 18 | 검색 19 | 블루투스 검색 20 | Gear Fit 검색 21 | 검색 중입니다…잠시만 기다려 주세요. 22 | 장치 보기 23 | Gear Fit 선택 24 | Gear Fit 선택 25 | 연결 26 | 연결됨 27 | 연결 해제됨 28 | 없음 29 | 장치 30 | 문자 메시지 31 | 전화 32 | 시간 형식 33 | 24시 34 | 12시 35 | 날씨 업데이트 36 | 날씨 선택 37 | 설정 38 | 업데이트 안함 39 | 피트니스 40 | 피트니스 41 | 피트니스 데이터 요청 42 | 애플리케이션 43 | 기부 44 | PayPal을 통해 기부해주세요. 45 | 애플리케이션이 추가되지 않았습니다. 윗 줄의 + 버튼을 눌러 추가해 주세요. 또한 Open Fit 애플리케이션의 알림 액세스를 키셨는지 확인해주세요, 알림액세스를 키지 않으면 Gear Fit에 알림이 오지 않습니다. 46 | 블루투스 켜는 중… 47 | 검색 중… 48 | 검색 완료. 장치를 선택해 주세요 49 | 연결 시도 중: 50 | 피트니스 데이터 요청 중… 51 | 블루투스 켜짐 52 | 블루투스 꺼짐 53 | Gear Fit 연결 됨 54 | Gear Fit 연결 해제됨 55 | Gear Fit 연결 실패 56 | Gear Fit 연결 실패 57 | Open Fit 58 | Gear Fit에 연결 됨 59 | Gear Fit 연결 해제 됨 60 | 연결 61 | 연결 해제 62 | 앱 종료 63 | 64 | -------------------------------------------------------------------------------- /app/src/main/java/com/solderbyte/openfit/HttpClient.java: -------------------------------------------------------------------------------- 1 | package com.solderbyte.openfit; 2 | 3 | import java.io.BufferedInputStream; 4 | import java.io.BufferedReader; 5 | import java.io.InputStream; 6 | import java.io.InputStreamReader; 7 | import java.net.HttpURLConnection; 8 | import java.net.MalformedURLException; 9 | import java.net.URL; 10 | 11 | import org.json.JSONException; 12 | import org.json.JSONObject; 13 | 14 | import android.content.Context; 15 | import android.net.ConnectivityManager; 16 | import android.net.NetworkInfo; 17 | import android.os.AsyncTask; 18 | import android.util.Log; 19 | 20 | public class HttpClient { 21 | private static final String LOG_TAG = "OpenFit:Http"; 22 | 23 | boolean isConnected = false; 24 | private URL url = null; 25 | private HttpURLConnection urlConnection = null; 26 | 27 | public HttpClient(Context context) { 28 | ConnectivityManager conManager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE); 29 | NetworkInfo networkInfo = conManager.getActiveNetworkInfo(); 30 | if(networkInfo != null && networkInfo.isConnected()) { 31 | Log.d(LOG_TAG, "Network connection available"); 32 | isConnected = true; 33 | } 34 | else { 35 | isConnected = false; 36 | Log.d(LOG_TAG, "Network connection Not available"); 37 | } 38 | } 39 | 40 | public String get(String u, AsyncResponse asyncResponse) { 41 | if(isConnected) { 42 | try { 43 | url = new URL(u); 44 | new getTask(asyncResponse).execute("tempURL"); 45 | } 46 | catch(MalformedURLException e) { 47 | e.printStackTrace(); 48 | } 49 | return u; 50 | } 51 | else { 52 | return null; 53 | } 54 | } 55 | 56 | public interface AsyncResponse { 57 | void callback(JSONObject response); 58 | } 59 | 60 | public class getTask extends AsyncTask { 61 | public AsyncResponse delegate = null; 62 | 63 | public getTask(AsyncResponse asyncResponse) { 64 | delegate = asyncResponse; 65 | } 66 | 67 | @Override 68 | protected String doInBackground(String... args) { 69 | StringBuilder result = new StringBuilder(); 70 | 71 | try { 72 | urlConnection = (HttpURLConnection) url.openConnection(); 73 | urlConnection.setRequestMethod("GET"); 74 | urlConnection.setUseCaches(false); 75 | urlConnection.setAllowUserInteraction(false); 76 | urlConnection.setConnectTimeout(5000); 77 | urlConnection.setReadTimeout(5000); 78 | urlConnection.connect(); 79 | int status = urlConnection.getResponseCode(); 80 | Log.d(LOG_TAG, "Http response is: " + status); 81 | InputStream inStream = new BufferedInputStream(urlConnection.getInputStream()); 82 | 83 | BufferedReader buffer = new BufferedReader(new InputStreamReader(inStream)); 84 | 85 | String data; 86 | while((data = buffer.readLine()) != null) { 87 | result.append(data); 88 | } 89 | } 90 | catch(Exception e) { 91 | e.printStackTrace(); 92 | } 93 | finally { 94 | urlConnection.disconnect(); 95 | } 96 | 97 | return result.toString(); 98 | } 99 | 100 | @Override 101 | protected void onPostExecute(String res) { 102 | JSONObject response = null; 103 | try { 104 | response = new JSONObject(res.toString()); 105 | } 106 | catch (JSONException e) { 107 | Log.e(LOG_TAG, "JSON Parse error" + e); 108 | e.printStackTrace(); 109 | } 110 | delegate.callback(response); 111 | } 112 | 113 | } 114 | } 115 | -------------------------------------------------------------------------------- /app/src/main/java/com/solderbyte/openfit/util/OpenFitTimeZoneUtil.java: -------------------------------------------------------------------------------- 1 | package com.solderbyte.openfit.util; 2 | 3 | import android.util.Log; 4 | import java.lang.reflect.Field; 5 | import java.util.TimeZone; 6 | 7 | public class OpenFitTimeZoneUtil { 8 | private static final String LOG_TAG = "OpenFit:OpenFitTimeZoneUtil"; 9 | 10 | private static int[] getTransitions(TimeZone pTimeZone) { 11 | if(!pTimeZone.useDaylightTime()) { 12 | return null; 13 | } 14 | try { 15 | Field oField = pTimeZone.getClass().getDeclaredField("mTransitions"); 16 | oField.setAccessible(true); 17 | int[] paramTimeZone = (int[]) oField.get(pTimeZone); 18 | return paramTimeZone; 19 | } 20 | catch(NoSuchFieldException eTimeZone) { 21 | Log.w(LOG_TAG, eTimeZone.getMessage(), eTimeZone); 22 | return null; 23 | } 24 | catch(IllegalArgumentException eTimeZone) { 25 | Log.w(LOG_TAG, eTimeZone.getMessage(), eTimeZone); 26 | return null; 27 | } 28 | catch(IllegalAccessException eTimeZone) { 29 | Log.w(LOG_TAG, eTimeZone.getMessage(), eTimeZone); 30 | return null; 31 | } 32 | catch(ClassCastException eTimeZone) { 33 | if(eTimeZone.getMessage().contains("long[] cannot be cast to int[]")) { 34 | try { 35 | Field oField = pTimeZone.getClass().getDeclaredField("mTransitions"); 36 | oField.setAccessible(true); 37 | long[] paramTimeZone = (long[]) oField.get(pTimeZone); 38 | int [] transitions = new int[paramTimeZone.length]; 39 | for(int i = 0; i < paramTimeZone.length; i++) { 40 | transitions[i] = (int) paramTimeZone[i]; 41 | } 42 | return transitions; 43 | } 44 | catch(NoSuchFieldException eTZone) { 45 | Log.w(LOG_TAG, eTZone.getMessage(), eTZone); 46 | return null; 47 | } 48 | catch(IllegalArgumentException eTZone) { 49 | Log.w(LOG_TAG, eTimeZone.getMessage(), eTimeZone); 50 | return null; 51 | } 52 | catch(IllegalAccessException eTZone) { 53 | Log.w(LOG_TAG, eTimeZone.getMessage(), eTimeZone); 54 | return null; 55 | } 56 | } 57 | else { 58 | Log.w(LOG_TAG, eTimeZone.getMessage(), eTimeZone); 59 | return null; 60 | } 61 | } 62 | } 63 | 64 | public static long nextTransition(String pString, long nLong) { 65 | return nextTransition(TimeZone.getTimeZone(pString), nLong); 66 | } 67 | 68 | public static long nextTransition(TimeZone pTimeZone, long nLong) { 69 | int[] oTimeZone = getTransitions(pTimeZone); 70 | if(oTimeZone != null) { 71 | int i = (int)(nLong / 1000L); 72 | int j = oTimeZone.length; 73 | int k = 0; 74 | while(k < j) { 75 | if(i < oTimeZone[k]) { 76 | return 1000L * (long)oTimeZone[k]; 77 | } 78 | k++; 79 | } 80 | } 81 | return nLong; 82 | } 83 | 84 | public static long prevTransition(String pString, long pLong) { 85 | return prevTransition(TimeZone.getTimeZone(pString), pLong); 86 | } 87 | 88 | public static long prevTransition(TimeZone pTimeZone, long pLong) { 89 | int[] oTimeZone = getTransitions(pTimeZone); 90 | if(oTimeZone != null) { 91 | int i = (int)(pLong / 1000L); 92 | int j = oTimeZone.length; 93 | int k = 0; 94 | while(k < j) { 95 | if(i < oTimeZone[k]) { 96 | if(k == 0) { 97 | return 0L; 98 | } 99 | else { 100 | return 1000L * (long)oTimeZone[k - 1]; 101 | } 102 | } 103 | k++; 104 | } 105 | } 106 | return pLong; 107 | } 108 | } 109 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 38 | 44 | 45 | 46 | 47 | 48 | 49 | 52 | 53 | 57 | 58 | 62 | 63 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | -------------------------------------------------------------------------------- /app/src/main/res/values-af/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Open Fit 4 | Open Fit 5 | Add Application 6 | Del Application 7 | Help 8 | Add Application 9 | Del Application 10 | Open Fit Help 11 | Close 12 | Fitness 13 | Close 14 | Open Fit News 15 | Close 16 | Connectivity 17 | Enable Bluetooth 18 | Scan 19 | Scan Bluetooth 20 | Scan for Gear Fit 21 | Scanning…please wait 22 | Show Devices 23 | Select Gear Fit 24 | Select Gear Fit 25 | Connect 26 | Connected 27 | Disconnected 28 | None 29 | Device 30 | Text Messages 31 | Phone Calls 32 | Clock Format 33 | 24-hour Clock 34 | 12-hour Clock 35 | Weather Updates 36 | Select Weather 37 | Select Option 38 | No Updates 39 | Fitness 40 | Fitness 41 | Request Fitness Data 42 | Applications 43 | Donate 44 | Make a donation via PayPal 45 | No applications added. Click the + icon at the top menu to add an application. Make sure Notification Access is Enabled, otherwise notifcations will not work. 46 | Enabling… 47 | Scanning… 48 | Scanning complete. Please select device 49 | Attempting to connect to: 50 | Requesting fitness data… 51 | Bluetooth enabled 52 | Bluetooth failed 53 | Gear Fit connected 54 | Gear Fit disconnected 55 | Gear Fit connect failed 56 | Gear Fit connect failed 57 | Open Fit 58 | Connected to Gear Fit 59 | Disconnected from Gear Fit 60 | Connect 61 | Disconnect 62 | Shut Down 63 | 64 | -------------------------------------------------------------------------------- /app/src/main/res/layout/reject_messages.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 16 | 17 | 21 | 22 | 26 | 37 | 48 | 59 | 70 | 81 | 92 | 93 | 94 | 95 | 96 | -------------------------------------------------------------------------------- /app/src/main/res/values-th/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Open Fit 4 | Open Fit 5 | เพิ่ม แอปพลิเคชัน 6 | ลบ แอปพลิเคชัน 7 | ความช่วยเหลือ 8 | เพิ่ม แอปพลิเคชัน 9 | ลบ แอปพลิเคชัน 10 | ความช่วยเหลือใน Open Fit 11 | ปิด 12 | ฟิตเนส 13 | ปิด 14 | ข่าวสาร Open Fit 15 | ปิด 16 | ภาวะเชื่อมต่อ 17 | เปิดบลูทูธ 18 | ค้นหา 19 | ค้นหาบลูทูธ 20 | ค้นหา Gear Fit 21 | กำลังค้นหา…กรุณารอสักครู่ 22 | แสดงอุปกรณ์บลูทูธ 23 | เลือก Gear Fit 24 | เลือก Gear Fit 25 | การเชื่อมต่อ 26 | เชื่อมต่อแล้ว 27 | หลุดการเชื่อมต่อ 28 | ไม่พบ 29 | อุปกรณ์ 30 | ข้อความ 31 | โทรศัพท์ 32 | รูปแบบเวลา 33 | 24.00 น. 34 | 12.00 AM/PM 35 | การแจ้งเตือนสภาพอากาศ 36 | เลือกการแจ้งเตือนสภาพอากาศ 37 | เลือก ตัวเลือก 38 | ไม่มีการแจ้งเตือน 39 | ฟิตเนส 40 | ฟิตเนส 41 | เรียกข้อมูลฟิตเนส 42 | แอปพลิเคชัน 43 | บริจาค 44 | บริจาคผ่าน PayPal 45 | ไม่พบแอปพลิเคชัน กรุณากดปุ่ม + ที่เมนูด้านบนเพื่อเพิ่มแอปพลิเคชัน โปรดตรวจสอบด้วยว่าได้เปิดการเข้าถึงการแจ้งเตือน (Notification Access) ไม่เช่นนั้นการแจ้งเตือนอาจไม่ทำงาน 46 | กำลังเปิด… 47 | กำลังค้นหา… 48 | การค้นหาเสร็จสิ้น กรุณาเลือกอุปกรณ์ 49 | กำลังพยายามเชื่อมต่อ: 50 | กำลังเรียกข้อมูลฟิตเนส… 51 | เปิดใช้งานบลูทูธแล้ว 52 | บลูทูธล้มเหลว 53 | เชื่อมต่อ Gear Fit แล้ว 54 | Gear Fit หลุดการเชื่อมต่อ 55 | การเชื่อมต่อ Gear Fit ล้มเหลว 56 | การเชื่อมต่อ Gear Fit ล้มเหลว 57 | Open Fit 58 | เชื่อมต่อ Gear Fit แล้ว 59 | หลุดการเชื่อมต่อ 60 | เชื่อมต่อ 61 | หยุดการเชื่อมต่อ 62 | ปิดการทำงาน 63 | 64 | -------------------------------------------------------------------------------- /app/src/main/res/values-ru/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Open Fit 4 | Open Fit 5 | Добавить приложение 6 | Удалить приложение 7 | Помощь 8 | Добавить приложение 9 | Удалить приложение 10 | Open Fit Помощь 11 | Закрыть 12 | Фитнес 13 | Закрыть 14 | Новости Open Fit 15 | Закрыть 16 | Подключение 17 | Включить Bluetooth 18 | Поиск 19 | Поиск Bluetooth 20 | Поиск Gear Fit 21 | Сканирование…ждите 22 | Показать устройства 23 | Выбор Gear Fit 24 | Выбрать Gear Fit 25 | Подключение 26 | Подключено 27 | Отключено 28 | Нет 29 | Устройство 30 | Текстовые сообщения 31 | Телефонные вызовы 32 | Формат времени 33 | 24-часовой формат 34 | 12-часовой формат 35 | Обновление погоды 36 | Настройки обновления погоды 37 | Выбор опции 38 | Без обновления 39 | Фитнес 40 | Фитнес 41 | Получить фитнес данные 42 | Приложения 43 | Пожертвования 44 | Пожертвовать через PayPal 45 | Нет добавленных приложений. Нажмите на иконку + в верхней части меню для добавления приложения. Разрешите уведомления, которые должны работать. 46 | Доступность… 47 | Поиск… 48 | Сканирование завершено. Пожалуйста выберите устройство 49 | Попытка подключения к: 50 | Запрос фитнес данных… 51 | Bluetooth доступен 52 | Bluetooth недоступен 53 | Gear Fit подключен 54 | Gear Fit отключен 55 | Gear Fit подключить не удалось 56 | Gear Fit не удалось подключиться 57 | Open Fit 58 | Подключен к Gear Fit 59 | Отключено от Gear Fit 60 | Подключить 61 | Отключить 62 | Выйти 63 | 64 | -------------------------------------------------------------------------------- /app/src/main/java/com/solderbyte/openfit/ExerciseData.java: -------------------------------------------------------------------------------- 1 | package com.solderbyte.openfit; 2 | 3 | import android.os.Parcel; 4 | import android.os.Parcelable; 5 | 6 | public class ExerciseData implements Parcelable { 7 | 8 | private long timeStamp; 9 | private long duration; 10 | private float calories; 11 | private int avgHeartRate; 12 | private float distance; 13 | private byte fitnessLevel; 14 | private int exerciseType; 15 | private float avgSpeed; 16 | private float maxSpeed; 17 | private int maxHeartRate; 18 | private float maxAlt; 19 | private float minAlt; 20 | private float inclinedDistance; 21 | private float declinedDistance; 22 | 23 | public ExerciseData(long t, long d, float c, int aHR, float dist, byte f, int e, float aS, float mS, int mHR, float maxA, float minA, float iD, float dD) { 24 | timeStamp = t; 25 | duration = d; 26 | calories = c; 27 | avgHeartRate = aHR; 28 | distance = dist; 29 | fitnessLevel = f; 30 | exerciseType = e; 31 | avgSpeed = aS; 32 | maxSpeed = mS; 33 | maxHeartRate = mHR; 34 | maxAlt = maxA; 35 | minAlt = minA; 36 | inclinedDistance = iD; 37 | declinedDistance = dD; 38 | } 39 | 40 | public ExerciseData(Parcel source) { 41 | timeStamp = source.readLong(); 42 | duration = source.readLong(); 43 | calories = source.readFloat(); 44 | avgHeartRate = source.readInt(); 45 | distance = source.readFloat(); 46 | fitnessLevel = source.readByte(); 47 | exerciseType = source.readInt(); 48 | avgSpeed = source.readFloat(); 49 | maxSpeed = source.readFloat(); 50 | maxHeartRate = source.readInt(); 51 | maxAlt = source.readFloat(); 52 | minAlt = source.readFloat(); 53 | inclinedDistance = source.readFloat(); 54 | declinedDistance = source.readFloat(); 55 | } 56 | 57 | @Override 58 | public int describeContents() { 59 | return 0; 60 | } 61 | 62 | @Override 63 | public void writeToParcel(Parcel source, int flags) { 64 | source.writeLong(timeStamp); 65 | source.writeLong(duration); 66 | source.writeFloat(calories); 67 | source.writeInt(avgHeartRate); 68 | source.writeFloat(distance); 69 | source.writeByte(fitnessLevel); 70 | source.writeInt(exerciseType); 71 | source.writeFloat(avgSpeed); 72 | source.writeFloat(maxSpeed); 73 | source.writeInt(maxHeartRate); 74 | source.writeFloat(maxAlt); 75 | source.writeFloat(minAlt); 76 | source.writeFloat(inclinedDistance); 77 | source.writeFloat(declinedDistance); 78 | } 79 | 80 | public static final Parcelable.Creator CREATOR = new Parcelable.Creator() { 81 | public ExerciseData createFromParcel(Parcel source) { 82 | return new ExerciseData(source); 83 | } 84 | 85 | @Override 86 | public ExerciseData[] newArray(int size) { 87 | return new ExerciseData[size]; 88 | } 89 | }; 90 | 91 | public long getTimeStamp() { 92 | return timeStamp; 93 | } 94 | 95 | public long getDuration() { 96 | return duration; 97 | } 98 | 99 | public float getCalories() { 100 | return calories; 101 | } 102 | 103 | public int getAvgHeartRate() { 104 | return avgHeartRate; 105 | } 106 | 107 | public float getDistance() { 108 | return distance; 109 | } 110 | 111 | public byte getFitnessLevel() { 112 | return fitnessLevel; 113 | } 114 | 115 | public int getExerciseType() { 116 | return exerciseType; 117 | } 118 | 119 | public float getAvgSpeed() { 120 | return avgSpeed; 121 | } 122 | 123 | public float getMaxSpeed() { 124 | return maxSpeed; 125 | } 126 | 127 | public int getMaxHeartRate() { 128 | return maxHeartRate; 129 | } 130 | 131 | public long getTimeStampEnd() { 132 | return timeStamp + duration * 1000L; 133 | } 134 | 135 | public float getMaxAltitude() { 136 | return maxAlt; 137 | } 138 | 139 | public float getMinAltitude() { 140 | return minAlt; 141 | } 142 | 143 | public float getInclinedDistance() { 144 | return inclinedDistance; 145 | } 146 | 147 | public float getDeclinedDistance() { 148 | return declinedDistance; 149 | } 150 | } 151 | -------------------------------------------------------------------------------- /app/src/main/res/values-de/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Open Fit 4 | Open Fit 5 | App Hinzufügen 6 | App Entfernen 7 | Hilfe 8 | App Hinzufügen 9 | App Entfernen 10 | Open Fit Hilfe 11 | Schließen 12 | Fitness 13 | Schließen 14 | Open Fit News 15 | Schließen 16 | Verbindung 17 | Bluetooth aktivieren 18 | Suchen 19 | Bluetooth suchen 20 | Gear Fit suchen 21 | Suche…Bitte Warten 22 | Geräte anzeigen 23 | Gear Fit auswählen 24 | Gear Fit auswählen 25 | Verbinden 26 | Verbunden 27 | Getrennt 28 | Keins 29 | Gerät 30 | Text Nachrichten 31 | Anrufe 32 | Uhren Format 33 | 24-Stunden Uhr 34 | 12-Stunden Uhr 35 | Wetter Updates 36 | Wetter auswählenr 37 | Option Auswählen 38 | Keine Updates 39 | Fitness 40 | Fitness 41 | Fitness Daten anfragen 42 | Apps 43 | Spenden 44 | Spenden Sie via PayPal 45 | Kein Apps hinzugefügt. Klicken Sie auf das + icon im oberen Menü und fügen Sie eine App hinzu. Stellen Sie sicher, dass der Benachrichtigungszugriff aktiviert ist, sonst funktionieren die Benachrichtigungen nicht. 46 | Aktiviere… 47 | Suche… 48 | Suche fertig. Bitte wählen Sie das Gerät aus 49 | Verbinde mit: 50 | Frage Fitness Daten ab… 51 | Bluetooth aktiviert 52 | Bluetooth fehlgeschlagen 53 | Gear Fit verbunden 54 | Gear Fit getrennt 55 | Gear Fit Verbindung fehlgeschlagen 56 | Gear Fit Verbindung fehlgeschlagen 57 | Open Fit 58 | Mit Gear Fit verbunden 59 | Von Gear Fit getrennt 60 | Verbinden 61 | Getrennt 62 | Ausschalten 63 | 64 | -------------------------------------------------------------------------------- /app/src/main/res/values-pl/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Open Fit 4 | Open Fit 5 | Dodaj aplikacje 6 | Usuń aplikacje 7 | Pomoc 8 | Dodaj aplikacje 9 | Usuń aplikacje 10 | Open Fit Pomoc 11 | Zamknij 12 | Ćwiczenia 13 | Zamknij 14 | Nowości Open Fit 15 | Zamknij 16 | Łączność 17 | Włącz bluetooth 18 | Wyszukaj 19 | Wyszukaj bluetooth 20 | Znajdź Gear Fit 21 | Wyszukiwanie…Proszę czekać 22 | Pokaż urządzenia 23 | Wybierz Gear Fit 24 | Wybierz Gear Fit 25 | Połącz 26 | Połączono 27 | Rozłączono 28 | Żaden 29 | Urządzenie 30 | Wiadomości tekstowe 31 | Połączenia telefoniczne 32 | Format zegara 33 | 24-godzinny zegar 34 | 12-godzinny zegar 35 | Aktualizacja pogody 36 | Wybierz pogodę 37 | Wybierz opcję 38 | Żadnych aktualizacji 39 | Ćwiczenia 40 | Ćwiczenia 41 | Pobierz dane o ćwiczeniach 42 | Aplikacje 43 | Darowizna 44 | Przekaż darowiznę przez PayPal. 45 | Nie dodano żadnej aplikacji. Naciśnij ikonę + u góry menu by dodać aplikację. Bądź pewny, że dostęp do powiadomień jest przyznany, w przeciwnym razie powiadomienia nie będą działać. 46 | Włączanie… 47 | Wyszukiwanie… 48 | Wyszukiwanie zakończone. Wybierz urządzenie. 49 | Próba połączenia z: 50 | Pobieranie danych o ćwiczeniach… 51 | Bluetooth włączony 52 | Niepowodzenie bluetooth 53 | Gear Fit połączony 54 | Gear Fit rozłączony 55 | Połączenie z Gear Fit nieudane 56 | Połączenie z Gear Fit nieudane 57 | Open Fit 58 | Połączono z Gear Fit 59 | Rozłączono z Gear Fit 60 | Połącz 61 | Rozłącz 62 | Wyłącz 63 | 64 | -------------------------------------------------------------------------------- /app/src/main/res/values-pt/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Open Fit 4 | Open Fit 5 | Adicionar Aplicativo 6 | Apagar Aplicativo 7 | Ajuda 8 | Adicionar Aplicativo 9 | Apagar Aplicativo 10 | Ajuda do Open Fit 11 | Fechar 12 | Fitness 13 | Fechar 14 | Notícias do Open Fit 15 | Fechar 16 | Conectividade 17 | Habilitar Bluetooth 18 | Buscar 19 | Buscar Bluetooth 20 | Buscar Gear Fit 21 | Buscando…por favor aguarde 22 | Mostrar Dispositivos 23 | Selecionar Gear Fit 24 | Selecionar Gear Fit 25 | Conectar 26 | Conectado 27 | Desconectado 28 | Nenhum 29 | Dispositivo 30 | Mensagens de Texto 31 | Ligações 32 | Formato da Hora 33 | 24 Horas 34 | 12 Horas 35 | Atualização do Tempo 36 | Selecione Tempo 37 | Selecionar Opção 38 | Sem Atualizações 39 | Fitness 40 | Fitness 41 | Buscar Dados Fitness 42 | Aplicativos 43 | Doe 44 | Faça uma doação via PayPal 45 | Nenhum aplicativo selecionado. Clique em + do menu no topo para adicionar um aplicativo. Tenha certeza que o Acesso a Notificações esteja habilitado, caso contrário as notificações não irão funcionar. 46 | Habilitando… 47 | Buscando… 48 | Busca completa. Por favor selecione o dispositivo 49 | Tentativa de conexão com: 50 | Retornando dados fitness… 51 | Bluetooth habilitado 52 | Bluetooth falhou 53 | Gear Fit conectado 54 | Gear Fit desconectado 55 | Conexão com o Gear Fit falhou 56 | Conexão com o Gear Fit falhou 57 | Open Fit 58 | Conectado ao Gear Fit 59 | Desconectado do Gear Fit 60 | Conectar 61 | Desconectar 62 | Desligar 63 | 64 | -------------------------------------------------------------------------------- /app/src/main/res/values-nl/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Open Fit 4 | Open Fit 5 | App Toevoegen 6 | App Verwijderen 7 | Help 8 | App Toevoegen 9 | Sluiten 10 | App Verwijderen 11 | Sluiten 12 | Open Fit Help 13 | Sluiten 14 | Fitness 15 | Sluiten 16 | Open Fit Niews 17 | Sluiten 18 | Verbindingen 19 | Zet bluetooth aan 20 | Zoeken 21 | Zoek Bluetooth apparaat 22 | Zoek naar Gear Fit 23 | Zoeken…Even geduld 24 | Toon apparaten 25 | Selecteer Gear Fit 26 | Selecteer Gear Fit 27 | Verbinden 28 | Verbonden 29 | Verbinding verbroken 30 | Geen 31 | Apparaat 32 | Tekst Bericht 33 | Gesprekken 34 | Klok instellingen 35 | 24-uurs klok 36 | 12-uurs klok 37 | Weer Instellingen 38 | Kies Weeropties 39 | Kies optie 40 | Geen meldingen 41 | Fitness 42 | Fitness 43 | Fitness Data opvragen 44 | Apps 45 | Donatie 46 | Donatie via PayPal 47 | Geen app toegevoegd. Klik op het + icoon bovenin het menu om een app toe te voegen. Zorg ervoor dat "Notificatie toegang" is ingeschakeld.(zie help) 48 | Aanzetten… moment… 49 | Zoeken… moment… 50 | Zoeken voltooid. Selecteer de Fit Gear 51 | Poging to verbinden met: 52 | Ophalen fitness data… 53 | Bluetooth ingeschakeld 54 | Bluetooth verbinding mislukt 55 | Gear Fit gekoppeld 56 | Gear Fit ontkoppeld 57 | Gear Fit verbinding mislukt 58 | Gear Fit verbinding mislukt 59 | Open Fit 60 | Gear Fit gekoppeld 61 | Gear Fit Ontkoppeld 62 | Koppel 63 | Ontkoppel 64 | Afsluiten 65 | 66 | -------------------------------------------------------------------------------- /app/src/main/res/values-it/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Open Fit 4 | Open Fit 5 | Aggiungi Applicazione 6 | Rimuovi Applicazione 7 | Help 8 | Aggiungi Applicazione 9 | Del Application 10 | Open Fit Help 11 | Chiudi 12 | Fitness 13 | Chiudi 14 | Novità Open Fit 15 | Chiudi 16 | Connettività 17 | Attiva Bluetooth 18 | Cerca dispositivi 19 | Cerca Bluetooth 20 | Cerca Gear Fit 21 | Scansione…attendi 22 | Mostra Dispositivi 23 | Seleziona Gear Fit 24 | Seleziona Gear Fit 25 | Connetti 26 | Connesso 27 | Disconnesso 28 | Nessun Dispositivo 29 | Dispositivo 30 | Messaggio di testo 31 | Chiamata telefonica 32 | Formato orologio 33 | 24-ore 34 | 12-ore 35 | Aggiornamenti meteo 36 | Seleziona Meteo 37 | Seleziona Opzione 38 | Nessun Aggiornamento 39 | Fitness 40 | Fitness 41 | Richiesta Dati Fitness 42 | Applicazioni 43 | Donazioni 44 | Fai una donazione tramite PayPal 45 | Nessuna applicazione aggiunta. Clicca l\'icona + nel menu in alto per aggiungere un\'applicazione. Assicurati che l\'accesso alle Notifiche sia Abilitato, altrimenti le notifiche non funzioneranno. 46 | Abilitazione in corso… 47 | Scansione in corso… 48 | Scansione completata. Seleziona il dispositivo 49 | Tentativo di connessiosione a: 50 | Richiesta dati fitness… 51 | Bluetooth abilitato 52 | Bluetooth fallito 53 | Gear Fit connesso 54 | Gear Fit disconnesso 55 | Connessione al Gear Fit fallita 56 | Connessione al Gear Fit fallita 57 | Open Fit 58 | Gear Fit connesso 59 | Gear Fit disconnesso 60 | Connetti 61 | Disconnetti 62 | Chiudi 63 | 64 | -------------------------------------------------------------------------------- /app/src/main/res/values-es/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Open Fit 4 | Open Fit 5 | Añadir aplicación 6 | Quitar aplicación 7 | Ayuda 8 | Añadir aplicación 9 | Quitar aplicación 10 | Ayuda de Open Fit 11 | Cerrar 12 | Actividad Física 13 | Cerrar 14 | Noticias Open Fit 15 | Cerrar 16 | Conectividad 17 | Habilitar Bluetooth 18 | Escanear 19 | Escanear Dispositivos Bluetooth 20 | Escanear Dispositivos Bluetooth 21 | Escaneando… por favor espera 22 | Mostrar Dispositivos 23 | Seleccionar Gear Fit 24 | Seleccionar Gear Fit 25 | Conectar 26 | Conectado 27 | Desconectado 28 | Ninguno 29 | Dispositivo 30 | Mensajes De Texto 31 | Llamadas Telefónicas 32 | Formato De Reloj 33 | Reloj 24-horas 34 | Reloj 12-horas 35 | Actualizaciones Del Clima 36 | Seleccionar Clima 37 | Seleccionar Opción 38 | No Actualizar 39 | Actividad Física 40 | Actividad Física 41 | Obtener Datos De Actividad Física 42 | Aplicaciones 43 | Donar 44 | Haz una donación a través de PayPal 45 | No hay aplicaciones añadidas. Haga clic en el icono + del menú superior para agregar una aplicación. Asegúrese de que el acceso a notificaciones está activado, de lo contrario las notificaciones no funcionarán. 46 | Habilitando… 47 | Escaneando… 48 | Escaneo completado. Por favor, seleccione un dispositivo 49 | Intentando a connectar con: 50 | Solicitando datos de actividad física… 51 | Bluetooth habilitado 52 | Bluetooth falló 53 | Gear Fit conectado 54 | Gear Fit desconectado 55 | Gear Fit conectar falló 56 | Gear Fit conectar falló 57 | Open Fit 58 | Conectado a Gear Fit 59 | Desconectado de Gear Fit 60 | Conectar 61 | Desconectar 62 | Cerrar 63 | 64 | -------------------------------------------------------------------------------- /app/src/main/res/values-hu/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Open Fit 4 | Open Fit 5 | Alkalmazás hozzáadása 6 | Alkalmazás eltávolítása 7 | Súgó 8 | Alkalmazás hozzáadása 9 | Mégse 10 | Alkalmazás eltávolítása 11 | Mégse 12 | Súgó 13 | Mégse 14 | Fitness 15 | Mégse 16 | Open Fit Újdonságok 17 | Mégse 18 | Kapcsolódás 19 | Bluetooth Bekapcsolása 20 | Keres 21 | Bluetooth eszköz keresés 22 | Gear Fit keresése 23 | Keresés…kérem várjon 24 | Eszközök mutatása 25 | Gear Fit kiválasztása 26 | Gear Fit kiválasztása 27 | Kapcsolódás 28 | Kapcsolódás 29 | Nem kapcsolódik 30 | Nem található eszköz 31 | Eszköz 32 | SMS 33 | Hívások 34 | Óra formátum 35 | 24-óra 36 | 12-óra 37 | Időjárás jelentése 38 | Időjárás kiválasztása 39 | Beállítás kiválasztása 40 | Nincs frissítés 41 | Fitness 42 | Fitness 43 | Fitness adatok lekérdezése 44 | Alkalmazások 45 | Támogatás 46 | Támogatás PayPal-on keresztül 47 | Nincs alkalmazás hozzáadva. Kattints a + iconra a fenti menüben és adjon hozzá egy alkalmazást. Győződjön meg róla hogy a Hozzáférés Értesítésekhez-ben engedélyezve van az Open Fit, különben az értesítések nem fognak megérkezni az Gear Fit eszközére. 48 | … engedélyezése 49 | Keresés… 50 | Keresés befejezve. Kérem válaszd ki az eszközt 51 | Kapcsolódási kísérlet a következőhöz: 52 | Fitness adatok lekérdezése… 53 | Bluetooth engedélyezése 54 | Bluetooth kapcsolat sikertelen 55 | Gear Fit kapcsolódva 56 | Gear Fit kapcsolat megszakadt 57 | Gear Fit sikertelen kapcsolódás 58 | Gear Fit sikertelen kapcsolódás 59 | Open Fit 60 | Kapcsolódás a Gear Fit-hez 61 | Lekapcsolódás a Gear Fit-ről 62 | Kapcsolódás 63 | Lekapcsolódás 64 | Leállítás 65 | 66 | -------------------------------------------------------------------------------- /app/src/main/java/com/solderbyte/openfit/OpenFitSavedPreferences.java: -------------------------------------------------------------------------------- 1 | package com.solderbyte.openfit; 2 | 3 | import java.util.LinkedHashSet; 4 | import java.util.Set; 5 | 6 | import android.content.Context; 7 | import android.content.SharedPreferences; 8 | import android.content.SharedPreferences.Editor; 9 | import android.preference.PreferenceManager; 10 | import android.util.Log; 11 | 12 | public class OpenFitSavedPreferences { 13 | private static final String LOG_TAG = "OpenFit:OpenFitSavedPreferences"; 14 | public static final String PREFS_NAME = "OpenFitSettings"; 15 | public static final String PREFS_DEFAULT = "DEFAULT"; 16 | public static final boolean PREFS_DEFAULT_BOOL = false; 17 | public static final int PREFS_DEFAULT_INT = 0; 18 | 19 | private SharedPreferences preferences; 20 | private Editor editor; 21 | 22 | public String preference_list_devices_value; 23 | public String preference_list_devices_entry; 24 | public boolean preference_checkbox_phone; 25 | public boolean preference_checkbox_sms; 26 | public boolean preference_checkbox_exercise_gps; 27 | public boolean preference_checkbox_time; 28 | public String preference_list_weather_value; 29 | public String preference_list_weather_entry; 30 | public Set set_packageNames = new LinkedHashSet(); 31 | 32 | public OpenFitSavedPreferences(Context context) { 33 | this.load(context); 34 | } 35 | 36 | public void load(Context context) { 37 | preferences = PreferenceManager.getDefaultSharedPreferences(context); 38 | editor = preferences.edit(); 39 | 40 | Log.d(LOG_TAG, "Loading saved preferences"); 41 | preference_list_devices_value = preferences.getString("preference_list_devices_value"+":string", PREFS_DEFAULT); 42 | preference_list_devices_entry = preferences.getString("preference_list_devices_entry"+":string", PREFS_DEFAULT); 43 | preference_checkbox_phone = preferences.getBoolean("preference_checkbox_phone"+":boolean", PREFS_DEFAULT_BOOL); 44 | preference_checkbox_sms = preferences.getBoolean("preference_checkbox_sms"+":boolean", PREFS_DEFAULT_BOOL); 45 | preference_checkbox_exercise_gps = preferences.getBoolean("preference_checkbox_exercise_gps"+":boolean", PREFS_DEFAULT_BOOL); 46 | preference_checkbox_time = preferences.getBoolean("preference_checkbox_time"+":boolean", PREFS_DEFAULT_BOOL); 47 | preference_list_weather_value = preferences.getString("preference_list_weather_value"+":string", PREFS_DEFAULT); 48 | preference_list_weather_entry = preferences.getString("preference_list_weather_entry"+":string", PREFS_DEFAULT); 49 | set_packageNames = preferences.getStringSet("set_packageNames", set_packageNames); 50 | } 51 | 52 | public void saveBoolean(String key, boolean value) { 53 | //Log.d(LOG_TAG, "Saving: " + key + ":boolean :" + value); 54 | editor.putBoolean(key + ":boolean", value); 55 | editor.commit(); 56 | } 57 | 58 | public void saveInt(String string, int n) { 59 | this.editor.putInt(string + ":string", n); 60 | this.editor.commit(); 61 | } 62 | 63 | public void saveString(String key, String value) { 64 | //Log.d(LOG_TAG, "Saving: " + key + ":string :" + value); 65 | editor.putString(key + ":string", value); 66 | editor.commit(); 67 | } 68 | 69 | public void saveSet(String value) { 70 | //Log.d(LOG_TAG, "Adding to Set: " + value); 71 | set_packageNames.add(value); 72 | editor.putStringSet("set_packageNames", set_packageNames); 73 | editor.commit(); 74 | } 75 | 76 | public boolean getBoolean(String key) { 77 | //Log.d(LOG_TAG, "Getting: " + key + ":boolean"); 78 | boolean value = preferences.getBoolean(key+":boolean", PREFS_DEFAULT_BOOL); 79 | return value; 80 | } 81 | 82 | public int getInt(String string) { 83 | return this.preferences.getInt(string + ":string", PREFS_DEFAULT_INT); 84 | } 85 | 86 | public String getString(String key) { 87 | //Log.d(LOG_TAG, "Getting: " + key + ":string"); 88 | String value = preferences.getString(key + ":string", PREFS_DEFAULT); 89 | return value; 90 | } 91 | 92 | public Set getSet() { 93 | Set packageNames = new LinkedHashSet(); 94 | packageNames = preferences.getStringSet("set_packageNames", packageNames); 95 | //Log.d(LOG_TAG, "Getting Set[" + packageNames.size() + "]: " + packageNames); 96 | return packageNames; 97 | } 98 | 99 | public void removeBoolean(String key) { 100 | //Log.d(LOG_TAG, "Removing: " + key + ":boolean"); 101 | editor.remove(key + ":boolean"); 102 | editor.commit(); 103 | } 104 | 105 | public void removeString(String key) { 106 | //Log.d(LOG_TAG, "Removing: " + key + ":string"); 107 | editor.remove(key + ":string"); 108 | editor.commit(); 109 | } 110 | 111 | public void removeSet(String value) { 112 | //Log.d(LOG_TAG, "Removing Set: " + value); 113 | set_packageNames.remove(value); 114 | editor.putStringSet("set_packageNames", set_packageNames); 115 | editor.commit(); 116 | } 117 | } 118 | -------------------------------------------------------------------------------- /app/src/main/java/com/solderbyte/openfit/Weather.java: -------------------------------------------------------------------------------- 1 | package com.solderbyte.openfit; 2 | 3 | import org.json.JSONArray; 4 | import org.json.JSONException; 5 | import org.json.JSONObject; 6 | 7 | import com.solderbyte.openfit.HttpClient.AsyncResponse; 8 | import com.solderbyte.openfit.util.OpenFitIntent; 9 | 10 | import android.content.Context; 11 | import android.content.Intent; 12 | import android.util.Log; 13 | 14 | public class Weather { 15 | private static final String LOG_TAG = "OpenFit:Weather"; 16 | 17 | private static String APIKEY = "APPID=00042ee1a3e6f5dbb2a3c63e4e8fb50a"; 18 | private static String APIURL = "http://api.openweathermap.org/data/2.5/weather"; 19 | private static String QUERY = "?"; 20 | private static String AMP = "&"; 21 | private static String UNITS = "units="; 22 | 23 | private static String units = "imperial"; //Fahrenheit = imperial, Celsius = metric, Default = Kelvin 24 | 25 | private static String WEATHER = "weather"; 26 | private static String WEATHER_MAIN = "main"; 27 | private static String WEATHER_DESC = "description"; 28 | private static String WEATHER_ICON = "icon"; 29 | private static String MAIN = "main"; 30 | private static String MAIN_TEMP = "temp"; 31 | private static String MAIN_PRES = "pressure"; 32 | private static String MAIN_HUMD = "humidity"; 33 | private static String MAIN_TMIN = "temp_min"; 34 | private static String MAIN_TMAX = "temp_max"; 35 | private static String NAME = "name"; 36 | 37 | private static String name = null; 38 | private static String tempCur = null; 39 | private static String tempMin = null; 40 | private static String tempMax = null; 41 | private static String humidity = null; 42 | private static String pressure = null; 43 | private static String weather = null; 44 | private static String description = null; 45 | private static String icon = null; 46 | private static String tempUnit = null; 47 | 48 | private static HttpClient http = null; 49 | private static Context context; 50 | 51 | public static void init(Context cntxt) { 52 | Log.d(LOG_TAG, "Initializing Weather"); 53 | context = cntxt; 54 | http = new HttpClient(cntxt); 55 | } 56 | 57 | public static void getWeather(String query, final String location) { 58 | Log.d(LOG_TAG, "Getting weather info for: " + query + " - " + location); 59 | http.get(APIURL + QUERY + query + AMP + UNITS + units + AMP + APIKEY, new AsyncResponse() { 60 | @Override 61 | public void callback(JSONObject res) { 62 | Log.d(LOG_TAG, "Weather callback"); 63 | if(res != null) { 64 | try { 65 | JSONObject main = res.getJSONObject(MAIN); 66 | 67 | if(main.has(MAIN_TEMP)) { 68 | tempCur = main.getString(MAIN_TEMP); 69 | } 70 | if(main.has(MAIN_TMIN)) { 71 | tempMin = main.getString(MAIN_TMIN); 72 | } 73 | if(main.has(MAIN_TMAX)) { 74 | tempMax = main.getString(MAIN_TMAX); 75 | } 76 | if(main.has(MAIN_HUMD)) { 77 | humidity = main.getString(MAIN_HUMD); 78 | } 79 | if(main.has(MAIN_PRES)) { 80 | pressure = main.getString(MAIN_PRES); 81 | } 82 | 83 | if(units.equals("imperial")) { 84 | tempUnit = "°F"; 85 | } 86 | else if(units.equals("metric")) { 87 | tempUnit = "°C"; 88 | } 89 | else { 90 | tempUnit = "K"; 91 | } 92 | 93 | JSONArray w = res.getJSONArray(WEATHER); 94 | for(int i = 0; i < w.length(); i++) { 95 | JSONObject wo = w.getJSONObject(i); 96 | weather = wo.getString(WEATHER_MAIN); 97 | description = wo.getString(WEATHER_DESC); 98 | icon = wo.getString(WEATHER_ICON); 99 | } 100 | 101 | name = res.getString(NAME); 102 | } 103 | catch(JSONException e) { 104 | e.printStackTrace(); 105 | } 106 | 107 | Intent msg = new Intent(OpenFitIntent.INTENT_SERVICE_WEATHER); 108 | msg.putExtra("name", name); 109 | msg.putExtra("weather", weather); 110 | msg.putExtra("description", description); 111 | msg.putExtra("tempCur", tempCur); 112 | msg.putExtra("tempMin", tempMin); 113 | msg.putExtra("tempMax", tempMax); 114 | msg.putExtra("humidity", humidity); 115 | msg.putExtra("pressure", pressure); 116 | msg.putExtra("icon", icon); 117 | msg.putExtra("tempUnit", tempUnit); 118 | msg.putExtra("location", location); 119 | context.sendBroadcast(msg); 120 | } 121 | } 122 | }); 123 | } 124 | 125 | public static void setUnits(String unit) { 126 | units = unit; 127 | } 128 | 129 | public static String getUnits() { 130 | return units; 131 | } 132 | } 133 | -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # Attempt to set APP_HOME 46 | # Resolve links: $0 may be a link 47 | PRG="$0" 48 | # Need this for relative symlinks. 49 | while [ -h "$PRG" ] ; do 50 | ls=`ls -ld "$PRG"` 51 | link=`expr "$ls" : '.*-> \(.*\)$'` 52 | if expr "$link" : '/.*' > /dev/null; then 53 | PRG="$link" 54 | else 55 | PRG=`dirname "$PRG"`"/$link" 56 | fi 57 | done 58 | SAVED="`pwd`" 59 | cd "`dirname \"$PRG\"`/" >/dev/null 60 | APP_HOME="`pwd -P`" 61 | cd "$SAVED" >/dev/null 62 | 63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 64 | 65 | # Determine the Java command to use to start the JVM. 66 | if [ -n "$JAVA_HOME" ] ; then 67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 68 | # IBM's JDK on AIX uses strange locations for the executables 69 | JAVACMD="$JAVA_HOME/jre/sh/java" 70 | else 71 | JAVACMD="$JAVA_HOME/bin/java" 72 | fi 73 | if [ ! -x "$JAVACMD" ] ; then 74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 75 | 76 | Please set the JAVA_HOME variable in your environment to match the 77 | location of your Java installation." 78 | fi 79 | else 80 | JAVACMD="java" 81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 82 | 83 | Please set the JAVA_HOME variable in your environment to match the 84 | location of your Java installation." 85 | fi 86 | 87 | # Increase the maximum file descriptors if we can. 88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 89 | MAX_FD_LIMIT=`ulimit -H -n` 90 | if [ $? -eq 0 ] ; then 91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 92 | MAX_FD="$MAX_FD_LIMIT" 93 | fi 94 | ulimit -n $MAX_FD 95 | if [ $? -ne 0 ] ; then 96 | warn "Could not set maximum file descriptor limit: $MAX_FD" 97 | fi 98 | else 99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 100 | fi 101 | fi 102 | 103 | # For Darwin, add options to specify how the application appears in the dock 104 | if $darwin; then 105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 106 | fi 107 | 108 | # For Cygwin, switch paths to Windows format before running java 109 | if $cygwin ; then 110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 112 | JAVACMD=`cygpath --unix "$JAVACMD"` 113 | 114 | # We build the pattern for arguments to be converted via cygpath 115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 116 | SEP="" 117 | for dir in $ROOTDIRSRAW ; do 118 | ROOTDIRS="$ROOTDIRS$SEP$dir" 119 | SEP="|" 120 | done 121 | OURCYGPATTERN="(^($ROOTDIRS))" 122 | # Add a user-defined pattern to the cygpath arguments 123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 125 | fi 126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 127 | i=0 128 | for arg in "$@" ; do 129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 131 | 132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 134 | else 135 | eval `echo args$i`="\"$arg\"" 136 | fi 137 | i=$((i+1)) 138 | done 139 | case $i in 140 | (0) set -- ;; 141 | (1) set -- "$args0" ;; 142 | (2) set -- "$args0" "$args1" ;; 143 | (3) set -- "$args0" "$args1" "$args2" ;; 144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 150 | esac 151 | fi 152 | 153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 154 | function splitJvmOpts() { 155 | JVM_OPTS=("$@") 156 | } 157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 159 | 160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 161 | -------------------------------------------------------------------------------- /app/src/main/java/com/solderbyte/openfit/protocol/OpenFitNotificationGeneralProtocol.java: -------------------------------------------------------------------------------- 1 | /* 2 | 020400000005000000 heart rate 82BPM 3 | 020400000005000000 heart reate 83BPM 4 | 020400000005000000 heart rate ready? 5 | 020400000005000000 after done running 6 | 7 | exercise: 8 | 02040000001B000000 cycling? 9 | 02040000001B000000 start? 10 | 02040000001B000000 11 | 12 | running: 13 | 020400000012000000021000000013000000020000007A142F4359DAC742 14 | rec gps: 15 | 020400000012000000021000000013000000030000007A142F4359DAC742 16 | starting? 17 | 020400000012000000021000000013000000020000007A142F4359DAC742 18 | 19 | running done: 20 | 02040000000A000000 21 | 02040000000A000000 failed? 22 | 02040000000A000000 after hitting stop running 23 | 24 | respond after sync request 25 | 02080000000300000001000000 26 | 02080000000300000001000000 27 | 28 | heart beat? 29 | 02050000000001000000 30 | 02050000000002000000 31 | 02050000000003000000 32 | 33 | 34 | 35 | 36 | No data? sync req 37 | 025C000000040000000A000000FF040100000008FFCF556500000052389C42A870AD40000100000045B5C8552300000000002A430000824235E60200CD7FCF12F1490200D1FB01001198020022BF0200010100000032EED0551027000000000000 38 | 01000000000000000000000000002A430000824235E602008016CF12F1490200D1FB01001198020021BF0200010100000012153C561027000011153C56030100000018C4395610270000 39 | @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 40 | find device 41 | 05020000000100 find 42 | 05020000000101 done 43 | 44 | clock changed 45 | 01020000000202 46 | 47 | change clock 48 | 01020000000a01 49 | 01020000000201 50 | //calendar 51 | 01020000000203 52 | //weather 53 | 01020000000202 54 | 55 | clock request weather 56 | 01010000000C 57 | 01010000000C 58 | 59 | clock change response? 60 | 013d0000000914fffe4e006900650064006500720072006100640006400600000100c944e0550698080000140500000600000000000000000600000000000000000001020000000200 61 | 013d0000000914fffe4e006900650064006500720072006100640006400600000100c944e05506980800001405000006000000000000000006000000000000000000 62 | 013d0000000914fffe4e006900650064006500720072006100640006d41700000000c944e05506201c00007c15000006000000000000000006000000000000000000 63 | 64 | bytes = OpenFitApi.getOpenWeatherClock(); 65 | bluetoothLeService.write(bytes); 66 | 67 | clock city request 68 | 010100000008 69 | 70 | view msg 71 | 030900000013F87CCD5500000000 72 | 73 | view in phone 74 | 030900000017F87CCD5500000000 75 | 76 | quick reply with "Ok" 77 | 030A0000001905F87CCD5500000000 78 | 79 | delete notification? 80 | 030900000016CFBCCF5500000000 81 | @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 82 | 83 | // waitinf ro location 84 | 020400000012000000021000000013000000030000003D8A2C4359DAC742 85 | 86 | // asking cycling for gps? 87 | 02040000000a000000 88 | 89 | // res probably with gps coordinate 90 | 02240000001600000000000000268fbb42b4ecb6420000000000000000000000000000000000000000 91 | CYCLE GPS? 92 | 02240000001600000000000000268fbb42b4ecb6420000000000000000000000000000000000000000 93 | 268fbb42 94 | b4ecb642 95 | //run res 96 | 0224000000160000000000000000000000000000000000000000000000000000000000000000000000 97 | 98 | //reques run 99 | 020400000012000000021000000013000000020000003D8A2C4359DAC742 100 | 020400000012000000021000000013000000020000003D8A2C4359DAC742 101 | 102 | //request cycle 103 | 020400000012000000021000000013000000030000003D8A2C4359DAC742 104 | 105 | // first cycle request 106 | 02040000001200000002100000001300000003000000000048430000fa42 107 | 108 | res 109 | 020400000010000000 110 | 02040000000c000000 111 | 112 | 02180000000d0000000000000000000000000000000000000000000000 113 | 114 | 115 | from logs 116 | 020400000005000000 117 | 118 | 02040000001200000002100000001300000003000000000048430000fa42 119 | 120 | 020400000010000000 121 | 01020000000a01 122 | 013d0000000914fffe4e0069006500640065007200720061006400034006000001005348ec5503a4060000e803000003000000000000000003000000000000000000 123 | 02040000000c000000 124 | 125 | 02180000000d0000000000000000000000000000000000000000000000 126 | 127 | 02040000000a000000 128 | 129 | 02240000001600000000000000268fbb42b4ecb6420000000000000000000000000000000000000000 130 | 131 | 02040000000f000000 132 | 133 | 02240000001600000000000000268fbb42b4ecb6420000000000000000000000000000000000000000 134 | 135 | 02240000001600000000000000268fbb42b4ecb6420000000000000000000000000000000000000000 136 | 0224000000160000000000000000000000000000000000000000000000000000000000000000000000 137 | 138 | 52.22154, 6.89366 139 | 140 | *************from gear fit 141 | 020400000012000000021000000013000000020000003d8a2c4359dac742 142 | 143 | 020400000010000000 144 | 145 | 02040000000a000000 146 | 147 | 0224000000160000000000000000000000000000000000000000000000000000000000000000000000 148 | 02010000001c 149 | 150 | 020400000012000000021000000013000000030000003d8a2c4359dac742 151 | 152 | 020400000010000000 153 | 02040000000c000000 154 | 155 | 02040000000e000000 156 | 157 | 02180000000d0000000000000000000000000000000000000000000000 158 | 02180000000d0000000000000000000000000000000000002030084d40 = 1292382240 159 | 02180000000d000000000000000000000000000000000000805dfd4c40 160 | 02180000000d000000000000000000000000000000000000a0edc74c40 161 | 02180000000d00000000000000000000000000000000000040ac124d40 = 1293069376 162 | 02180000000d000000000000000000000000000000000000c0ee524d40 = 1297280704 163 | ... 164 | 165 | 02180000000d00000000000000000000000000000000000020a03d4d40 166 | 02180000000d000000000000000000000000000000000000805dfd4c40 = 1291672960 167 | 168 | 022400000016000000000000000bee6a426d3f66420000000000000000000000000000000000000000 169 | 170 | 022400000016000000000000000bee6a426d3f66420000000000000000000000000000000000000000 171 | 172 | 022400000016000000000000000bee6a426d3f66420000000000000000000000000000000000000000 173 | 174 | 175 | 176 | 177 | */ 178 | 179 | -------------------------------------------------------------------------------- /app/src/main/res/xml/preferences.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 13 | 22 | 29 | 30 | 31 | 32 | 37 | 42 | 48 | 55 | 64 | 70 | 77 | 84 | 91 | 92 | 93 | 96 | 97 | 100 | 101 | 102 | 105 | 106 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 121 | 125 | 126 | 127 | 128 | -------------------------------------------------------------------------------- /app/src/main/java/com/solderbyte/openfit/util/OpenFitIntent.java: -------------------------------------------------------------------------------- 1 | package com.solderbyte.openfit.util; 2 | 3 | public class OpenFitIntent { 4 | public static final String INTENT_UI_ADDAPPLICATION = "com.solderbyte.openfit.ui.addapplication"; 5 | public static final String INTENT_UI_DELAPPLICATION = "com.solderbyte.openfit.ui.delapplication"; 6 | public static final String INTENT_UI_REJECTMESSAGES = "com.solderbyte.openfit.ui.rejectmessages"; 7 | public static final String INTENT_UI_BT = "com.solderbyte.openfit.ui.bt"; 8 | public static final String INTENT_SERVICE_START = "com.solderbyte.openfit.service.start"; 9 | public static final String INTENT_SERVICE_STOP = "com.solderbyte.openfit.service.stop"; 10 | public static final String INTENT_SERVICE_NOTIFICATION = "com.solderbyte.openfit.service.notification"; 11 | public static final String INTENT_SERVICE_NOTIFICATION_APPLICATIONS = "com.solderbyte.openfit.service.notification.applications"; 12 | public static final String INTENT_SERVICE_BT = "com.solderbyte.openfit.service.bt"; 13 | public static final String INTENT_SERVICE_SMS = "com.solderbyte.openfit.service.sms"; 14 | public static final String INTENT_SERVICE_MMS = "com.solderbyte.openfit.service.mms"; 15 | public static final String INTENT_SERVICE_PHONE = "com.solderbyte.openfit.service.phone"; 16 | public static final String INTENT_SERVICE_PHONE_IDLE = "com.solderbyte.openfit.service.phone.idle"; 17 | public static final String INTENT_SERVICE_PHONE_OFFHOOK = "com.solderbyte.openfit.service.phone.offhook"; 18 | public static final String INTENT_SERVICE_MEDIA = "com.solderbyte.openfit.service.media"; 19 | public static final String INTENT_SERVICE_WEATHER = "com.solderbyte.openfit.service.weather"; 20 | public static final String INTENT_SERVICE_LOCATION = "com.solderbyte.openfit.service.location"; 21 | public static final String INTENT_SERVICE_CRONJOB = "com.solderbyte.openfit.service.cronjob"; 22 | public static final String INTENT_NOTIFICATION = "com.solderbyte.openfit.notification"; 23 | public static final String INTENT_ANDROID_SMS = "android.provider.Telephony.SMS_RECEIVED"; 24 | public static final String INTENT_REJECTMESSAGES_SAVE = "com.solderbyte.openfit.service.rejectmessages.save"; 25 | public static final String INTENT_ANDROID_MMS = "android.provider.Telephony.WAP_PUSH_RECEIVED"; 26 | public static final String INTENT_GOOGLE_FIT = "com.solderbyte.openfit.google.fit"; 27 | public static final String INTENT_GOOGLE_FIT_SYNC = "com.solderbyte.openfit.google.fit.sync"; 28 | public static final String INTENT_GOOGLE_FIT_SYNC_STATUS = "com.solderbyte.openfit.google.fit.sync.status"; 29 | public static final String INTENT_BILLING = "com.solderbyte.openfit.billing"; 30 | public static final String INTENT_BILLING_VERIFIED = "com.solderbyte.openfit.billing.verified"; 31 | public static final String INTENT_BILLING_NO_PURCHASE = "com.solderbyte.openfit.billing.nopurchase"; 32 | public static final String INTENT_SERVICE_CALENDAR = "com.android.calendar"; 33 | public static final String INTENT_MEDIACONTROLLER_METHOD = "com.solderbyte.openfit.mediacontroller.method"; 34 | 35 | public static final String INTENT_EXTRA_MSG = "message"; 36 | public static final String INTENT_EXTRA_DATA = "data"; 37 | public static final String INTENT_EXTRA_INFO = "info"; 38 | 39 | public static final String ACTION_ENABLE = "enable"; 40 | public static final String ACTION_DISABLE = "disable"; 41 | public static final String ACTION_TRUE = "true"; 42 | public static final String ACTION_FALSE = "false"; 43 | public static final String ACTION_SCAN = "scan"; 44 | public static final String ACTION_SET_DEVICE = "setDevice"; 45 | public static final String ACTION_SET_ENTRIES = "setEntries"; 46 | public static final String ACTION_GPS = "gps"; 47 | public static final String ACTION_CONNECT = "connect"; 48 | public static final String ACTION_DISCONNECT = "disconnect"; 49 | public static final String ACTION_UI_STATUS = "status"; 50 | public static final String ACTION_PHONE = "phone"; 51 | public static final String ACTION_SMS = "sms"; 52 | public static final String ACTION_TIME = "time"; 53 | public static final String ACTION_WEATHER = "weather"; 54 | public static final String ACTION_FITNESS = "fitness"; 55 | 56 | public static final String DEFAULT = "DEFAULT"; 57 | public static final String NONE = "none"; 58 | public static final String EXTRA_DEVICE_NAME = "deviceName"; 59 | public static final String EXTRA_DEVICE_ADDRESS = "deviceName"; 60 | public static final String EXTRA_PACKAGE_NAME = "packageName"; 61 | public static final String EXTRA_REJECT_MESSAGES = "rejectMessages"; 62 | public static final String EXTRA_APP_NAME = "appName"; 63 | public static final String EXTRA_SMS = "sms"; 64 | public static final String EXTRA_GPS = "gps"; 65 | public static final String EXTRA_PHONE = "phone"; 66 | public static final String EXTRA_TIME = "time"; 67 | public static final String EXTRA_WEATHER = "weather"; 68 | public static final String EXTRA_WEATHER_ENTRY = "weatherEntry"; 69 | public static final String EXTRA_WEATHER_VALUE = "weatherValue"; 70 | public static final String EXTRA_FITNESS = "fitness"; 71 | public static final String EXTRA_IS_ENABLED = "isEnabled"; 72 | public static final String EXTRA_IS_ENABLED_FAILED = "isEnabledFailed"; 73 | public static final String EXTRA_IS_CONNECTED = "isConnected"; 74 | public static final String EXTRA_IS_DISCONNCTED = "isDisconnected"; 75 | public static final String EXTRA_IS_CONNECTED_FAILED = "isConnectedFailed"; 76 | public static final String EXTRA_IS_CONNECTED_RFCOMM = "isConnectedRfcomm"; 77 | public static final String EXTRA_IS_DISCONNECTED_RFCOMM = "isDisconnectedRfComm"; 78 | public static final String EXTRA_IS_CONNECTED_RFCOMM_FAILED = "isConnectedRfcommFailed"; 79 | public static final String EXTRA_SCAN_STOPPED = "scanStopped"; 80 | public static final String EXTRA_BLUETOOTH = "bluetooth"; 81 | public static final String EXTRA_BLUETOOTH_DATA = "bluetoothData"; 82 | public static final String EXTRA_BLUETOOTH_DEVICE = "bluetoothDevice"; 83 | public static final String EXTRA_BLUETOOTH_DEVICE_LIST = "bluetoothDevicesList"; 84 | public static final String EXTRA_BLUETOOTH_ENTRIES = "bluetoothEntries"; 85 | public static final String EXTRA_BLUETOOTH_ENTRIES_VALUES = "bluetoothEntryValues"; 86 | public static final String EXTRA_PEDOMETER_TOTAL = "pedometerTotal"; 87 | public static final String EXTRA_PEDOMETER_LIST = "pedometerArrayList"; 88 | public static final String EXTRA_PEDOMETER_DAILY_LIST = "pedometerDailyArrayList"; 89 | public static final String EXTRA_EXERCISE_LIST = "exerciseDataList"; 90 | public static final String EXTRA_SLEEP_LIST = "sleepList"; 91 | public static final String EXTRA_SLEEP_INFO_LIST = "sleepInfoList"; 92 | public static final String EXTRA_HEARTRATE_LIST = "heartRateList"; 93 | public static final String EXTRA_PROFILE_DATA = "profileData"; 94 | public static final String EXTRA_APPLICATIONS = "applications"; 95 | public static final String EXTRA_APPLICATIONS_PACKAGE_NAME = "packageName"; 96 | public static final String EXTRA_APPLICATIONS_APP_NAME = "appName"; 97 | } 98 | -------------------------------------------------------------------------------- /app/src/main/res/values-fr/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Open Fit 4 | Open Fit 5 | Ajouter une application 6 | Supprimer une application 7 | Aide 8 | Ajouter une application 9 | Fermer 10 | Supprimer une application 11 | Fermer 12 | Aide Open Fit 13 | Messages de rejet d\'appel 14 | Fermer 15 | Enregistrer 16 | Message 17 | Fermer 18 | Fitness 19 | Fermer 20 | Sync 21 | Nouveautés Open Fit 22 | Fermer 23 | Connectivité 24 | Activer le Bluetooth 25 | Scan d\'une Gear Fit 26 | Scan Bluetooth 27 | Lancer le scan 28 | Scan en cours… Veuillez patienter 29 | Afficher les périphériques 30 | Sélectionner la Gear Fit 31 | Sélectionner la Gear Fit 32 | Etat de connexion 33 | Connecté 34 | Déconnecté 35 | Aucun 36 | Périphérique 37 | SMS 38 | Appels téléphoniques 39 | Rejet d\'appel 40 | Editer la liste des messages de rejet 41 | Format de l\'heure 42 | 24 heures 43 | 12 heures 44 | Mise à jour météo 45 | Format de l\'affichage 46 | Sélectionner une option 47 | Aucune mise à jour 48 | Fitness 49 | Fitness 50 | Requête des données Fitness 51 | Synchro Google Fit 52 | Synchro activée 53 | Synchro désactivée 54 | GPS 55 | GPS utilisé pour les exercices 56 | Utiliser le GPS pour les exercices 57 | Applications 58 | Open Fit 59 | Lancement auto au démarrage 60 | Lancer automatiquement OpenFit après un redémarrage 61 | Don 62 | Faire un don via PayPal 63 | Open Fit Premium 64 | Acheter les fonctions Premium. Voir l\'aide pour plus d\'informations. 65 | Merci d\'avoir acheté Open Fit Premium 66 | Pas d\'applications ajoutées. Cliquez sur l\'icône + en haut du menu pour ajouter une application. Vérifiez que l\'accès aux Notifications est activé, sinon les notifications ne fonctionneront pas. 67 | Activation… 68 | Scan en cours… 69 | Scan terminé. Veuillez sélectionner un périphérique. 70 | Tentative de connexion à : 71 | Accès aux données fitness… 72 | Bluetooth activé 73 | Échec d\'activation du Bluetooth 74 | Gear Fit connectée 75 | Gear Fit déconnectée 76 | Échec de connexion à la Gear Fit 77 | Échec de connexion à la Gear Fit 78 | Connection à Google Fit 79 | Déconnection de Google Fit 80 | Synchronisation avec Google Fit… 81 | Synchro terminée 82 | Echec de la synchro 83 | La synchro Google Fit est une fonctionnalité premium. Merci d\'acheter Open Fit premium 84 | Merci pour l\'achat d\'Open Fit Premium. Veuillez fermer et redémarrer Open Fit. 85 | Open Fit 86 | Connecté à la Gear Fit 87 | Déconnecté de la Gear Fit 88 | Connexion 89 | Déconnexion 90 | Arrêter 91 | Synchro avec Google Fit.\nCela peut prendre jusqu\'à 5 minutes 92 | SMS envoyé 93 | Echec de l\'envoi du SMS 94 | 95 | --------------------------------------------------------------------------------