ã°ã©ãã£ãã¯é«éåã®ããã©ã«ã
Android Things ã¯、CPU ãã¼ã¹ã§ OpenGL ES API ãå®è£
ãããªã¼ãã³ã½ã¼ã¹ã®
SwiftShader ã©ã¤ãã©ãªã使ç¨ãã¦ãã¾ã。ããã«ãã、GPU ãã¼ãã¦ã§ã¢ãæè¼ããã¦ããªããã®ãå«ã、ãã¹ã¦ã®ãã©ãããã©ã¼ã å
±é㧠OpenGL ããµãã¼ãã§ãã¾ã。ãã ã、ã»ã¨ãã©ã®ã·ã³ãã«ãª 2D UI ã¯、OpenGL ã¨ãã¥ã¬ã¼ã·ã§ã³ã使ããã«ç´æ¥ãã¬ã¼ã ãããã¡ã«æç»ããæ¹ãé«éã«ã¬ã³ããªã³ã°ã§ãã¾ã。ããã§、DP6 ã§ã¯、ããã©ã«ã㧠OpenGL ã¬ã³ããªã³ã°ãç¡å¹ã«ãªã、ã»ã¨ãã©ã®ã¢ããªã§ãã£ã¨ãé«é㪠UI ãå®è¡ãããããã«ãªãã¾ã。3D ã¬ã³ããªã³ã°、WebView、TextureView ãªã©ã§ OpenGL ã®ãµãã¼ããå¿
è¦ãªå ´åã¯、
ããã¥ã¡ã³ã ã«å¾ã、次ã®ããã« AndroidManifest.xml ã§æ示çã«æå¹åãã¦ãã ãã。
<activity
...
android:hardwareAccelerated="true">
API 27 㨠Google Play Services
DP6 ã¯、API ã¬ãã« 27 ãæè¼ãããææ°ã® Android 8.1 Developer Preview ããã¼ã¹ã«ãªã£ã¦ãã¾ã。æ¨æº Android ãµã³ãã«ã®ã»ã¨ãã©ã¯、DP6 ã§åä½ãã¾ã。ãã¨ãã°、Camera2 API 㨠TextureView ã使ã£ã¦ãã
Camera2Basic ãµã³ãã«ã¯、NXP 㨠Raspberry Pi ãã¼ã¹ã®ç«¯æ«ã®ä¸¡æ¹ã§åä½ãã¾ã(hardwareAccelerated ãã©ã°ã true ã«ããå¿
è¦ãããã¾ã)。Google Play Services ã¯、SDK ãã¼ã¸ã§ã³ 11.6 ããµãã¼ãããããã«ã¢ãããã¼ãããã¦ãã、
ææ°æ©è½ ããã¹ã¦ãµãã¼ãããã¦ãã¾ã。
ã³ãã³ãã©ã¤ã³æ¸ãè¾¼ã¿ãã¼ã«
ãããããã¼ã®çãããã、fastboot ã使ã£ã¦ãã¼ãã«æ¸ãè¾¼ãã ãè¨å®ãããããä½æ¥ã¯éå¹ççãªå ´åãããã¨ãã声ãå¯ãããã¾ãã。ãã®ãã、
Android Things Console ããç°¡åã«ç«¯æ«ã¤ã¡ã¼ã¸ãæ¸ãè¾¼ãæ°ããæ¹æ³ãæä¾ããã¦ãã¾ã。æå㧠fastboot 㨠adb ã³ãã³ãã使ã代ããã«、æ°ããã¤ã³ã¿ã©ã¯ãã£ã ã³ãã³ãã©ã¤ã³
android-things-setup-utility
ãå©ç¨ã§ãã¾ã。ãã®ãã¼ã«ã使ãã¨、ã¯ããã«ç°¡åã« Android Things ã使ãå§ãããã¨ãã§ã、ãã¦ã³ãã¼ããæ¸ãè¾¼ã¿ã®å¦çãèªååã§ãã¾ã。
Android Things Console ã®ã¢ãããã¼ã
DP6 ã§ã¯、ä»å¾ã®è£½åçãªãªã¼ã¹ã«ä½¿ãããæ°ãããã¼ãã£ã·ã§ã³ ã¹ãã¼ã ãå°å
¥ããã¦ãã¾ã。ãã®æ°ãããã¼ãã£ã·ã§ã³ ã¬ã¤ã¢ã¦ãã®ãã、æ¢åã® DP5.1 以åã®ç«¯æ«ã¯ç¡ç·(OTA)ã·ã¹ãã ã«ããã¢ãããã¼ãã¯ã§ãã¾ãã。ãããããã¼ã¯、
Android Things Console ãéãã¦æ°ãã DP6 ãã«ãããã¦ã³ãã¼ããã¦æ¸ãè¾¼ãå¿
è¦ãããã¾ã。DP6 æ©è½ã«åãã㦠Console ã® UI ãå¤æ´ãã、DP6 ããã¼ã¹ã¨ããæ°ãããã«ãã®ã¿ä½æã§ãã¾ã。ãããããå¤ãæ¢åãã«ãã¯、ãã¦ã³ãã¼ãã¯ã§ãã¾ãã OTA ã¢ãããã¼ãã¯ãµãã¼ãããã¾ãã。ãããããã¼ã®çããã«ã¯、ãã¹ã¦ã®ä½æ¥ã DP6 ã«ç§»è¡ãããã¨ãæ¨å¥¨ãã¾ã。
GPIO ãã³ã®åå
èµ·åæã«è¡¨ç¤ºãããã¤ã³ã¿ã©ã¯ãã£ã IoT ã©ã³ãã£ã¼ã«、I/O ãã³åºåã»ã¯ã·ã§ã³ãå«ã¾ããããã«ãªãã¾ã。ããã§ã¯、ãã¹ã¦ã®ãã³ã®ã©ãã«ã確èªãããã¨ãã§ãã¾ã。i.MX7 ã§ä½¿ããããã³ã®ååã¯å¤æ´ããã¾ããã、ãã®æ°ããå½åè¦åã使ãå ´å、ã³ã¼ããã¢ãããã¼ãããå¿
è¦ãããã¾ã。å®å
¨ãªãã³ã®ååã®ãªã¹ãã«ã¤ãã¦ã¯、
i.MX7 ããã¥ã¡ã³ã ãã覧ãã ãã。
è¨å®ããã³ç«¯æ«ã¢ãããã¼ãç¨ API
ãã¼ã«ã«ç«¯æ«ã®
è¨å® ã端æ«ã®
ã¢ãããã¼ã ãå¶å¾¡ã§ããæ°ãã API ã Android Things ã«è¿½å ããã¦ãã¾ã。
UpdateManager ã使ãã¨、ãããããã¼ã¯ã¢ãããã¼ããåèµ·åãè¡ããã¿ã¤ãã³ã°ãå¶å¾¡ã§ããã®ã§、ã¦ã¼ã¶ã¼ãå¿
è¦ãªã¨ãã«ç¢ºå®ã«ç«¯æ«ã使ããããã«ãªãã¾ã。
DeviceManager ã¯、ãã¡ã¯ããªã¼ ãªã»ãã、åèµ·å、端æ«ã®è¨èª/å°åã管çãã¾ã。ç»é¢ã管çãã
ScreenManager 、æè¨ãã¿ã¤ã ã¾ã¼ã³ã管çãã
TimeManager ãªã©、è¨å®ãè¡ã API ãæä¾ããã¾ã。
å¨è¾ºæ©å¨ç¨ã®ã³ãã³ãã©ã¤ã³ ãã¼ã«
adb ã·ã§ã«çµç±ã§ Peripheral API ã«ã¢ã¯ã»ã¹ã§ããã³ãã³ãã©ã¤ã³ ãã¼ã«
pio
ãæä¾ããã¾ã。ãããããã¼ã¯、adb ã·ã§ã«ãã、GPIO, PWM, UART, I2C, SPI ãä»å¾ã®ã¤ã³ã¿ã¼ãã§ã¼ã¹ã対話çã«ãã¹ãã§ãã¾ã。ããã¯、ãããã°ãèªåãã¹ãã«ä¾¿å©ã§ã。
ãã£ã¼ãããã¯
DP6 ã§ã¯、ãã©ãããã©ã¼ã ã«é大ãªå¤æ´ãæ¹åãå ãããã¦ãã¾ã。
ãã°ã¬ãã¼ã ã
æ©è½ãªã¯ã¨ã¹ã ãéä¿¡ã、ãã£ã¼ãããã¯ããé¡ããã¾ã。質åã¯、ã©ããªãã®ã§ããã¾ãã¾ããã®ã§、
Stack Overflow ã«ãå¯ããã ãã。DP6 ã使ã£ã¦ã¿ãã«ã¯、
Android Things Console ããã·ã¹ãã ã¤ã¡ã¼ã¸ããã¦ã³ãã¼ããã¦æ¢åã®ç«¯æ«ã«æ¸ãè¾¼ãã、
android-things-setup-utility
ãå©ç¨ãã¾ã。詳ããå¤æ´ç¹ã¯、
ãªãªã¼ã¹ãã¼ã ã«è¨è¼ããã¦ãã¾ã。Google+ ã®
Google IoT ãããããã¼ ã³ãã¥ãã㣠ã«ãåå ã§ãã¾ã。ããã¯、ææ°æ
å ±ãå
¥æãããã¢ã¤ãã¢ã話ãåããã¨ãã§ãããã°ããããªã½ã¼ã¹ã§ã。èªåãæ§ç¯ãããã°ãããããã¸ã§ã¯ããå
±æã§ãã
hackster.io ã³ãã¥ãã㣠ã、æ°ãã«èªçãã¾ãã。çããã Android Things ã§ä½ãã¢ããªã楽ãã¿ã«ãã¦ãã¾ã!
Reviewed by
Takeshi Hagikura - Developer Relations Team
ãã®è¨äºã¯ IoT ãããããã¼ ã¢ããã±ã¼ã、Wayne Piekarski ã«ãã Android Developers Blog ã®è¨äº "Android Things Developer Preview 6 " ãå
ã«ç¿»è¨³・å çãããã®ã§ã。詳ããã¯å
è¨äºãã覧ãã ãã。
ããããã®æ°æ©è½ã¨ãã°ã®ä¿®æ£ãå«ã Android Things ã®æ¬¡æãªãªã¼ã¹ Developer Preview 6(DP6)ãç»å ´ãã¾ãã。Android Things ã¯、Android ãããããã¼ãã¢ãã®ã¤ã³ã¿ã¼ããã(IoT)端æ«ãæ§ç¯ããããã® Google 製ãã©ãããã©ã¼ã ã§ã。ããã使ãã¨、åç»ããªã¼ãã£ãªã®å¦çã TensorFlow ã«ãã端æ«ä¸æ©æ¢°å¦ç¿ãªã©ã®å¼·åãªã¢ããªã±ã¼ã·ã§ã³ããµãã¼ããã IoT 端æ«ãæ§ç¯ã§ãã¾ã。æ°æ©è½ã®è©³ç´°ã«ã¤ãã¦ã¯、ãªãªã¼ã¹ãã¼ã ãã覧ãã ãã。ããã§ã¯、DP6 ã®ä¸»ãªæ°æ©è½ããç´¹ä»ãã¾ã。
IoT ã©ã³ãã£ã¼
DP6 ã«ã¯、æ°ãã IoT ã©ã³ãã£ã¼ãå«ã¾ãã¦ãã、ã¿ãã ã¹ã¯ãªã¼ã³ã USB å
¥åããã¤ã¹ã使ã£ã¦、端æ«ã®ç¾å¨ã®ç¶æ
ã確èªãããè¨å®ãå¤æ´ãããã§ãã¾ã。WiFi ã®è¨å®、ãã«ã ID ã®ç¢ºèª、ã¢ãããã¼ãã®ãã§ãã¯ã¨ãã£ãè¨å®ã対話çã«è¡ããããã«ãªã、ç°¡åã«ä½¿ãå§ãããã¨ãã§ãã¾ã。ãã®ã©ã³ãã£ã¼ã¯、ãããããã¼ã IOT_LAUNCHER Activity ãæä¾ãã¦ããªãå ´åã«è¡¨ç¤ºããã¾ã。
ã°ã©ãã£ãã¯é«éåã®ããã©ã«ã
Android Things ã¯、CPU ãã¼ã¹ã§ OpenGL ES API ãå®è£
ãããªã¼ãã³ã½ã¼ã¹ã® SwiftShader ã©ã¤ãã©ãªã使ç¨ãã¦ãã¾ã。ããã«ãã、GPU ãã¼ãã¦ã§ã¢ãæè¼ããã¦ããªããã®ãå«ã、ãã¹ã¦ã®ãã©ãããã©ã¼ã å
±é㧠OpenGL ããµãã¼ãã§ãã¾ã。ãã ã、ã»ã¨ãã©ã®ã·ã³ãã«ãª 2D UI ã¯、OpenGL ã¨ãã¥ã¬ã¼ã·ã§ã³ã使ããã«ç´æ¥ãã¬ã¼ã ãããã¡ã«æç»ããæ¹ãé«éã«ã¬ã³ããªã³ã°ã§ãã¾ã。ããã§、DP6 ã§ã¯、ããã©ã«ã㧠OpenGL ã¬ã³ããªã³ã°ãç¡å¹ã«ãªã、ã»ã¨ãã©ã®ã¢ããªã§ãã£ã¨ãé«é㪠UI ãå®è¡ãããããã«ãªãã¾ã。3D ã¬ã³ããªã³ã°、WebView、TextureView ãªã©ã§ OpenGL ã®ãµãã¼ããå¿
è¦ãªå ´åã¯、ããã¥ã¡ã³ã ã«å¾ã、次ã®ããã« AndroidManifest.xml ã§æ示çã«æå¹åãã¦ãã ãã。
<activity
...
android:hardwareAccelerated="true">
API 27 㨠Google Play Services
DP6 ã¯、API ã¬ãã« 27 ãæè¼ãããææ°ã® Android 8.1 Developer Preview ããã¼ã¹ã«ãªã£ã¦ãã¾ã。æ¨æº Android ãµã³ãã«ã®ã»ã¨ãã©ã¯、DP6 ã§åä½ãã¾ã。ãã¨ãã°、Camera2 API 㨠TextureView ã使ã£ã¦ãã Camera2Basic ãµã³ãã«ã¯、NXP 㨠Raspberry Pi ãã¼ã¹ã®ç«¯æ«ã®ä¸¡æ¹ã§åä½ãã¾ã(hardwareAccelerated ãã©ã°ã true ã«ããå¿
è¦ãããã¾ã)。Google Play Services ã¯、SDK ãã¼ã¸ã§ã³ 11.6 ããµãã¼ãããããã«ã¢ãããã¼ãããã¦ãã、ææ°æ©è½ ããã¹ã¦ãµãã¼ãããã¦ãã¾ã。
ã³ãã³ãã©ã¤ã³æ¸ãè¾¼ã¿ãã¼ã«
ãããããã¼ã®çãããã、fastboot ã使ã£ã¦ãã¼ãã«æ¸ãè¾¼ãã ãè¨å®ãããããä½æ¥ã¯éå¹ççãªå ´åãããã¨ãã声ãå¯ãããã¾ãã。ãã®ãã、Android Things Console ããç°¡åã«ç«¯æ«ã¤ã¡ã¼ã¸ãæ¸ãè¾¼ãæ°ããæ¹æ³ãæä¾ããã¦ãã¾ã。æå㧠fastboot 㨠adb ã³ãã³ãã使ã代ããã«、æ°ããã¤ã³ã¿ã©ã¯ãã£ã ã³ãã³ãã©ã¤ã³ android-things-setup-utility
ãå©ç¨ã§ãã¾ã。ãã®ãã¼ã«ã使ãã¨、ã¯ããã«ç°¡åã« Android Things ã使ãå§ãããã¨ãã§ã、ãã¦ã³ãã¼ããæ¸ãè¾¼ã¿ã®å¦çãèªååã§ãã¾ã。
Android Things Console ã®ã¢ãããã¼ã
DP6 ã§ã¯、ä»å¾ã®è£½åçãªãªã¼ã¹ã«ä½¿ãããæ°ãããã¼ãã£ã·ã§ã³ ã¹ãã¼ã ãå°å
¥ããã¦ãã¾ã。ãã®æ°ãããã¼ãã£ã·ã§ã³ ã¬ã¤ã¢ã¦ãã®ãã、æ¢åã® DP5.1 以åã®ç«¯æ«ã¯ç¡ç·(OTA)ã·ã¹ãã ã«ããã¢ãããã¼ãã¯ã§ãã¾ãã。ãããããã¼ã¯、Android Things Console ãéãã¦æ°ãã DP6 ãã«ãããã¦ã³ãã¼ããã¦æ¸ãè¾¼ãå¿
è¦ãããã¾ã。DP6 æ©è½ã«åãã㦠Console ã® UI ãå¤æ´ãã、DP6 ããã¼ã¹ã¨ããæ°ãããã«ãã®ã¿ä½æã§ãã¾ã。ãããããå¤ãæ¢åãã«ãã¯、ãã¦ã³ãã¼ãã¯ã§ãã¾ãã OTA ã¢ãããã¼ãã¯ãµãã¼ãããã¾ãã。ãããããã¼ã®çããã«ã¯、ãã¹ã¦ã®ä½æ¥ã DP6 ã«ç§»è¡ãããã¨ãæ¨å¥¨ãã¾ã。
GPIO ãã³ã®åå
èµ·åæã«è¡¨ç¤ºãããã¤ã³ã¿ã©ã¯ãã£ã IoT ã©ã³ãã£ã¼ã«、I/O ãã³åºåã»ã¯ã·ã§ã³ãå«ã¾ããããã«ãªãã¾ã。ããã§ã¯、ãã¹ã¦ã®ãã³ã®ã©ãã«ã確èªãããã¨ãã§ãã¾ã。i.MX7 ã§ä½¿ããããã³ã®ååã¯å¤æ´ããã¾ããã、ãã®æ°ããå½åè¦åã使ãå ´å、ã³ã¼ããã¢ãããã¼ãããå¿
è¦ãããã¾ã。å®å
¨ãªãã³ã®ååã®ãªã¹ãã«ã¤ãã¦ã¯、i.MX7 ããã¥ã¡ã³ã ãã覧ãã ãã。
è¨å®ããã³ç«¯æ«ã¢ãããã¼ãç¨ API
ãã¼ã«ã«ç«¯æ«ã®è¨å® ã端æ«ã®ã¢ãããã¼ã ãå¶å¾¡ã§ããæ°ãã API ã Android Things ã«è¿½å ããã¦ãã¾ã。UpdateManager ã使ãã¨、ãããããã¼ã¯ã¢ãããã¼ããåèµ·åãè¡ããã¿ã¤ãã³ã°ãå¶å¾¡ã§ããã®ã§、ã¦ã¼ã¶ã¼ãå¿
è¦ãªã¨ãã«ç¢ºå®ã«ç«¯æ«ã使ããããã«ãªãã¾ã。DeviceManager ã¯、ãã¡ã¯ããªã¼ ãªã»ãã、åèµ·å、端æ«ã®è¨èª/å°åã管çãã¾ã。ç»é¢ã管çãã ScreenManager 、æè¨ãã¿ã¤ã ã¾ã¼ã³ã管çãã TimeManager ãªã©、è¨å®ãè¡ã API ãæä¾ããã¾ã。
å¨è¾ºæ©å¨ç¨ã®ã³ãã³ãã©ã¤ã³ ãã¼ã«
adb ã·ã§ã«çµç±ã§ Peripheral API ã«ã¢ã¯ã»ã¹ã§ããã³ãã³ãã©ã¤ã³ ãã¼ã« pio
ãæä¾ããã¾ã。ãããããã¼ã¯、adb ã·ã§ã«ãã、GPIO, PWM, UART, I2C, SPI ãä»å¾ã®ã¤ã³ã¿ã¼ãã§ã¼ã¹ã対話çã«ãã¹ãã§ãã¾ã。ããã¯、ãããã°ãèªåãã¹ãã«ä¾¿å©ã§ã。
ãã£ã¼ãããã¯
DP6 ã§ã¯、ãã©ãããã©ã¼ã ã«é大ãªå¤æ´ãæ¹åãå ãããã¦ãã¾ã。ãã°ã¬ãã¼ã ãæ©è½ãªã¯ã¨ã¹ã ãéä¿¡ã、ãã£ã¼ãããã¯ããé¡ããã¾ã。質åã¯、ã©ããªãã®ã§ããã¾ãã¾ããã®ã§、Stack Overflow ã«ãå¯ããã ãã。DP6 ã使ã£ã¦ã¿ãã«ã¯、Android Things Console ããã·ã¹ãã ã¤ã¡ã¼ã¸ããã¦ã³ãã¼ããã¦æ¢åã®ç«¯æ«ã«æ¸ãè¾¼ãã、android-things-setup-utility
ãå©ç¨ãã¾ã。詳ããå¤æ´ç¹ã¯、ãªãªã¼ã¹ãã¼ã ã«è¨è¼ããã¦ãã¾ã。Google+ ã® Google IoT ãããããã¼ ã³ãã¥ãã㣠ã«ãåå ã§ãã¾ã。ããã¯、ææ°æ
å ±ãå
¥æãããã¢ã¤ãã¢ã話ãåããã¨ãã§ãããã°ããããªã½ã¼ã¹ã§ã。èªåãæ§ç¯ãããã°ãããããã¸ã§ã¯ããå
±æã§ãã hackster.io ã³ãã¥ãã㣠ã、æ°ãã«èªçãã¾ãã。çããã Android Things ã§ä½ãã¢ããªã楽ãã¿ã«ãã¦ãã¾ã!
Reviewed by Takeshi Hagikura - Developer Relations Team