我已经使用android studio为android设备(API level 23及以上)制作了一个android应用程序。现在我想修改一下安卓的应用,这样我就可以在安装了安卓的树莓PI3上运行它。
为了在AOT中成功运行应用程序,我必须在android studio项目中进行哪些地方的更改?
发布于 2017-07-03 17:13:02
根据guidlines的说法
将依赖项工件添加到应用程序级别的build.gradle
文件中:
dependencies {
...
provided 'com.google.android.things:androidthings:0.4.1-devpreview'
}
将Things共享库条目添加到应用程序的清单文件中,并声明一个home活动:
<application
android:label="@string/app_name">
<uses-library android:name="com.google.android.things"/>
<activity android:name=".HomeActivity">
<!-- Launch activity as default from Android Studio -->
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
<!-- Launch activity automatically on boot -->
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.IOT_LAUNCHER"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</activity>
</application>
发布于 2017-07-17 13:36:08
除了Alexander之外,在项目build.gradle: In repositories中添加:
maven { url 'https://maven.google.com'}
想一想权限的陷阱:它们是在设备重启后首次授予的,而不是在安装应用程序之后授予的
https://stackoverflow.com/questions/44774081
复制相似问题