add support for android auto

This commit is contained in:
David Luhmer 2019-04-29 19:30:46 -04:00
parent 225136ea77
commit de3823108b
3 changed files with 33 additions and 4 deletions

View file

@ -30,21 +30,38 @@
android:theme="@style/SplashTheme"
android:usesCleartextTraffic="true"
tools:replace="android:icon, android:label, android:theme, android:name">
<meta-data android:name="com.google.android.gms.car.application"
android:resource="@xml/automotive_app_desc"/>
<meta-data android:name="com.google.android.gms.car.notification.SmallIcon"
android:resource="@drawable/ic_notification" />
<activity
android:name=".NewsReaderListActivity"
android:label="@string/app_name"
android:launchMode="singleTop">
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<!-- android:configChanges="keyboardHidden|orientation|screenSize" -->
</activity> <!-- android:configChanges="keyboardHidden|orientation|screenSize" -->
<activity
android:name=".NewsDetailActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:label="@string/title_activity_news_detail" />
<activity android:name=".PiPVideoPlaybackActivity"
android:resizeableActivity="true"
android:supportsPictureInPicture="true"
android:launchMode="singleTask"
android:taskAffinity="de.luhmer.owncloudnewsreader.pip"
android:autoRemoveFromRecents="true"
android:excludeFromRecents="true"
android:exported="false"
tools:targetApi="n"
android:configChanges="screenSize|smallestScreenSize|screenLayout|orientation" />
<activity
android:name=".SettingsActivity"
android:configChanges="keyboardHidden|orientation|screenSize"

View file

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<automotiveApp>
<uses name="media"/>
</automotiveApp>

View file

@ -47,6 +47,14 @@ Download and install:
4. Import the Project in Android Studio and start coding!
Testing with Android Auto:
-----------------------
1. Open Android Studio, click on "Tools" -> "SDK Manager"
2. Select and install "Android Auto API Simulators"
3. Open terminal, go to <android-sdk>/extras/google/simulators
4. Install apk using adb (`../../../platform-tools/adb install media-browser-simulator.apk`)
5. Install apk using adb (`../../../platform-tools/adb install messaging-simulator.apk`)
That's all. I hope it works for you! If something is not working, please send me an email to david-dev@live.de