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.
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>
The HomeActivity:
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);
}
}
The Layout:
<?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>
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!