如何仅通过main.apk将自定义构建配置上传到Android Things [英] How to upload a custom build configuration to Android Things with just a main.apk
问题描述
我目前正在使用 Raspberry Pi 3 和 Android Things (带有官方RPi触摸屏),并且正在尝试了解闪烁的过程自定义版本.我已经经历了创建入门版本的过程,现在我在刷新映像时启动main.apk
时遇到了问题.我已经查看过此问题而且似乎无法说明为什么我的系统无法正常工作.
I'm currently working with a Raspberry Pi 3 and Android Things (with the official RPi touch screen), and I'm trying to understand the process of flashing a custom build. I have already gone through the process of creating a starter build, and now I'm having issues with getting my main.apk
booting up when I flash the image. I have already viewed this question and it doesn't seem to illuminate why mine isn't working.
AndroidManifest:
The AndroidManifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="[...].thingstest">
<application
android:screenOrientation="landscape"
android:label="@string/app_name">
<uses-library android:name="com.google.android.things" />
<activity android:name=".HomeActivity">
<intent-filter>
<!--Launch activity as default from Android Studio-->
<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>
家庭活动:
import android.app.Activity;
import android.os.Bundle;
public class HomeActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_home);
}
}
布局:
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="[...].thingstest.HomeActivity">
<Button
android:id="@+id/button"
android:layout_width="193dp"
android:layout_height="169dp"
android:text="@string/pushme"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"/>
</android.support.constraint.ConstraintLayout>
这确实是一个简单的应用程序.而且它可以在ADB上运行,但是当内置到捆绑包中时不会启动(Android Studio-> Build APK-> 7Zip->存储到ZIP->发送到控制台-> Flash Build).有什么建议吗?是否缺少我的命名约定(如文件名需要具体说明)?谢谢!
It's really a simple app. And it works over ADB, but does not boot when built into a bundle (Android Studio -> Build APK -> 7Zip -> Store into ZIP -> Send to Console -> Flash Build). Any advice? Are there naming conventions that I'm missing (as in do file names need to be specific)? Thanks!
推荐答案
我不知道为什么它不起作用,但是创建一个新的基于Things的项目是可行的.谢谢大家.
I don't know why it didn't work, but creating a new Things-based project worked. Thanks all.
这篇关于如何仅通过main.apk将自定义构建配置上传到Android Things的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!