Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .idea/.name

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/AndroidProjectSystem.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions .idea/deploymentTargetSelector.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/kotlinc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions .idea/migrations.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions .idea/runConfigurations.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ android {
}

dependencies {

implementation(libs.androidx.core.ktx)
implementation(libs.androidx.appcompat)
implementation(libs.material)
Expand Down
16 changes: 16 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">

<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PLAYBACK" />
<uses-permission android:name="android.permission.READ_MEDIA_AUDIO"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />

<application
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
Expand All @@ -12,6 +18,12 @@
android:supportsRtl="true"
android:theme="@style/Theme.BCSD_Android_20251"
tools:targetApi="31">
<receiver android:name=".LocalChangeReceiver" android:exported="false">
<intent-filter>
<action android:name="PLAYING_MUSIC"/>
</intent-filter>
</receiver>

<activity
android:name=".MainActivity"
android:exported="true">
Expand All @@ -21,6 +33,10 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<service
android:name=".MusicService"
android:foregroundServiceType="mediaPlayback"
android:exported="false"/>
</application>

</manifest>
6 changes: 6 additions & 0 deletions app/src/main/java/com/example/bcsd_android_2025_1/ListData.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package com.example.bcsd_android_2025_1

import android.net.Uri

data class ListData(val musicUri: Uri, val albumImgUri: Long, val title:String, val name:String, val time:Long)

Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package com.example.bcsd_android_2025_1

import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent

class LocalChangeReceiver: BroadcastReceiver() {
override fun onReceive(context: Context?, intent: Intent?) {
val title = intent?.getStringExtra(MusicService.TITLE_KEY) ?: R.string.default_title

val toMainIntent = Intent(MainActivity.MAIN_RECEIVER_ACTION)
toMainIntent.putExtra(MusicService.TITLE_KEY, title)
toMainIntent.setPackage("com.example.bcsd_android_2025_1")
context?.sendBroadcast(toMainIntent)
}
}
Loading