Reputation: 267
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.
Upvotes: 10
Views: 6270
Reputation: 753
If you just want to view the screen you could try Vysor which is Chrome app that works via adb. If your RPI is connected via adb it should work. You can get it here: https://www.vysor.io/.
Upvotes: 4
Reputation: 76496
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/
Upvotes: 15
Reputation: 2978
In my opinion it is not possible right now. To early stage, too much hardware dependant (GPIOs etc). If it would be possible at this stage good guys at Google would gladly provide some solution to do that.
Upvotes: 5