Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Android Auto Support #2891

Merged
merged 2 commits into from
Nov 9, 2024
Merged

Improve Android Auto Support #2891

merged 2 commits into from
Nov 9, 2024

Conversation

ahmedre
Copy link
Contributor

@ahmedre ahmedre commented Oct 6, 2024

This patch builds on #2648, and makes a few changes - namely:

  • support for vanilla Android Auto (not just Android Auto OS)
  • shared code between vanilla Android Auto and Android Auto OS

The "vanilla Android auto" ships with the APK and is available on devices that use Android auto on the phone. The "autoquran" one is based on the "autoquran" target (instead of app) and is a completely separate apk for Android Auto OS devices.

@ahmedre ahmedre changed the title feature/base auto quran Updated Android Auto Support 🚗 #2648 Oct 6, 2024
@ahmedre ahmedre changed the title Updated Android Auto Support 🚗 #2648 Updated Android Auto Support Oct 6, 2024
@ahmedre
Copy link
Contributor Author

ahmedre commented Oct 6, 2024

cc @jibraniqbal666 please take a look.

some notes - on both of our branches, audio doesn't play back for me in the Android Auto OS version.
I also haven't successfully made it run on vanilla Android Auto yet (the icon shows up, but when I launch, nothing happens - need to check since it might be fixed with these recent changes)

Copy link

github-actions bot commented Oct 6, 2024

OLD: app-madani-debug.apk (signature: V1, V2)
NEW: app-madani-debug.apk (signature: V1, V2)

          │            compressed             │           uncompressed            
          ├───────────┬───────────┬───────────┼───────────┬───────────┬───────────
 APK      │ old       │ new       │ diff      │ old       │ new       │ diff      
──────────┼───────────┼───────────┼───────────┼───────────┼───────────┼───────────
      dex │  21.2 MiB │  21.2 MiB │ +11.1 KiB │  67.9 MiB │    68 MiB │ +23.5 KiB 
     arsc │   2.3 MiB │   2.3 MiB │     +90 B │   2.3 MiB │   2.3 MiB │     +88 B 
 manifest │   5.6 KiB │   5.7 KiB │    +162 B │    27 KiB │  27.7 KiB │    +792 B 
      res │   1.6 MiB │   1.6 MiB │    +264 B │   1.8 MiB │   1.8 MiB │    +240 B 
   native │  18.8 KiB │  18.8 KiB │       0 B │  36.5 KiB │  36.5 KiB │       0 B 
    asset │ 404.2 KiB │ 404.2 KiB │       0 B │ 678.6 KiB │ 678.6 KiB │       0 B 
    other │ 191.9 KiB │   192 KiB │     +80 B │   394 KiB │ 394.2 KiB │    +206 B 
──────────┼───────────┼───────────┼───────────┼───────────┼───────────┼───────────
    total │  25.7 MiB │  25.7 MiB │ +11.7 KiB │  73.1 MiB │  73.1 MiB │ +24.8 KiB 

Copy link

github-actions bot commented Oct 6, 2024

New Dependencies
project :feature:autoquran

@ahmedre
Copy link
Contributor Author

ahmedre commented Oct 6, 2024

tested - notes:

  • on Android Auto (not Android Auto OS), the boxes don't have a background color so they're kind of dull looking, unlike the nice screenshots from Android Auto OS
  • audio playback doesn't work yet (actual Android Auto, and emulator for Android Auto OS) - it seems like we need to implement audio attributes and/or handle ducking, etc, since, I noticed that if I try to do something (ex ok google), it'll actually play a tiny bit of the sura while it transitions it in and out.

@ahmedre
Copy link
Contributor Author

ahmedre commented Oct 6, 2024

Blockers

  • fix audio playback

Nice to Have

  • support setting a Qari from settings (or use the default qari) instead of just the first 2 qaris
  • play the file back from the local file system if it's downloaded instead of always getting it from the web
  • make the ui nicer on Android Auto (perhaps copy what's in Android Auto OS of the auto-coloring of boxes)

@ahmedre ahmedre changed the title Updated Android Auto Support Improve Android Auto Support Oct 6, 2024
Copy link

github-actions bot commented Oct 6, 2024

OLD: app-madani-debug.apk (signature: V1, V2)
NEW: app-madani-debug.apk (signature: V1, V2)

          │            compressed             │           uncompressed            
          ├───────────┬───────────┬───────────┼───────────┬───────────┬───────────
 APK      │ old       │ new       │ diff      │ old       │ new       │ diff      
──────────┼───────────┼───────────┼───────────┼───────────┼───────────┼───────────
      dex │  21.2 MiB │  21.2 MiB │   +11 KiB │  67.9 MiB │    68 MiB │ +23.4 KiB 
     arsc │   2.3 MiB │   2.3 MiB │     +90 B │   2.3 MiB │   2.3 MiB │     +88 B 
 manifest │   5.6 KiB │   5.7 KiB │    +162 B │    27 KiB │  27.7 KiB │    +792 B 
      res │   1.6 MiB │   1.6 MiB │    +268 B │   1.8 MiB │   1.8 MiB │    +240 B 
   native │  18.8 KiB │  18.8 KiB │       0 B │  36.5 KiB │  36.5 KiB │       0 B 
    asset │ 404.2 KiB │ 404.2 KiB │       0 B │ 678.6 KiB │ 678.6 KiB │       0 B 
    other │ 191.9 KiB │   192 KiB │     +73 B │   394 KiB │ 394.2 KiB │    +206 B 
──────────┼───────────┼───────────┼───────────┼───────────┼───────────┼───────────
    total │  25.7 MiB │  25.7 MiB │ +11.6 KiB │  73.1 MiB │  73.1 MiB │ +24.7 KiB 

Copy link

github-actions bot commented Oct 6, 2024

New Dependencies
project :feature:autoquran

@jibraniqbal666
Copy link

jibraniqbal666 commented Oct 6, 2024

tested - notes:

  • on Android Auto (not Android Auto OS), the boxes don't have a background color so they're kind of dull looking, unlike the nice screenshots from Android Auto OS
  • audio playback doesn't work yet (actual Android Auto, and emulator for Android Auto OS) - it seems like we need to implement audio attributes and/or handle ducking, etc, since, I noticed that if I try to do something (ex ok google), it'll actually play a tiny bit of the sura while it transitions it in and out.

How did you debug the normal Android Auto? Is there emulator? I would like to fix these issue :)))

@jibraniqbal666
Copy link

cc @jibraniqbal666 please take a look.

some notes - on both of our branches, audio doesn't play back for me in the Android Auto OS version. I also haven't successfully made it run on vanilla Android Auto yet (the icon shows up, but when I launch, nothing happens - need to check since it might be fixed with these recent changes)

Which emulator are you using for Android Auto OS, or is it real device?

@ahmedre
Copy link
Contributor Author

ahmedre commented Oct 7, 2024

I actually have an Android Auto device so I was able to test on a real device - however, I was planning on testing the emulator also for vanilla Android auto - I found this - tldr you launch the Android Auto OS emulator, and then you launch a vanilla Android emulator and install Android Auto on it and connect them.

Copy link

github-actions bot commented Oct 7, 2024

OLD: app-madani-debug.apk (signature: V1, V2)
NEW: app-madani-debug.apk (signature: V1, V2)

          │            compressed             │           uncompressed            
          ├───────────┬───────────┬───────────┼───────────┬───────────┬───────────
 APK      │ old       │ new       │ diff      │ old       │ new       │ diff      
──────────┼───────────┼───────────┼───────────┼───────────┼───────────┼───────────
      dex │  21.2 MiB │  21.2 MiB │   +11 KiB │  67.9 MiB │    68 MiB │ +23.4 KiB 
     arsc │   2.3 MiB │   2.3 MiB │     +90 B │   2.3 MiB │   2.3 MiB │     +88 B 
 manifest │   5.6 KiB │   5.7 KiB │    +162 B │    27 KiB │  27.7 KiB │    +792 B 
      res │   1.6 MiB │   1.6 MiB │    +268 B │   1.8 MiB │   1.8 MiB │    +240 B 
   native │  18.8 KiB │  18.8 KiB │       0 B │  36.5 KiB │  36.5 KiB │       0 B 
    asset │ 404.2 KiB │ 404.2 KiB │       0 B │ 678.6 KiB │ 678.6 KiB │       0 B 
    other │ 191.9 KiB │   192 KiB │     +72 B │   394 KiB │ 394.2 KiB │    +206 B 
──────────┼───────────┼───────────┼───────────┼───────────┼───────────┼───────────
    total │  25.7 MiB │  25.7 MiB │ +11.6 KiB │  73.1 MiB │  73.1 MiB │ +24.7 KiB 

Copy link

github-actions bot commented Oct 7, 2024

New Dependencies
project :feature:autoquran

Copy link

github-actions bot commented Nov 2, 2024

OLD: app-madani-debug.apk (signature: V1, V2)
NEW: app-madani-debug.apk (signature: V1, V2)

          │            compressed             │           uncompressed            
          ├───────────┬───────────┬───────────┼───────────┬───────────┬───────────
 APK      │ old       │ new       │ diff      │ old       │ new       │ diff      
──────────┼───────────┼───────────┼───────────┼───────────┼───────────┼───────────
      dex │  21.3 MiB │  21.3 MiB │ +23.2 KiB │  68.1 MiB │  68.1 MiB │ +54.4 KiB 
     arsc │   2.3 MiB │   2.3 MiB │  -2.3 KiB │   2.3 MiB │   2.3 MiB │  -2.3 KiB 
 manifest │   5.6 KiB │   5.7 KiB │    +159 B │    27 KiB │  27.7 KiB │    +792 B 
      res │   1.6 MiB │   1.6 MiB │   -22 KiB │   1.8 MiB │   1.8 MiB │ -15.9 KiB 
   native │  18.8 KiB │  18.8 KiB │       0 B │  36.5 KiB │  36.5 KiB │       0 B 
    asset │ 404.2 KiB │ 404.2 KiB │       0 B │ 678.6 KiB │ 678.6 KiB │       0 B 
    other │ 195.9 KiB │ 193.6 KiB │  -2.3 KiB │ 404.5 KiB │ 396.3 KiB │  -8.1 KiB 
──────────┼───────────┼───────────┼───────────┼───────────┼───────────┼───────────
    total │  25.7 MiB │  25.7 MiB │  -3.2 KiB │  73.2 MiB │  73.3 MiB │ +28.9 KiB 

Copy link

github-actions bot commented Nov 2, 2024

New Dependencies
project :feature:autoquran

Upgraded Dependencies
androidx.core:core:1.15.0, (changed from 1.13.1)
androidx.core:core-ktx:1.15.0, (changed from 1.13.1)

Copy link

github-actions bot commented Nov 7, 2024

OLD: app-madani-debug.apk (signature: V1, V2)
NEW: app-madani-debug.apk (signature: V1, V2)

          │            compressed             │           uncompressed            
          ├───────────┬───────────┬───────────┼───────────┬───────────┬───────────
 APK      │ old       │ new       │ diff      │ old       │ new       │ diff      
──────────┼───────────┼───────────┼───────────┼───────────┼───────────┼───────────
      dex │  21.3 MiB │  21.3 MiB │ +23.2 KiB │  68.1 MiB │  68.1 MiB │ +54.4 KiB 
     arsc │   2.3 MiB │   2.3 MiB │  -2.3 KiB │   2.3 MiB │   2.3 MiB │  -2.3 KiB 
 manifest │   5.6 KiB │   5.7 KiB │    +159 B │    27 KiB │  27.7 KiB │    +792 B 
      res │   1.6 MiB │   1.6 MiB │   -22 KiB │   1.8 MiB │   1.8 MiB │ -15.9 KiB 
   native │  18.8 KiB │  18.8 KiB │       0 B │  36.5 KiB │  36.5 KiB │       0 B 
    asset │ 404.2 KiB │ 404.2 KiB │       0 B │ 678.6 KiB │ 678.6 KiB │       0 B 
    other │ 195.9 KiB │ 193.6 KiB │  -2.3 KiB │ 404.5 KiB │ 396.3 KiB │  -8.1 KiB 
──────────┼───────────┼───────────┼───────────┼───────────┼───────────┼───────────
    total │  25.7 MiB │  25.7 MiB │  -3.2 KiB │  73.2 MiB │  73.3 MiB │ +28.9 KiB 

Copy link

github-actions bot commented Nov 7, 2024

New Dependencies
project :feature:autoquran

Upgraded Dependencies
androidx.core:core:1.15.0, (changed from 1.13.1)
androidx.core:core-ktx:1.15.0, (changed from 1.13.1)

@ahmedre
Copy link
Contributor Author

ahmedre commented Nov 9, 2024

Al7amdulillah, I just migrated the auto stuff to media3, which simplifies a lot of things - it does a lot of the ordinary things for us (handling playback, pause, updating the time, next, previous, ... - things you were doing manually before). This one I tested using the method from the Stackoverflow post linked above for testing and it works (whereas the version before that didn't work) - and this one also works on an actual Android Auto device.

It doesn't show the grid view anymore, but can take a look at that in the future in sha' Allah. Presumably, I think I can also make it support all the Qaris in an efficient way in sha' Allah, but need to give it a shot.

I also didn't test the standalone Android Automotive app yet, but not really too concerned about that one since I am more interested in Android Auto support (anyone with an Android phone + a device that supports Android Auto + the Android Auto app) rather than Android Automotive support (a completely separate app, needs an Android Automotive device, etc).

For what it's worth, I am ok adding Exoplayer, since I've wanted to migrate to Exoplayer instead of MediaPlayer for some time (even had a local branch from a long time ago doing so), so I think moving forward, in sha' Allah, some of this stuff can actually replace some of the existing app audio service stuff as well in sha' Allah.

Copy link

github-actions bot commented Nov 9, 2024

OLD: app-madani-debug.apk (signature: V1, V2)
NEW: app-madani-debug.apk (signature: V1, V2)

          │             compressed             │            uncompressed            
          ├───────────┬───────────┬────────────┼───────────┬───────────┬────────────
 APK      │ old       │ new       │ diff       │ old       │ new       │ diff       
──────────┼───────────┼───────────┼────────────┼───────────┼───────────┼────────────
      dex │  21.3 MiB │  24.2 MiB │   +2.9 MiB │  68.1 MiB │  74.9 MiB │   +6.8 MiB 
     arsc │   2.3 MiB │   2.7 MiB │ +451.5 KiB │   2.3 MiB │   2.7 MiB │ +451.5 KiB 
 manifest │   5.6 KiB │   5.8 KiB │     +201 B │    27 KiB │    28 KiB │     +1 KiB 
      res │   1.6 MiB │     2 MiB │ +433.9 KiB │   1.8 MiB │   2.2 MiB │ +383.1 KiB 
   native │  18.8 KiB │  18.8 KiB │        0 B │  36.5 KiB │  36.5 KiB │        0 B 
    asset │ 404.2 KiB │ 404.2 KiB │        0 B │ 678.6 KiB │ 678.6 KiB │        0 B 
    other │ 195.9 KiB │ 258.7 KiB │  +62.8 KiB │ 404.5 KiB │ 579.8 KiB │ +175.4 KiB 
──────────┼───────────┼───────────┼────────────┼───────────┼───────────┼────────────
    total │  25.7 MiB │  29.6 MiB │   +3.8 MiB │  73.2 MiB │    81 MiB │   +7.8 MiB 

Copy link

github-actions bot commented Nov 9, 2024

New Dependencies
androidx.exifinterface:exifinterface:1.3.6
androidx.media3:media3-common:1.4.1
androidx.media3:media3-container:1.4.1
androidx.media3:media3-database:1.4.1
androidx.media3:media3-datasource:1.4.1
androidx.media3:media3-decoder:1.4.1
androidx.media3:media3-exoplayer:1.4.1
androidx.media3:media3-exoplayer-dash:1.4.1
androidx.media3:media3-extractor:1.4.1
androidx.media3:media3-session:1.4.1
androidx.media3:media3-ui:1.4.1
com.google.guava:failureaccess:1.0.2
com.google.guava:guava:33.0.0-android
project :feature:autoquran

Upgraded Dependencies
androidx.core:core:1.15.0, (changed from 1.13.1)
androidx.core:core-ktx:1.15.0, (changed from 1.13.1)
com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava, (changed from 1.0)

@ahmedre ahmedre added this pull request to the merge queue Nov 9, 2024
Merged via the queue into main with commit 2080039 Nov 9, 2024
2 checks passed
@ahmedre ahmedre deleted the feature/base-auto-quran branch November 9, 2024 22:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants