├── .idea ├── .name ├── copyright │ └── profiles_settings.xml ├── scopes │ └── scope_settings.xml ├── encodings.xml ├── vcs.xml ├── modules.xml ├── misc.xml ├── gradle.xml └── compiler.xml ├── app ├── .gitignore ├── libs │ ├── spotifysdk-1.0.0-beta8.aar │ └── spotify-web-api-android-all-0.1.0.jar ├── src │ ├── main │ │ ├── res │ │ │ ├── drawable-hdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── drawable-mdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── drawable-xhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── drawable-xxhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── values-v21 │ │ │ │ └── styles.xml │ │ │ ├── values │ │ │ │ ├── styles.xml │ │ │ │ ├── dimens.xml │ │ │ │ ├── variables.xml │ │ │ │ └── strings.xml │ │ │ ├── layout │ │ │ │ ├── playlist_row.xml │ │ │ │ ├── activity_player.xml │ │ │ │ └── activity_main.xml │ │ │ ├── menu │ │ │ │ └── main.xml │ │ │ └── values-w820dp │ │ │ │ └── dimens.xml │ │ ├── java │ │ │ └── com │ │ │ │ └── proloser │ │ │ │ └── spotifypractice │ │ │ │ ├── AlarmReceiver.java │ │ │ │ ├── VolumeRunnable.java │ │ │ │ ├── AlarmPlayer.java │ │ │ │ └── MainActivity.java │ │ └── AndroidManifest.xml │ └── androidTest │ │ └── java │ │ └── com │ │ └── proloser │ │ └── spotifypractice │ │ └── ApplicationTest.java ├── proguard-rules.pro ├── build.gradle └── app.iml ├── settings.gradle ├── .floo ├── .flooignore ├── .gitignore ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── SpotifyPractice.iml ├── gradle.properties ├── gradlew.bat └── gradlew /.idea/.name: -------------------------------------------------------------------------------- 1 | Spotify Practice -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | -------------------------------------------------------------------------------- /.floo: -------------------------------------------------------------------------------- 1 | { 2 | "url": "https://floobits.com/ProLoser/Sandbox" 3 | } -------------------------------------------------------------------------------- /.flooignore: -------------------------------------------------------------------------------- 1 | extern 2 | node_modules 3 | tmp 4 | vendor 5 | .idea/workspace.xml 6 | .idea/misc.xml 7 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .gradle 2 | /local.properties 3 | /.idea/workspace.xml 4 | /.idea/libraries 5 | .DS_Store 6 | /build 7 | -------------------------------------------------------------------------------- /.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ProLoser/Wake-Me-Up-android/master/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /app/libs/spotifysdk-1.0.0-beta8.aar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ProLoser/Wake-Me-Up-android/master/app/libs/spotifysdk-1.0.0-beta8.aar -------------------------------------------------------------------------------- /app/libs/spotify-web-api-android-all-0.1.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ProLoser/Wake-Me-Up-android/master/app/libs/spotify-web-api-android-all-0.1.0.jar -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ProLoser/Wake-Me-Up-android/master/app/src/main/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ProLoser/Wake-Me-Up-android/master/app/src/main/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ProLoser/Wake-Me-Up-android/master/app/src/main/res/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ProLoser/Wake-Me-Up-android/master/app/src/main/res/drawable-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /.idea/scopes/scope_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/values-v21/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16dp 4 | 16dp 5 | 6 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Mon Mar 16 23:57:26 PDT 2015 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/layout/playlist_row.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/menu/main.xml: -------------------------------------------------------------------------------- 1 | 4 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/values/variables.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 4 | 12 5 | 0 6 | 60 7 | spotify:user:spotify:playlist:63dDpdoVHvx5RkK87g4LKk 8 | -------------------------------------------------------------------------------- /app/src/main/res/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 64dp 6 | 7 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Spotify Practice 5 | Hello world! 6 | Playlist URI 7 | Volume Ramp Time: 8 | Volume: 9 | Settings 10 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/androidTest/java/com/proloser/spotifypractice/ApplicationTest.java: -------------------------------------------------------------------------------- 1 | package com.proloser.spotifypractice; 2 | 3 | import android.app.Application; 4 | import android.test.ApplicationTestCase; 5 | 6 | /** 7 | * Testing Fundamentals 8 | */ 9 | public class ApplicationTest extends ApplicationTestCase { 10 | public ApplicationTest() { 11 | super(Application.class); 12 | } 13 | } -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /Applications/Android Studio.app/sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /SpotifyPractice.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Settings specified in this file will override any Gradle settings 5 | # configured through the IDE. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true -------------------------------------------------------------------------------- /app/src/main/java/com/proloser/spotifypractice/AlarmReceiver.java: -------------------------------------------------------------------------------- 1 | package com.proloser.spotifypractice; 2 | 3 | import android.content.BroadcastReceiver; 4 | import android.content.Context; 5 | import android.content.Intent; 6 | import android.util.Log; 7 | import android.widget.Toast; 8 | 9 | public class AlarmReceiver extends BroadcastReceiver { 10 | 11 | @Override 12 | public void onReceive(Context context, Intent intent) { 13 | if (intent.getAction().equals("android.intent.action.BOOT_COMPLETED")) { 14 | // Set the alarm here. 15 | } else { 16 | Intent startAlarm = new Intent(context, AlarmPlayer.class); 17 | startAlarm.putExtras(intent); 18 | context.startActivity(startAlarm); 19 | 20 | Log.d("AlarmReceiver", "Alarm triggered"); 21 | Toast.makeText(context, "Alarm triggered", Toast.LENGTH_SHORT).show(); 22 | } 23 | } 24 | 25 | } -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 21 5 | buildToolsVersion "21" 6 | 7 | defaultConfig { 8 | applicationId "com.proloser.spotifypractice" 9 | minSdkVersion 14 10 | targetSdkVersion 21 11 | versionCode 1 12 | versionName "1.0" 13 | } 14 | buildTypes { 15 | release { 16 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 17 | } 18 | } 19 | } 20 | 21 | repositories { 22 | mavenCentral() 23 | flatDir { 24 | dirs 'libs' 25 | } 26 | } 27 | 28 | dependencies { 29 | compile fileTree(dir: 'libs', include: ['*.jar']) 30 | compile 'com.spotify.sdk:spotifysdk:1.0.0-beta8@aar' 31 | // NOTE: Version must match! 32 | // All other dependencies for your app should also be here: 33 | compile 'com.android.support:appcompat-v7:21.0.3' 34 | compile files('libs/spotify-web-api-android-all-0.1.0.jar') 35 | } -------------------------------------------------------------------------------- /app/src/main/java/com/proloser/spotifypractice/VolumeRunnable.java: -------------------------------------------------------------------------------- 1 | package com.proloser.spotifypractice; 2 | 3 | import android.media.AudioManager; 4 | import android.os.Handler; 5 | import android.util.Log; 6 | 7 | /** 8 | * Created by dean on 3/17/15. 9 | */ 10 | public class VolumeRunnable implements Runnable{ 11 | 12 | private AudioManager mAudioManager; 13 | private Handler mHandlerThatWillIncreaseVolume; 14 | private int incrementDelay; 15 | private int maxVolume; 16 | VolumeRunnable(AudioManager audioManager, Handler handler, int duration, int maxVolume){ 17 | this.mAudioManager = audioManager; 18 | this.mHandlerThatWillIncreaseVolume = handler; 19 | this.maxVolume = maxVolume; // = mAudioManager.getStreamVolume(AudioManager.STREAM_ALARM); 20 | this.incrementDelay = duration / maxVolume; 21 | mAudioManager.setStreamVolume(AudioManager.STREAM_MUSIC, 0, 0); 22 | } 23 | 24 | @Override 25 | public void run(){ 26 | int currentAlarmVolume = mAudioManager.getStreamVolume(AudioManager.STREAM_MUSIC); 27 | if (currentAlarmVolume < maxVolume) { 28 | mAudioManager.adjustStreamVolume(AudioManager.STREAM_MUSIC, AudioManager.ADJUST_RAISE, 0); 29 | 30 | Log.d("VolumeRunnable", "Volume increased: " + currentAlarmVolume + " of " + maxVolume); 31 | mHandlerThatWillIncreaseVolume.postDelayed(this, incrementDelay); // recursively call this runnable again with delay 32 | } 33 | 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 13 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 25 | 26 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_player.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 |