DJDoubleD / refreezer

An alternative Deezer music streaming & downloading client, based on Freezer.
GNU General Public License v3.0
221 stars 5 forks source link

Fix Android Auto Homepage and PlayItem Handling. #7

Closed bw8686 closed 2 months ago

bw8686 commented 2 months ago

Pretty self explanitory. Here's a before and after.

Before: desktop-head-unit_PYXHYcyV2t After: desktop-head-unit_ebL7z0DDAB

DJDoubleD commented 2 months ago

Thank you for your PR btw, I hadn't tested Android Auto before, so I expected some bugs. Would you mind sharing the AVD image / DHU version / android auto app version you are using to debug the app on the DHU? I keep running into the problem that the Android Auto app isn't compatible with the x86_64 image/device...

bw8686 commented 2 months ago

Thank you for your PR btw, I hadn't tested Android Auto before, so I expected some bugs. Would you mind sharing the AVD image / DHU version / android auto app version you are using to debug the app on the DHU? I keep running into the problem that the Android Auto app isn't compatible with the x86_64 image/device...

I'm just using whatever is the latest in android studio.

DJDoubleD commented 2 months ago

I'm just using whatever is the latest in android studio.

Would you mind elaborating on that please? I'm also using the latest DHU from Android Studio. Could you tell me which virtual device (e.g. Pixel 3a ...) you used in combination with which Android version (E.g API 34)? Or did you use a physical device to debug on and connect to the DHU?

bw8686 commented 2 months ago

I used my phone (google pixel 6 pro) to connect to DHU my phone runs android 14 or API 34.

DJDoubleD commented 2 months ago

I used my phone (google pixel 6 pro) to connect to DHU my phone runs android 14 or API 34.

Thank you for the information.

I was trying to get the entire chain working with virtual devices and I finally found a set-up that works. As it might be helpful for you and others as well, when wanting to test/debug without using a physical device, this is the combination that works for me:

  1. Have these SDK tools installed: image

  2. Created a AVD using the Pixel 3 with Play Store template (constrained by current hardware...): image

  3. Selected the Android 13 Google Play image (started with this, other versions might work the same) image

  4. Booted the AVD, logged in with my test gmail, skipped all the set-up and disabled automatic updates in the play store.

  5. Downloaded and installed the latest x86_64 Android Auto apk (currently https://www.apkmirror.com/apk/google-inc/android-auto/android-auto-12-4-6428-release/android-auto-12-4-642818-release-android-apk-download/) And installed it through adb:

    adb install "<APK Download Path>\com.google.android.projection.gearhead_12.4.642818-release-124642818_minAPI26(x86_64)(nodpi)_apkmirror.com.apk"
  6. Started ReFreezer in debug mode (in my case from VsCode)

  7. Activated Developer Mode in the device (7 taps on build number)

  8. Activated Developer Mode in Android Auto

    • Settings => Connection Preferences => Android Auto => 7 taps on "Version"
  9. In Android Auto changed the following Developer Settings (access through the 3 dots, top right):

    • Wireless Android Auto => checked
    • Application Mode => Developer
    • Unknown Sources => checked
  10. (Optional I think) Checked in "Customise Launcher" for Android Auto that ReFreezer was listed and checked

  11. Started the Head Unit Server from Android Auto menu (access through the 3 dots, top right).

  12. Forward the server port in adb:

    adb forward tcp:5277 tcp:5277
  13. Start the DHU:

    <AndroidSDK Path>\extras\google\auto>desktop-head-unit
  14. The DHU should start and connect to the running AVD. Just followed the on screen instruction to grant the requested permissions and start ReFreezer from DHU launcher:

image

Debugging works through both virtual devices.