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

[Feature Request]: Android Auto Integration #232

Open
3 tasks done
shadycloud opened this issue Oct 15, 2023 · 4 comments
Open
3 tasks done

[Feature Request]: Android Auto Integration #232

shadycloud opened this issue Oct 15, 2023 · 4 comments

Comments

@shadycloud
Copy link

Guidelines

  • I have searched the issue tracker for open and closed issues that are similar to the feature request I want to file, without success.
  • I have searched the documentation for information that matches the description of the feature request I want to file, without success.
  • This issue contains only one feature request.

Problem Description

No ability to control this app using Android auto.

Proposed Solution

Android auto integration for play/pause, search, sub, etc.

Alternatives Considered

NA

Issue Labels

ease of use improvement, new feature, support for external software, visual improvement

Additional Information

No response

@shadycloud
Copy link
Author

Learning how Android Auto & Cordova works,

To 'Add support for Android Auto to your app', 'Declare Android Auto support'

The Android Auto host checks whether the app has declared support for Android Auto. To enable this support, include the following entry in your app's manifest:

<application>
    ...
    <meta-data
        android:name="com.google.android.gms.car.application"
        android:resource="@xml/automotive_app_desc"/>
    ...
</application>

https://developer.android.com/training/cars/apps/auto#declare-android-auto-support

https://stackoverflow.com/questions/40446058/cordova-change-androidmanifest-using-config-xml-file

cloud@cloud:~/Downloads/FreeTubeCordova/src/cordova$ cat config.xml

    <edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application" xmlns:android="http://schemas.android.com/apk/res/android">
      <application android:usesCleartextTraffic="true" />
    </edit-config>

@shadycloud
Copy link
Author

shadycloud commented Oct 20, 2023

Mark your app as a video app

To indicate that your app supports video, add an XML file named automotive_app_desc.xml to the res/xml/ directory in your project. In this file, include the following content:

<automotiveApp>
  <uses name="video"/>
</automotiveApp>

Then, within the element of your manifest, add the following element referencing the XML file:

<meta-data
  android:name="com.android.automotive"
  android:resource="@xml/automotive_app_desc"/>

The more I learn about the differences in cordova to a typical droid app, the more I question if this is even possible...

Related question: https://www.reddit.com/r/androiddev/comments/10jxkwd/cordova_are_there_any_plugins_available_for/
More related: capacitor-community/proposals#94

@MarmadileManteater
Copy link
Owner

<metadata
  android:name="com.android.automotive"
  android:resource="@xml/automotive_app_desc"/>

This looks like this might go in the config.xml in the section you pointed out earlier. The other xml file, automotive_app_desc.xml seems like it would need to be added between when pack:cordova runs and run:cordova/build:cordova runs, so, completely speculating from the top of my head, it could likely be injected by ~/_scripts/CordovaPlugin.js.

Admittedly, this would probably be easier if the project were to switch from Cordova to Capacitor (#101) which is more inline with the DX of a typical android app.

@MarmadileManteater
Copy link
Owner

The development branch has now switched away from Cordova. The android studio project is located in the android directory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants