├── .idea ├── .name ├── copyright │ └── profiles_settings.xml ├── vcs.xml ├── modules.xml ├── gradle.xml ├── compiler.xml └── misc.xml ├── settings.gradle ├── Screenshots ├── 7inches.png ├── App_off.png ├── App_on.png ├── appIcon.png ├── AppBanner.png ├── AppBanner.xcf ├── blueicon.xcf ├── PlayControls.png ├── blueicon_512.png ├── small_banner.png ├── App_off_thumb.png └── device-2015-02-24.png ├── ReleaseBuild └── BlueSound.apk ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── app ├── src │ └── main │ │ ├── res │ │ ├── drawable-hdpi │ │ │ ├── ic_audio_on.png │ │ │ ├── ic_launcher.png │ │ │ └── ic_audio_off.png │ │ ├── drawable-mdpi │ │ │ ├── ic_audio_on.png │ │ │ ├── ic_launcher.png │ │ │ └── ic_audio_off.png │ │ ├── drawable-xhdpi │ │ │ ├── ic_audio_off.png │ │ │ ├── ic_audio_on.png │ │ │ └── ic_launcher.png │ │ ├── drawable-xxhdpi │ │ │ ├── ic_audio_on.png │ │ │ ├── ic_launcher.png │ │ │ └── ic_audio_off.png │ │ ├── values-v14 │ │ │ ├── dimens.xml │ │ │ └── styles.xml │ │ ├── layout │ │ │ ├── control_widget.xml │ │ │ └── activity_main.xml │ │ ├── values-v11 │ │ │ └── styles.xml │ │ ├── values-w820dp │ │ │ └── dimens.xml │ │ ├── menu │ │ │ └── main.xml │ │ ├── xml │ │ │ └── control_widget_info.xml │ │ ├── values │ │ │ ├── dimens.xml │ │ │ ├── strings.xml │ │ │ ├── colors.xml │ │ │ └── styles.xml │ │ └── values-es │ │ │ └── strings.xml │ │ ├── java │ │ └── com │ │ │ └── soyblue │ │ │ └── bluesound │ │ │ ├── BlueToggleReceiver.java │ │ │ ├── BluetoothManager.java │ │ │ ├── BlueService.java │ │ │ ├── ControlWidget.java │ │ │ └── MainActivity.java │ │ └── AndroidManifest.xml ├── build.gradle └── app.iml ├── .gitignore ├── README.md ├── BlueSound.iml ├── LICENSE ├── gradlew.bat ├── import-summary.txt └── gradlew /.idea/.name: -------------------------------------------------------------------------------- 1 | BlueSound -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | -------------------------------------------------------------------------------- /Screenshots/7inches.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soynerdito/BlueSound/HEAD/Screenshots/7inches.png -------------------------------------------------------------------------------- /Screenshots/App_off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soynerdito/BlueSound/HEAD/Screenshots/App_off.png -------------------------------------------------------------------------------- /Screenshots/App_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soynerdito/BlueSound/HEAD/Screenshots/App_on.png -------------------------------------------------------------------------------- /Screenshots/appIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soynerdito/BlueSound/HEAD/Screenshots/appIcon.png -------------------------------------------------------------------------------- /ReleaseBuild/BlueSound.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soynerdito/BlueSound/HEAD/ReleaseBuild/BlueSound.apk -------------------------------------------------------------------------------- /Screenshots/AppBanner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soynerdito/BlueSound/HEAD/Screenshots/AppBanner.png -------------------------------------------------------------------------------- /Screenshots/AppBanner.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soynerdito/BlueSound/HEAD/Screenshots/AppBanner.xcf -------------------------------------------------------------------------------- /Screenshots/blueicon.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soynerdito/BlueSound/HEAD/Screenshots/blueicon.xcf -------------------------------------------------------------------------------- /Screenshots/PlayControls.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soynerdito/BlueSound/HEAD/Screenshots/PlayControls.png -------------------------------------------------------------------------------- /Screenshots/blueicon_512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soynerdito/BlueSound/HEAD/Screenshots/blueicon_512.png -------------------------------------------------------------------------------- /Screenshots/small_banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soynerdito/BlueSound/HEAD/Screenshots/small_banner.png -------------------------------------------------------------------------------- /Screenshots/App_off_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soynerdito/BlueSound/HEAD/Screenshots/App_off_thumb.png -------------------------------------------------------------------------------- /.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /Screenshots/device-2015-02-24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soynerdito/BlueSound/HEAD/Screenshots/device-2015-02-24.png -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soynerdito/BlueSound/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_audio_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soynerdito/BlueSound/HEAD/app/src/main/res/drawable-hdpi/ic_audio_on.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soynerdito/BlueSound/HEAD/app/src/main/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_audio_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soynerdito/BlueSound/HEAD/app/src/main/res/drawable-mdpi/ic_audio_on.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soynerdito/BlueSound/HEAD/app/src/main/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_audio_off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soynerdito/BlueSound/HEAD/app/src/main/res/drawable-hdpi/ic_audio_off.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_audio_off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soynerdito/BlueSound/HEAD/app/src/main/res/drawable-mdpi/ic_audio_off.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_audio_off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soynerdito/BlueSound/HEAD/app/src/main/res/drawable-xhdpi/ic_audio_off.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_audio_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soynerdito/BlueSound/HEAD/app/src/main/res/drawable-xhdpi/ic_audio_on.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soynerdito/BlueSound/HEAD/app/src/main/res/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_audio_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soynerdito/BlueSound/HEAD/app/src/main/res/drawable-xxhdpi/ic_audio_on.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soynerdito/BlueSound/HEAD/app/src/main/res/drawable-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_audio_off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soynerdito/BlueSound/HEAD/app/src/main/res/drawable-xxhdpi/ic_audio_off.png -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Wed Apr 10 15:27:10 PDT 2013 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-2.2.1-all.zip 7 | -------------------------------------------------------------------------------- /app/src/main/res/values-v14/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 0dp 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/layout/control_widget.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/values-v11/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 64dp 9 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/values-v14/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/menu/main.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/xml/control_widget_info.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 16dp 5 | 16dp 6 | 7 | 11 | 8dp 12 | 13 | 14 | -------------------------------------------------------------------------------- /app/src/main/java/com/soyblue/bluesound/BlueToggleReceiver.java: -------------------------------------------------------------------------------- 1 | package com.soyblue.bluesound; 2 | 3 | import android.content.BroadcastReceiver; 4 | import android.content.Context; 5 | import android.content.Intent; 6 | 7 | public class BlueToggleReceiver extends BroadcastReceiver { 8 | public BlueToggleReceiver() { 9 | } 10 | 11 | @Override 12 | public void onReceive(Context context, Intent intent) { 13 | BluetoothManager.getInstance().toggleAudioStatus(context); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Blue Mono Sound 5 | Settings 6 | No ads just crappy mono sound redirect 7 | Cannot connect to bluetooth 8 | Play audio first then click the big button! 9 | Blue Widget 10 | Add widget 11 | 12 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 21 5 | buildToolsVersion "22.0.1" 6 | 7 | defaultConfig { 8 | applicationId "com.soyblue.bluesound" 9 | minSdkVersion 10 10 | targetSdkVersion 21 11 | } 12 | 13 | buildTypes { 14 | release { 15 | minifyEnabled false 16 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' 17 | } 18 | } 19 | } 20 | 21 | dependencies { 22 | compile 'com.android.support:appcompat-v7:21.0.3' 23 | } 24 | -------------------------------------------------------------------------------- /app/src/main/res/values-es/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Sonido Mono Azul 4 | Configuracion 5 | Sin anuncios, solo baja calidad de audio mono 6 | No se pudo conectar a Bluetooth 7 | Tocar audio primero y luego presionar boton! 8 | Incluir Widget 9 | Widget Azul 10 | 11 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 17 | 18 | -------------------------------------------------------------------------------- /.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 | lib/*android-support-v4.jar 11 | 12 | # Generated files 13 | bin/ 14 | gen/ 15 | 16 | # Gradle files 17 | .gradle/ 18 | build/ 19 | 20 | #Eclise 21 | lint.xml 22 | proguard-project.txt 23 | project.properties 24 | 25 | # Local configuration file (sdk path, etc) 26 | local.properties 27 | 28 | # Proguard folder generated by Eclipse 29 | proguard/ 30 | 31 | # Log Files 32 | *.log 33 | 34 | .gradle 35 | /local.properties 36 | /.idea/workspace.xml 37 | /.idea/libraries 38 | .DS_Store 39 | /build 40 | 41 | <<<<<<< HEAD 42 | 43 | ======= 44 | >>>>>>> 82f1109f92708b29f863f042df1dea771856ea7a 45 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #4CAF50 4 | #2E7D32 5 | #C8E6C9 6 | 7 | 8 | #4CAF50 9 | #388E3C 10 | #C8E6C9 11 | #CDDC39 12 | #212121 13 | #727272 14 | #FFFFFF 15 | #B6B6B6 16 | 17 | 18 | -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # BlueSound 2 | Android application to redirect audio to Bluetooth headset. Some Bluetooth enabled cars enable only voice to go over Bluetooth, but you may want to stream audio music. This app does just that. There are a lot of Android application in the market for this, but I failed to find one without ads so I wrote one. It is public on the Android Play store for Free to download. 3 | 4 | THIS APP IS FREE AS IN BEER!!!! No atribution, no nothing. Public Domain. Do what ever you want with it, I do not care. 5 | 6 | 7 | Android app on Google Play 9 | 10 | 11 | 12 | ScreenShots 13 | 14 | 15 | ![alt tag](https://raw.github.com/soynerdito/BlueSound/master/Screenshots/App_off_thumb.png) 16 | -------------------------------------------------------------------------------- /BlueSound.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 22 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 14 | 15 | 16 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | This is free and unencumbered software released into the public domain. 2 | 3 | Anyone is free to copy, modify, publish, use, compile, sell, or 4 | distribute this software, either in source code form or as a compiled 5 | binary, for any purpose, commercial or non-commercial, and by any 6 | means. 7 | 8 | In jurisdictions that recognize copyright laws, the author or authors 9 | of this software dedicate any and all copyright interest in the 10 | software to the public domain. We make this dedication for the benefit 11 | of the public at large and to the detriment of our heirs and 12 | successors. We intend this dedication to be an overt act of 13 | relinquishment in perpetuity of all present and future rights to this 14 | software under copyright law. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR 20 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 21 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | For more information, please refer to 25 | 26 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 10 | 11 | 12 | 13 | 14 | 15 | 20 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 39 | 40 | 41 | 44 | 45 | 46 | 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /app/src/main/java/com/soyblue/bluesound/BluetoothManager.java: -------------------------------------------------------------------------------- 1 | package com.soyblue.bluesound; 2 | 3 | import android.content.Context; 4 | import android.media.AudioManager; 5 | 6 | public final class BluetoothManager { 7 | private static BluetoothManager mInstance = null; 8 | //Remember the status of audio 9 | private boolean mAudioStatus = false; 10 | 11 | public static boolean power(boolean on) { 12 | return false; 13 | } 14 | 15 | public boolean getStatus(){ 16 | return mAudioStatus; 17 | } 18 | 19 | private BluetoothManager(){ 20 | 21 | } 22 | 23 | public static BluetoothManager getInstance(){ 24 | if( mInstance == null ){ 25 | mInstance = new BluetoothManager(); 26 | } 27 | return mInstance; 28 | } 29 | 30 | public boolean streamAudioStart(Context context) { 31 | try{ 32 | AudioManager localAudioManager = (AudioManager) context 33 | .getSystemService(Context.AUDIO_SERVICE); 34 | if( localAudioManager == null ){ return false; } 35 | localAudioManager.setMode(0); 36 | localAudioManager.setBluetoothScoOn(true); 37 | localAudioManager.startBluetoothSco(); 38 | localAudioManager.setMode(AudioManager.MODE_IN_COMMUNICATION); 39 | mAudioStatus = true; 40 | }catch( Exception ex){ 41 | System.out.println("Exception on Start " + ex.getMessage() ); 42 | mAudioStatus = false; 43 | return false; 44 | } 45 | 46 | return mAudioStatus; 47 | } 48 | 49 | public boolean streamAudioStop(Context context) { 50 | mAudioStatus = false; 51 | AudioManager localAudioManager = (AudioManager) context 52 | .getSystemService(Context.AUDIO_SERVICE); 53 | if( localAudioManager == null ){ return false; } 54 | localAudioManager.setBluetoothScoOn(false); 55 | localAudioManager.stopBluetoothSco(); 56 | localAudioManager.setMode(AudioManager.MODE_NORMAL); 57 | return true; 58 | } 59 | 60 | protected void toggleAudioStatus(Context context) { 61 | if ( getStatus()) { 62 | // Turn Audio Off 63 | streamAudioStop(context); 64 | } else { 65 | // Turn Audio ON 66 | streamAudioStart(context); 67 | } 68 | 69 | ControlWidget.requestWidgetUpdate( context ); 70 | } 71 | 72 | } 73 | -------------------------------------------------------------------------------- /app/src/main/java/com/soyblue/bluesound/BlueService.java: -------------------------------------------------------------------------------- 1 | package com.soyblue.bluesound; 2 | 3 | import android.app.IntentService; 4 | import android.content.Intent; 5 | import android.content.Context; 6 | 7 | /** 8 | * An {@link IntentService} subclass for handling asynchronous task requests in 9 | * a service on a separate handler thread. 10 | *

11 | * TODO: Customize class - update intent actions, extra parameters and static 12 | * helper methods. 13 | */ 14 | public class BlueService extends IntentService { 15 | // TODO: Rename actions, choose action names that describe tasks that this 16 | // IntentService can perform, e.g. ACTION_FETCH_NEW_ITEMS 17 | private static final String STATUS_UPDATE = "com.soyblue.bluesound.action.STATUS"; 18 | private static final String STATUS_ON = "com.soyblue.bluesound.extra.ON"; 19 | private static final String TOGGLE = "com.soyblue.bluesound.action.TOGGLE"; 20 | 21 | /** 22 | * Starts this service to perform action Foo with the given parameters. If 23 | * the service is already performing a task this action will be queued. 24 | * 25 | * @see IntentService 26 | */ 27 | // TODO: Customize helper method 28 | public static void startActionFoo(Context context, String param1, String param2) { 29 | Intent intent = new Intent(context, BlueService.class); 30 | intent.setAction(STATUS_UPDATE); 31 | intent.putExtra(STATUS_ON, 1); 32 | context.startService(intent); 33 | } 34 | 35 | public static Intent getToggleIntent( Context context ){ 36 | Intent intent = new Intent(context, BlueService.class); 37 | intent.setAction(TOGGLE); 38 | return intent; 39 | } 40 | 41 | public BlueService() { 42 | super("BlueService"); 43 | } 44 | 45 | @Override 46 | protected void onHandleIntent(Intent intent) { 47 | if (intent != null) { 48 | final String action = intent.getAction(); 49 | if (STATUS_UPDATE.equals(action)) { 50 | final boolean status = intent.getBooleanExtra(STATUS_ON, false); 51 | handleStatus(status); 52 | } else if (TOGGLE.equals(action)) { 53 | handleStatus(!BluetoothManager.getInstance().getStatus()); 54 | } 55 | } 56 | } 57 | 58 | /** 59 | * Request On/Off for bluetooth streamming 60 | */ 61 | private void handleStatus(boolean status) { 62 | if( status ){ 63 | BluetoothManager.getInstance().streamAudioStart(getApplicationContext()); 64 | }else{ 65 | BluetoothManager.getInstance().streamAudioStop(getApplicationContext()); 66 | } 67 | } 68 | 69 | } 70 | -------------------------------------------------------------------------------- /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/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 12 | 13 | 19 | 20 | 23 | 24 | 33 | 34 | 42 | 43 | 52 | 53 | 61 | 62 | 63 |