I was wondering if there is a way to set up an emulator in Android Studio using the system image that can be downloaded from the Android Things website. I already have a Raspberry Pi 3, but I always have to plug it into the tv which is not very practical at all. That's why I'm asking.
You don't need to plug the Raspberry Pi into a TV for it to work for Android Things. The Pi will still work without a HDMI cable connected.
If you do want to create a UI you can use a normal emulator and in your AndroidManifest.xml
add that the Android Things SDK is not required:
<application ... >
<uses-library android:name="com.google.android.things" android:required="false"/>
... activities etc
</application>
android:required="false" is the key
You just have to make sure, that the code that is running on the emulator is not using any of the Android Things java imports at that time.
One way of making sure the Android Things SDK code is kept separate from your core application (meaning you can run your core app on an Emulator) is to separate the code with Hexagonal Architecture, it's a little off topic for your question but it would allow you to avoid the need to have a "raspberry pi emulator" you can read more about this here: https://www.novoda.com/blog/testing-android-things/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With