├── app ├── .gitignore ├── src │ ├── main │ │ ├── res │ │ │ ├── values │ │ │ │ ├── dimens.xml │ │ │ │ ├── colors.xml │ │ │ │ ├── strings.xml │ │ │ │ └── styles.xml │ │ │ ├── mipmap-hdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-mdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxxhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── anim │ │ │ │ ├── bottom_in.xml │ │ │ │ └── bottom_out.xml │ │ │ ├── drawable │ │ │ │ ├── ic_play_white.xml │ │ │ │ ├── ic_stop_white.xml │ │ │ │ ├── ic_play_arrow_black.xml │ │ │ │ ├── ic_pause_white.xml │ │ │ │ └── ic_pause_black.xml │ │ │ ├── layout │ │ │ │ ├── list_item.xml │ │ │ │ ├── activity_main.xml │ │ │ │ └── content_main.xml │ │ │ ├── menu │ │ │ │ └── menu_main.xml │ │ │ └── raw │ │ │ │ └── shoutcasts.json │ │ ├── java │ │ │ └── com │ │ │ │ └── mcakir │ │ │ │ └── radio │ │ │ │ ├── player │ │ │ │ ├── PlaybackStatus.java │ │ │ │ ├── RadioManager.java │ │ │ │ ├── MediaNotificationManager.java │ │ │ │ └── RadioService.java │ │ │ │ ├── util │ │ │ │ ├── Shoutcast.java │ │ │ │ ├── ShoutcastHelper.java │ │ │ │ └── ShoutcastListAdapter.java │ │ │ │ └── MainActivity.java │ │ └── AndroidManifest.xml │ ├── test │ │ └── java │ │ │ └── com │ │ │ └── mcakir │ │ │ └── radio │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── com │ │ └── mcakir │ │ └── radio │ │ └── ExampleInstrumentedTest.java ├── proguard-rules.pro └── build.gradle ├── settings.gradle ├── screenshot ├── home.png ├── lockscreen.png └── notification.png ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── .gitignore ├── README.md ├── gradle.properties ├── gradlew.bat └── gradlew /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | -------------------------------------------------------------------------------- /screenshot/home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/m-cakir/radio-player/HEAD/screenshot/home.png -------------------------------------------------------------------------------- /screenshot/lockscreen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/m-cakir/radio-player/HEAD/screenshot/lockscreen.png -------------------------------------------------------------------------------- /app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 16dp 3 | 4 | -------------------------------------------------------------------------------- /screenshot/notification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/m-cakir/radio-player/HEAD/screenshot/notification.png -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/m-cakir/radio-player/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea 5 | .DS_Store 6 | /build 7 | /captures 8 | .externalNativeBuild 9 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/m-cakir/radio-player/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/m-cakir/radio-player/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/m-cakir/radio-player/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/m-cakir/radio-player/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/m-cakir/radio-player/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3F51B5 4 | #303F9F 5 | #FF4081 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/anim/bottom_in.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/anim/bottom_out.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 9 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Tue Jul 10 12:36:06 EET 2018 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.4-all.zip 7 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | RadioPlayer 3 | Settings 4 | 5 | Radio station couldn\'t stream! 6 | On Air 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_play_white.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_stop_white.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_play_arrow_black.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_pause_white.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/layout/list_item.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_pause_black.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Radio Player 2 | Radio station streaming example with ExoPlayer. 3 | 4 | # Screenshots 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/menu/menu_main.xml: -------------------------------------------------------------------------------- 1 | 5 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/test/java/com/mcakir/radio/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.mcakir.radio; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * @see Testing documentation 11 | */ 12 | public class ExampleUnitTest { 13 | @Test 14 | public void addition_isCorrect() throws Exception { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } -------------------------------------------------------------------------------- /app/src/main/java/com/mcakir/radio/player/PlaybackStatus.java: -------------------------------------------------------------------------------- 1 | package com.mcakir.radio.player; 2 | 3 | public class PlaybackStatus { 4 | 5 | public static final String IDLE = "PlaybackStatus_IDLE"; 6 | 7 | public static final String LOADING = "PlaybackStatus_LOADING"; 8 | 9 | public static final String PLAYING = "PlaybackStatus_PLAYING"; 10 | 11 | public static final String PAUSED = "PlaybackStatus_PAUSED"; 12 | 13 | public static final String STOPPED = "PlaybackStatus_STOPPED"; 14 | 15 | public static final String ERROR = "PlaybackStatus_ERROR"; 16 | 17 | } -------------------------------------------------------------------------------- /app/src/main/java/com/mcakir/radio/util/Shoutcast.java: -------------------------------------------------------------------------------- 1 | package com.mcakir.radio.util; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | 5 | public class Shoutcast { 6 | 7 | private String name; 8 | 9 | @SerializedName("stream") 10 | private String url; 11 | 12 | public String getName() { 13 | return name; 14 | } 15 | 16 | public void setName(String name) { 17 | this.name = name; 18 | } 19 | 20 | public String getUrl() { 21 | return url; 22 | } 23 | 24 | public void setUrl(String url) { 25 | this.url = url; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /app/src/main/java/com/mcakir/radio/util/ShoutcastHelper.java: -------------------------------------------------------------------------------- 1 | package com.mcakir.radio.util; 2 | 3 | import android.content.Context; 4 | 5 | import com.google.gson.Gson; 6 | import com.google.gson.reflect.TypeToken; 7 | import com.mcakir.radio.R; 8 | 9 | import java.io.InputStreamReader; 10 | import java.io.Reader; 11 | import java.util.ArrayList; 12 | import java.util.List; 13 | 14 | public class ShoutcastHelper { 15 | 16 | public static List retrieveShoutcasts(Context context){ 17 | 18 | Reader reader = new InputStreamReader(context.getResources().openRawResource(R.raw.shoutcasts)); 19 | 20 | return (new Gson()).fromJson(reader, new TypeToken>() {}.getType()); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 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 | org.gradle.jvmargs=-Xmx1536m 13 | 14 | # When configured, Gradle will run in incubating parallel mode. 15 | # This option should only be used with decoupled projects. More details, visit 16 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 17 | # org.gradle.parallel=true 18 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 15 | 16 |