Android Question ANDROID-AUTO

Mr Blue Sky

Active Member
Licensed User
Longtime User
Hello everyone in the B4A community,

I'm developing an test app for Android Auto and I'm facing a few problem. My goal is to make the app viewable both on Android Auto and as a regular app on smartphones. Here is how I configured my manifest:

manifest:
AddManifestText(
<uses-sdk android:minSdkVersion="23" android:targetSdkVersion="33"/>
<supports-screens android:largeScreens="true"
    android:normalScreens="true"
    android:smallScreens="true"
    android:anyDensity="true"/>
   
<application
    android:allowBackup="true"
    android:appCategory="productivity"
    android:icon="@drawable/icon"
    android:label="android_auto"
    android:supportsRtl="true"
    android:theme="@style/LightTheme">
    <meta-data
        android:name="com.google.android.gms.car.application"
        android:resource="@xml/automotive_app_desc"/>
</application>

<uses-permission android:name="android.permission.BLUETOOTH"/>
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT"/>
<uses-permission android:name="android.permission.BLUETOOTH_SCAN"/>
<uses-permission android:name="android.permission.BLUETOOTH_ADVERTISE"/>
<uses-permission android:name="android.permission.NEARBY_WIFI_DEVICES"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-feature android:name="android.hardware.type.automotive" android:required="true" />
<uses-feature android:name="android.hardware.wifi" android:required="false" />
<uses-feature android:name="android.hardware.screen.portrait" android:required="false" />
<uses-feature android:name="android.hardware.screen.landscape" android:required="true" />
)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
CreateResourceFromFile(Macro, Themes.LightTheme)

The installation is successful, and the application appears in "System > My applications" but not in the phone's launcher. Additionally, when I add a necessary intent-filter to the main activity for visibility in the launcher, I receive an "invalid package" error message.
Also, in both configurations, the application is not visible in the Android Auto launcher either.

Do you have any suggestions or solutions to resolve these issues? Examples of configurations that have worked for you would be much appreciated.

Thanks a lot for your help !

splash1.jpg

with
android:name="com.google.android.gms.car.application"
android:resource="@xml/automotive_app_desc"/>

splash2.jpg

without

splash3.jpg
 

Filippo

Expert
Licensed User
Longtime User
As part of this project to integrate a B4A application with Android Auto, I am faced with a major constraint: the absence of libraries compatible with B4A facilitating this integration. To overcome this challenge, I propose the creation of a proxy application developed in Java or Kotlin. This app would act as an intermediary between our B4A app and Android Auto, receiving data and notifications from our B4A app to forward to Android Auto. Realizing this solution would require the expertise of developers specialized in Java or Kotlin, skills that I do not currently possess. This will involve sending from B4A a message of the type “MESSAGE as well as its icon”. ?
I am not familiar with Java and Kotlin.
But what I have understood is that an app for Android-Auto must be created from 2 apps (2 layouts, one for smartphone and one for Android-Auto). This is currently not possible with B4x or I don't know how it should work.

I'm still on vacation at the moment, but as soon as I'm back home, I'll start working with Android-Studio, with the hope that it will be easier/possible.
 
Upvote 0

Mr Blue Sky

Active Member
Licensed User
Longtime User
I am not familiar with Java and Kotlin.
But what I have understood is that an app for Android-Auto must be created from 2 apps (2 layouts, one for smartphone and one for Android-Auto). This is currently not possible with B4x or I don't know how it should work.

I'm still on vacation at the moment, but as soon as I'm back home, I'll start working with Android-Studio, with the hope that it will be easier/possible.
Yes an application with Android studio which has the Android-auto libraries even a widgets which receives messages from B4A and transmits them. in this case no need to have a specific library for B4A
 
Upvote 0
Top