├── settings.gradle ├── app ├── src │ └── main │ │ ├── res │ │ ├── raw │ │ │ ├── beep.mp3 │ │ │ └── beepquiet.mp3 │ │ ├── drawable-hdpi │ │ │ ├── ok.png │ │ │ ├── clean.png │ │ │ ├── nbarlogo.png │ │ │ └── ic_launcher.png │ │ ├── drawable-ldpi │ │ │ └── ic_launcher.png │ │ ├── drawable-mdpi │ │ │ └── ic_launcher.png │ │ ├── menu │ │ │ └── menu.xml │ │ ├── layout │ │ │ ├── main.xml │ │ │ ├── row.xml │ │ │ └── timer.xml │ │ ├── values │ │ │ ├── arrays.xml │ │ │ └── strings.xml │ │ └── xml │ │ │ └── preferences.xml │ │ ├── java │ │ └── nl │ │ │ └── ttys0 │ │ │ └── simplec25k │ │ │ ├── ServiceReceiver.java │ │ │ ├── MyPhoneStateListener.java │ │ │ ├── MyPreferenceActivity.java │ │ │ ├── WorkoutFileEditor.java │ │ │ ├── MyAlarmService.java │ │ │ ├── Simplec25kMainActivity.java │ │ │ ├── TimerActivity.java │ │ │ ├── CountdownChronometer.java │ │ │ └── ProgramService.java │ │ └── AndroidManifest.xml └── build.gradle ├── gradle └── wrapper │ └── gradle-wrapper.properties ├── .idea └── runConfigurations.xml ├── import-summary.txt ├── gradlew.bat ├── .gitignore └── gradlew /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | -------------------------------------------------------------------------------- /app/src/main/res/raw/beep.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/Simple-C25K/HEAD/app/src/main/res/raw/beep.mp3 -------------------------------------------------------------------------------- /app/src/main/res/raw/beepquiet.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/Simple-C25K/HEAD/app/src/main/res/raw/beepquiet.mp3 -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ok.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/Simple-C25K/HEAD/app/src/main/res/drawable-hdpi/ok.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/clean.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/Simple-C25K/HEAD/app/src/main/res/drawable-hdpi/clean.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/nbarlogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/Simple-C25K/HEAD/app/src/main/res/drawable-hdpi/nbarlogo.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/Simple-C25K/HEAD/app/src/main/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-ldpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/Simple-C25K/HEAD/app/src/main/res/drawable-ldpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Orbiter/Simple-C25K/HEAD/app/src/main/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/menu/menu.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Wed Mar 29 11:33:25 CEST 2017 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-3.3-all.zip 7 | -------------------------------------------------------------------------------- /app/src/main/res/layout/main.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | android { 3 | compileSdkVersion 23 4 | buildToolsVersion '25.0.2' 5 | 6 | defaultConfig { 7 | applicationId "nl.ttys0.simplec25k" 8 | minSdkVersion 14 9 | targetSdkVersion 15 10 | } 11 | 12 | buildTypes { 13 | release { 14 | minifyEnabled false 15 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' 16 | } 17 | } 18 | } 19 | 20 | dependencies { 21 | compile 'com.android.support:support-v4:26.0.0-alpha1' 22 | } -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/java/nl/ttys0/simplec25k/ServiceReceiver.java: -------------------------------------------------------------------------------- 1 | //http://www.tutorialforandroid.com/2009/01/get-phone-state-when-someone-is-calling_22.html 2 | package nl.ttys0.simplec25k; 3 | 4 | import android.content.BroadcastReceiver; 5 | import android.content.Context; 6 | import android.content.Intent; 7 | import android.telephony.PhoneStateListener; 8 | import android.telephony.TelephonyManager; 9 | 10 | public class ServiceReceiver extends BroadcastReceiver { 11 | 12 | @Override 13 | public void onReceive(Context context, Intent intent) { 14 | MyPhoneStateListener phoneListener = new MyPhoneStateListener(); 15 | TelephonyManager telephony = (TelephonyManager) context 16 | .getSystemService(Context.TELEPHONY_SERVICE); 17 | 18 | telephony.listen(phoneListener, PhoneStateListener.LISTEN_CALL_STATE); 19 | } 20 | } -------------------------------------------------------------------------------- /app/src/main/res/layout/row.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 16 | 17 | 22 | 23 | -------------------------------------------------------------------------------- /app/src/main/res/values/arrays.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 1% 6 | 5% 7 | 10% 8 | 20% 9 | 40% 10 | 60% 11 | 80% 12 | 100% 13 | 14 | 15 | 1 16 | 5 17 | 10 18 | 20 19 | 40 20 | 60 21 | 80 22 | 100 23 | 24 | 25 | 26 | full 27 | partial 28 | dim 29 | 30 | 31 | Full Wakelock 32 | Partial Wakelock 33 | Screen Dim Wakelock 34 | 35 | 36 | -------------------------------------------------------------------------------- /app/src/main/java/nl/ttys0/simplec25k/MyPhoneStateListener.java: -------------------------------------------------------------------------------- 1 | //http://www.tutorialforandroid.com/2009/01/get-phone-state-when-someone-is-calling_22.html 2 | 3 | package nl.ttys0.simplec25k; 4 | 5 | import android.content.Context; 6 | import android.content.Intent; 7 | import android.telephony.PhoneStateListener; 8 | import android.telephony.TelephonyManager; 9 | 10 | public class MyPhoneStateListener extends PhoneStateListener { 11 | protected static final String MY_ACTION = "MY_ACTION"; 12 | 13 | public void onCallStateChanged(int state, String incomingNumber) { 14 | switch (state) { 15 | case TelephonyManager.CALL_STATE_IDLE: 16 | // Log.d("DEBUG", "IDLE"); 17 | break; 18 | case TelephonyManager.CALL_STATE_OFFHOOK: 19 | // Log.d("DEBUG", "OFFHOOK"); 20 | break; 21 | case TelephonyManager.CALL_STATE_RINGING: 22 | // Log.d("DEBUG", "RINGING"); 23 | 24 | // setup intent for sending command 25 | Intent myIntent = new Intent(); 26 | myIntent.setAction(MY_ACTION); 27 | myIntent.putExtra("DATA_TO_PS", "PAUSE"); 28 | 29 | // send command 30 | Context context = TimerActivity.context; 31 | if (context != null) { 32 | context.sendBroadcast(myIntent); 33 | } 34 | 35 | // stop the countdown in the gui 36 | CountdownChronometer cc = TimerActivity.countdown; 37 | if (cc != null) { 38 | cc.stop(); 39 | } 40 | break; 41 | } 42 | } 43 | 44 | } -------------------------------------------------------------------------------- /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 | * .idea/ 11 | * .idea/.name 12 | * .idea/Simple-C25K.iml 13 | * .idea/compiler.xml 14 | * .idea/copyright/ 15 | * .idea/copyright/profiles_settings.xml 16 | * .idea/misc.xml 17 | * .idea/modules.xml 18 | * .idea/vcs.xml 19 | * .idea/workspace.xml 20 | * Android_Description 21 | * README 22 | * artwork/ 23 | * artwork/SimpleC25K_icon.png 24 | * artwork/SimpleC25K_icon.xcf 25 | * artwork/SimpleC25K_icon_512x512.png 26 | * artwork/nBarSmallLogo.xcf 27 | * proguard.cfg 28 | 29 | Moved Files: 30 | ------------ 31 | Android Gradle projects use a different directory structure than ADT 32 | Eclipse projects. Here's how the projects were restructured: 33 | 34 | * AndroidManifest.xml => app/src/main/AndroidManifest.xml 35 | * res/ => app/src/main/res/ 36 | * src/ => app/src/main/java/ 37 | 38 | Next Steps: 39 | ----------- 40 | You can now build the project. The Gradle project needs network 41 | connectivity to download dependencies. 42 | 43 | Bugs: 44 | ----- 45 | If for some reason your project does not build, and you determine that 46 | it is due to a bug or limitation of the Eclipse to Gradle importer, 47 | please file a bug at http://b.android.com with category 48 | Component-Tools. 49 | 50 | (This import summary is for your information only, and can be deleted 51 | after import once you are satisfied with the results.) 52 | -------------------------------------------------------------------------------- /app/src/main/java/nl/ttys0/simplec25k/MyPreferenceActivity.java: -------------------------------------------------------------------------------- 1 | package nl.ttys0.simplec25k; 2 | 3 | import android.content.SharedPreferences; 4 | import android.media.MediaPlayer; 5 | import android.os.Bundle; 6 | import android.preference.Preference; 7 | import android.preference.Preference.OnPreferenceClickListener; 8 | import android.preference.PreferenceActivity; 9 | import android.preference.PreferenceManager; 10 | import android.view.Menu; 11 | import nl.ttys0.simplec25k.R; 12 | 13 | public class MyPreferenceActivity extends PreferenceActivity { 14 | 15 | @Override 16 | public void onCreate(Bundle savedInstanceState) { 17 | // Toast.makeText(this, "wham", Toast.LENGTH_LONG).show(); 18 | super.onCreate(savedInstanceState); 19 | addPreferencesFromResource(R.xml.preferences); 20 | 21 | Preference customPref = (Preference) findPreference("test_volume"); 22 | customPref 23 | .setOnPreferenceClickListener(new OnPreferenceClickListener() { 24 | 25 | public boolean onPreferenceClick(Preference preference) { 26 | playSound(); 27 | return true; 28 | } 29 | 30 | }); 31 | } 32 | 33 | @Override 34 | public boolean onCreateOptionsMenu(Menu menu) { 35 | menu.add(Menu.NONE, 0, 0, "Show current settings"); 36 | return super.onCreateOptionsMenu(menu); 37 | } 38 | 39 | public void playSound() { 40 | SharedPreferences sharedPrefs = PreferenceManager 41 | .getDefaultSharedPreferences(this); 42 | float mediaSoundVolume = (float) (Integer.parseInt(sharedPrefs 43 | .getString("volume_percentage", "40")) / 100f); 44 | boolean mediaSoundBool = sharedPrefs.getBoolean("enable_sound", true); 45 | MediaPlayer mp = MediaPlayer.create(MyPreferenceActivity.this, 46 | R.raw.beep); 47 | if (mp != null && mediaSoundBool) { 48 | mp.setVolume(mediaSoundVolume, mediaSoundVolume); 49 | mp.start(); 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /app/src/main/java/nl/ttys0/simplec25k/WorkoutFileEditor.java: -------------------------------------------------------------------------------- 1 | package nl.ttys0.simplec25k; 2 | 3 | import java.io.FileInputStream; 4 | import java.io.FileOutputStream; 5 | import java.io.IOException; 6 | import java.io.InputStreamReader; 7 | import java.io.OutputStreamWriter; 8 | 9 | import android.content.Context; 10 | import android.widget.Toast; 11 | 12 | public class WorkoutFileEditor { 13 | private static Context context; 14 | 15 | public WorkoutFileEditor(Context context) { 16 | 17 | WorkoutFileEditor.context = context; 18 | } 19 | 20 | public String ReadSettings(String fileName) { 21 | FileInputStream fIn = null; 22 | InputStreamReader isr = null; 23 | 24 | char[] inputBuffer = new char[1000]; 25 | String data = null; 26 | 27 | try { 28 | fIn = context.openFileInput(fileName); 29 | isr = new InputStreamReader(fIn); 30 | isr.read(inputBuffer); 31 | data = new String(inputBuffer); 32 | } catch (Exception e) { 33 | e.printStackTrace(); 34 | Toast.makeText(context, "Settings not read", Toast.LENGTH_SHORT) 35 | .show(); 36 | } finally { 37 | try { 38 | isr.close(); 39 | fIn.close(); 40 | } catch (IOException e) { 41 | e.printStackTrace(); 42 | } 43 | } 44 | return data; 45 | } 46 | 47 | public void WriteSettings(String fileName, String data, int mode) { 48 | 49 | FileOutputStream fOut = null; 50 | OutputStreamWriter osw = null; 51 | 52 | try { 53 | fOut = context.openFileOutput(fileName, mode); 54 | osw = new OutputStreamWriter(fOut); 55 | osw.write(data); 56 | osw.flush(); 57 | } catch (Exception e) { 58 | 59 | Toast.makeText(context, "Can't save changes. WTF?", 60 | Toast.LENGTH_SHORT).show(); 61 | e.printStackTrace(); 62 | } finally { 63 | try { 64 | osw.close(); 65 | fOut.close(); 66 | } catch (IOException e) { 67 | e.printStackTrace(); 68 | } 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Hello World, ListViewDynamicActivity! 5 | Simple C25K 6 | ok_icon 7 | Credits:\n\nVoice-over: Cynthia Ross\nDeveloper: Roel Blaauwgeers 8 | 9 | Brisk five-minute warmup walk. Then alternate 60 seconds of jogging and 90 seconds of walking for a total of 20 minutes. 10 | Brisk five-minute warmup walk. Then alternate 90 seconds of jogging and 2 minutes of walking for a total of 20 minutes. 11 | Brisk five-minute warmup walk. Then do two repetitions of the following:\n- Jog 90 seconds\n- Walk 90 seconds\n- Jog 3 minutes\n- Walk 3 minutes 12 | Brisk five-minute warmup walk. Then:\n- Jog 3 minutes\n- Walk 90 seconds\n- Jog 5 minutes\n- Walk 2½ minutes\n- Jog 3 minutes\n- Walk 90 seconds\n- Jog 5 minutes 13 | Brisk five-minute warmup walk, then:\n- Jog 5 minutes\n- Walk 3 minutes\n- Jog 5 minutes\n- Walk 3 minutes\n- Jog 5 minutes 14 | Brisk five-minute warmup walk, then:\n- Jog 8 minutes\n- Walk 5 minutes\n- Jog 8 minutes 15 | Brisk five-minute warmup walk, then jog 20 minutes with no walking. 16 | Brisk five-minute warmup walk, then:\n- Jog 5 minutes\n- Walk 3 minutes\n- Jog 8 minutes\n- Walk 3 minutes\n- Jog 5 minutes 17 | Brisk five-minute warmup walk, then:\n- Jog 10 minutes\n- Walk 3 minutes\n- Jog 10 minutes 18 | Brisk five-minute warmup walk, then jog 22 minutes with no walking. 19 | Brisk five-minute warmup walk, then jog 25 minutes. 20 | Brisk five-minute warmup walk, then jog 28 minutes. 21 | Brisk five-minute warmup walk, then jog 30 minutes. 22 | 23 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 9 | 10 | 11 | 12 | 13 | 14 | 17 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 32 | 33 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /app/src/main/res/xml/preferences.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 15 | 16 | 26 | 32 | 38 | 39 | 40 | 41 | 44 | 51 | 52 | 53 | 56 | 57 | 58 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /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/nl/ttys0/simplec25k/MyAlarmService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * MyAlarmService.java 3 | * 4 | * Copyright 2012 Roel Blaauwgeers 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | * info: 20 | * This Class is used for setting an alarm. When the alarm goes off a message 21 | * (MESSAGE) will be send to the notification bar. 22 | */ 23 | 24 | package nl.ttys0.simplec25k; 25 | 26 | import android.app.Service; 27 | import android.content.Context; 28 | import android.content.Intent; 29 | import android.content.SharedPreferences; 30 | import android.media.MediaPlayer; 31 | import android.os.IBinder; 32 | import android.os.Vibrator; 33 | import android.preference.PreferenceManager; 34 | 35 | public class MyAlarmService extends Service { 36 | 37 | protected static final String MY_ACTION = "MY_ACTION"; 38 | public static String message; 39 | 40 | private SharedPreferences sharedPrefs; 41 | private boolean mediaSoundBool; 42 | private boolean vibrateBool; 43 | private float mediaSoundVolume; 44 | 45 | 46 | @Override 47 | public void onCreate() { 48 | // Stop the service 49 | // to prevent random alerts after this service has run. 50 | this.stopSelf(); 51 | } 52 | 53 | @Override 54 | public IBinder onBind(Intent intent) { 55 | 56 | return null; 57 | 58 | } 59 | 60 | @Override 61 | public void onDestroy() { 62 | 63 | super.onDestroy(); 64 | 65 | } 66 | 67 | @Override 68 | public void onStart(Intent intent, int startId) { 69 | 70 | super.onStart(intent, startId); 71 | 72 | // retrieve workout info 73 | // message = intent.getStringExtra("MESSAGE"); 74 | 75 | sharedPrefs = PreferenceManager.getDefaultSharedPreferences(this); 76 | 77 | 78 | mediaSoundVolume = (float)(Integer.parseInt(sharedPrefs.getString("volume_percentage","40"))/100f); 79 | mediaSoundBool= sharedPrefs.getBoolean("enable_sound", true); 80 | MediaPlayer mp = MediaPlayer 81 | .create(MyAlarmService.this, R.raw.beep); 82 | if(mp!=null && mediaSoundBool){ 83 | mp.setVolume(mediaSoundVolume, mediaSoundVolume); 84 | mp.start(); 85 | } 86 | 87 | // let the user know we're done 88 | // setup vibrator 89 | vibrateBool = sharedPrefs.getBoolean("enable_vibrations", true); 90 | if(vibrateBool){ 91 | Vibrator v = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE); 92 | long[] pat = { 0, 700, 400 }; 93 | v.vibrate(pat, -1); 94 | } 95 | 96 | } 97 | 98 | @Override 99 | public boolean onUnbind(Intent intent) { 100 | 101 | return super.onUnbind(intent); 102 | 103 | } 104 | 105 | } 106 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Created by https://www.gitignore.io/api/android,androidstudio 2 | 3 | ### Android ### 4 | # Built application files 5 | *.apk 6 | *.ap_ 7 | 8 | # Files for the ART/Dalvik VM 9 | *.dex 10 | 11 | # Java class files 12 | *.class 13 | 14 | # Generated files 15 | bin/ 16 | gen/ 17 | out/ 18 | 19 | # Gradle files 20 | .gradle/ 21 | build/ 22 | 23 | # Local configuration file (sdk path, etc) 24 | local.properties 25 | 26 | # Proguard folder generated by Eclipse 27 | proguard/ 28 | 29 | # Log Files 30 | *.log 31 | 32 | # Android Studio Navigation editor temp files 33 | .navigation/ 34 | 35 | # Android Studio captures folder 36 | captures/ 37 | 38 | # Intellij 39 | *.iml 40 | .idea/workspace.xml 41 | .idea/tasks.xml 42 | .idea/gradle.xml 43 | .idea/dictionaries 44 | .idea/libraries 45 | 46 | # Keystore files 47 | *.jks 48 | 49 | # External native build folder generated in Android Studio 2.2 and later 50 | .externalNativeBuild 51 | 52 | # Google Services (e.g. APIs or Firebase) 53 | google-services.json 54 | 55 | # Freeline 56 | freeline.py 57 | freeline/ 58 | freeline_project_description.json 59 | 60 | ### Android Patch ### 61 | gen-external-apklibs 62 | 63 | ### AndroidStudio ### 64 | # Covers files to be ignored for android development using Android Studio. 65 | 66 | # Built application files 67 | 68 | # Files for the ART/Dalvik VM 69 | 70 | # Java class files 71 | 72 | # Generated files 73 | 74 | # Gradle files 75 | .gradle 76 | 77 | # Signing files 78 | .signing/ 79 | 80 | # Local configuration file (sdk path, etc) 81 | 82 | # Proguard folder generated by Eclipse 83 | 84 | # Log Files 85 | 86 | # Android Studio 87 | /*/build/ 88 | /*/local.properties 89 | /*/out 90 | /*/*/build 91 | /*/*/production 92 | *.ipr 93 | *~ 94 | *.swp 95 | 96 | # Android Patch 97 | 98 | # External native build folder generated in Android Studio 2.2 and later 99 | 100 | # NDK 101 | obj/ 102 | 103 | # IntelliJ IDEA 104 | *.iws 105 | /out/ 106 | 107 | # User-specific configurations 108 | .idea/libraries/ 109 | .idea/.name 110 | .idea/compiler.xml 111 | .idea/copyright/profiles_settings.xml 112 | .idea/encodings.xml 113 | .idea/misc.xml 114 | .idea/modules.xml 115 | .idea/scopes/scope_settings.xml 116 | .idea/vcs.xml 117 | .idea/jsLibraryMappings.xml 118 | .idea/datasources.xml 119 | .idea/dataSources.ids 120 | .idea/sqlDataSources.xml 121 | .idea/dynamic.xml 122 | .idea/uiDesigner.xml 123 | 124 | # Keystore files 125 | 126 | # OS-specific files 127 | .DS_Store 128 | .DS_Store? 129 | ._* 130 | .Spotlight-V100 131 | .Trashes 132 | ehthumbs.db 133 | Thumbs.db 134 | 135 | # Legacy Eclipse project files 136 | .classpath 137 | .project 138 | 139 | # Mobile Tools for Java (J2ME) 140 | .mtj.tmp/ 141 | 142 | # Package Files # 143 | *.jar 144 | *.war 145 | *.ear 146 | 147 | # virtual machine crash logs (Reference: http://www.java.com/en/download/help/error_hotspot.xml) 148 | hs_err_pid* 149 | 150 | ## Plugin-specific files: 151 | 152 | # mpeltonen/sbt-idea plugin 153 | .idea_modules/ 154 | 155 | # JIRA plugin 156 | atlassian-ide-plugin.xml 157 | 158 | # Mongo Explorer plugin 159 | .idea/mongoSettings.xml 160 | 161 | # Crashlytics plugin (for Android Studio and IntelliJ) 162 | com_crashlytics_export_strings.xml 163 | crashlytics.properties 164 | crashlytics-build.properties 165 | fabric.properties 166 | 167 | # End of https://www.gitignore.io/api/android,androidstudio 168 | -------------------------------------------------------------------------------- /app/src/main/res/layout/timer.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 15 | 16 | 24 | 25 | 33 | 34 | 35 | 36 |