chrome apps のデバイスapi

16
Chrome Apps のデバイス API 2014/10/30 Web プラットフォーム部第四回ナイトセミナー HTML5 デバイス API 勉強会 Toru Yoshikawa (@yoshikawat)

Upload: yoshikawat

Post on 29-Jun-2015

4.904 views

Category:

Technology


0 download

DESCRIPTION

2014/10/30に開催されたHTML5 デバイス API 勉強会(Webプラットフォーム部第四回ナイトセミナー)での講演資料です。

TRANSCRIPT

  • 1. Chrome Apps API2014/10/30WebHTML5 API Toru Yoshikawa (@yoshikawa_t)

2. Who? / Toru Yoshikawa@yoshikawa_thtml5j html5j Google Developer Experts (Chrome)HTML5 Experts.jp No.3Web ()jQuery Mobile ()Sublime Text 2 Japan Users Group ()Blog: http://d.hatena.ne.jp/pikotea/ 3. Chrome Apps APIChromeOSChrome Apps for mobile Developer PreviewAPIVibraton API 4. Chrome Apps APIAPI( https://developer.chrome.com/apps/api_index )( https://developer.chrome.com/apps/samples )APIAPI 5. APIver mobilechrome.bluetooth Bluetooth37 chrome.bluetoothLowEnergy Bluetooth Low EnergyBluetooth LE 37 chrome.bluetoothSocket Bluetooth37 chrome.serial 23 ?chrome.usb USB26 chrome.socket 24 chrome.sockets.tcp TCP 33 chrome.sockets.tcpServer TCP 33 chrome.sockets.udp UDP 33 6. APIver mobilechrome.power Keep Awake 27 chrome.system.cpu CPU32 chrome.system.display 30 chrome.system.memory 32 chrome.system.network NIC33 chrome.system.storage eject 24 7. APIver mobilechrome.fileSystem 23 chrome.hid 38 8. USBmanifest.json"permissions": ["usb"]ID10"permissions": ["usbDevices": [{"vendorId": 123,"productId": 456}]] 9. USBmac 10. USBgetDevicesfunction onDeviceFound(devices) {this.devices=devices;if (devices) {if (devices.length > 0) {console.log("Device(s) found: "+devices.length);} else {console.log("Device could not be found");}} else {console.log("Permission denied.");}}!chrome.usb.getDevices({"vendorId": vendorId, "productId":productId}, onDeviceFound); 11. USBopenDevicevar usbConnection = null;var onOpenCallback = function(connection) {if (connection) {usbConnection = connection;console.log("Device opened.");} else {console.log("Device failed to open.");}};!chrome.usb.openDevice(device, onOpenCallback); 12. USBbulkTransfervar onTransferCallback = function(event) {if (event && event.resultCode === 0 && event.data) {console.log("got " + event.data.byteLength + " bytes");}};!chrome.usb.bulkTransfer(connectionHandle, transferInfo,onTransferCallback); 13. USBchrome.usb.controlTransferchrome.usb.isochronousTransferchrome.usb.interruptTransferUSB 14. Chrome App NFC Library( https://github.com/GoogleChrome/chrome-nfc )chrome.nfcNFCchrome.usbhttps://plus.google.com/+FrancoisBeaufort/posts/CWTm2GaZRLJ 15. Chrome Apps APIChromeApps for mobileCordovaAPIChrome Apps for MobileAPI 16. Thank you!!(@yoshikawa_t)