Your SlideShare is downloading. ×
0
AndroidのBL E作った
やつは氏ねばいいの&#x306...
BL E
• Bluetooth Low Energy
• すごく、、、低消費&#x96F...
すごく、、、低消費電力です、、&#...
すごく低消費電力だから、、、
• ...
なんか楽しそうやん?
やってみたくなるやん?
やめとけ!
どうしてもやりたかったら、、、
iOSでやっとけ!
どうしてもAndroidで
やりたい場合
Lollipop以上でやっとけ!
4.X系のBL Eは鬼門
• 4.3のAPIには、既にdeprecated&...
http://stackoverflow.com/questions/18197444/android-bluetooth-low-energy-pairing
ここ
// this situation happens when you try to connect for
the second time to already bonded device
// it should never happen, ...
aerie
結局、ここで何が起こって
どう&#x...
×  BluetoothをOFF -> ONして再接続する
×  ボン&#x3...
Androidのシステムレベルで
紐付けし直&#...
Lollipopだと
こんな思いはしなくていい
minSdkVersion 21
ご静聴ありがとうございました
AndroidのBLE作ったやつは氏ねばいいのに
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply
iPhone sideview for SlideShare app

AndroidのBLE作ったやつは氏ねばいいのに

458

Published on

Android Night in Fukuoka vol.36 でのLTです。
http://eventdots.jp/event/543735

Published in: Engineering
0 Comments
3 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
458
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
0
Comments
0
Likes
3
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  1. 1. AndroidのBL E作った やつは氏ねばいいのに akimicyu Android Night in Fukuoka vol. 36
  2. 2. BL E • Bluetooth Low Energy • すごく、、、低消費電力です、、、(ボタン電池1つで数年稼働) • Bluetooth 4.0規格の一部 • Androidでは4.3から標準対応
  3. 3. すごく、、、低消費電力です、、、
  4. 4. すごく低消費電力だから、、、 • 電力消費がネックだった、あんな装置こんな装置で いろんなことができちゃう → 夢が広がる • 各種センサー装置 • 体に身につける小型の装置
  5. 5. なんか楽しそうやん?
  6. 6. やってみたくなるやん?
  7. 7. やめとけ!
  8. 8. どうしてもやりたかったら、、、
  9. 9. iOSでやっとけ!
  10. 10. どうしてもAndroidで やりたい場合
  11. 11. Lollipop以上でやっとけ!
  12. 12. 4.X系のBL Eは鬼門 • 4.3のAPIには、既にdeprecatedなものがある • ソース読んでみると……(以下略) • なんか、すごく動きがおかしい • 特に4.3にアップデートされたGALAXY S4とか • http://stackoverflow.com/questions/18197444/ android-bluetooth-low-energy-pairing
  13. 13. http://stackoverflow.com/questions/18197444/android-bluetooth-low-energy-pairing
  14. 14. ここ
  15. 15. // this situation happens when you try to connect for the second time to already bonded device // it should never happen, in my opinion Logger.e(TAG, "The phone is trying to read from paired device without encryption. Android Bug?"); // I don't know what to do here // This error was found on Nexus 7 with KRT16S build of Andorid 4.4. It does not appear on Samsung S4 with Andorid 4.3. 意訳:このスマホは紐付け済のデバイスと暗号化なしで通信を試行してる。    Androidのバグか? この症状は紐付け後、2回目の接続で起こる。    まじでありえん。俺ここで何したらいいのよ?
  16. 16. aerie 結局、ここで何が起こって どう対応したらよかったのか?
  17. 17. × BluetoothをOFF -> ONして再接続する × ボンディング(紐付け)し直して再接続する → 再接続のたびに、通信の本数が増える
 (コールバックが複数走って、意図しない動きに、、、)
  18. 18. Androidのシステムレベルで 紐付けし直してくれるから    ↓ そこではフラグ立てとくだけにして、 紐付けの状態通知イベントのなかで フラグ見て検知して処理を再開すればいいよ
 (BluetoothDevice.ACTION_BOND_STATE_CHANGED) (納得いかない……) ○
  19. 19. Lollipopだと こんな思いはしなくていい
  20. 20. minSdkVersion 21
  21. 21. ご静聴ありがとうございました
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×