Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
252 views
in Technique[技术] by (71.8m points)

iot - How to create Android Things' bundle and push it over OTA?

Anyone succeeded creating Android Things Bundle and pushing it over OTA?

On the Android Things' Console, there's a page to Create a Bundle for the OTA.

I'm trying to figure out how to do that. I've adding just a single APK file main.apk to a ZIP file. Then I've tried to push it to a RPi which is sitting nearby. But the main.apk would not be launched on the device.

Things I've tried/done:

  • Download Empty bundle with Things Build ID=NIH40K
  • Creating a Bundle and pushing it to devices through OTA UPDATES
  • Creating a new FACTORY IMAGE with that newly created bundle
  • Still my app would not be started
  • I've checked, my app's MainActivity has action=MAIN and category=IOT_CATEGORY
  • Tried running app from my laptop via adb connect Andorid.local and it works as designed

But I couldn't make an OTA update. Anyone succeeded doing so?

Here's my project on Github: https://github.com/ViliusKraujutis/Android-Things-Demo

Thanks

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Here are all the steps necessary to make OTA update possible after creating a new product in your android things console :

1 - Create your first build configuration, either from the empty bundle in the console or from a personnal bundle you added.

2 - Download build of this build configuration. You will get an Android Things image. Flash it to your RPi as you did when you flashed the Android Things regular image. https://developer.android.com/things/hardware/raspberrypi.html#flashing_the_image

From now on, your RPi will check if a different version of your product has been pushed from the console. The check happens every 5 or 6 hours so you might have to be patient. Also your RPi needs to have internet access.

3 - Upload another bundle to your console, create a build configuration for it and then push it to your devices via the OTA updates panel of your console.

4 - You will need to manually reboot the RPi to apply the update.

This article from Dave McKelvie is a good example in my opinion : http://android.geek.nz/hello-android-things-developer-console/


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...