Introduccion en Titanium Appcelerator - Dan Tamas Betabeers Oviedo
Beacons in Appcelerator Titanium
-
Upload
jeroen-van-dijk -
Category
Technology
-
view
719 -
download
0
Transcript of Beacons in Appcelerator Titanium
![Page 1: Beacons in Appcelerator Titanium](https://reader034.fdocuments.in/reader034/viewer/2022052211/5872baed1a28ab523c8b790b/html5/thumbnails/1.jpg)
BEACONS IN APPCELERATOR TITANIUM
![Page 2: Beacons in Appcelerator Titanium](https://reader034.fdocuments.in/reader034/viewer/2022052211/5872baed1a28ab523c8b790b/html5/thumbnails/2.jpg)
UUID MAJOR MINOR
![Page 3: Beacons in Appcelerator Titanium](https://reader034.fdocuments.in/reader034/viewer/2022052211/5872baed1a28ab523c8b790b/html5/thumbnails/3.jpg)
IMMEDIATE NEAR FAR
![Page 4: Beacons in Appcelerator Titanium](https://reader034.fdocuments.in/reader034/viewer/2022052211/5872baed1a28ab523c8b790b/html5/thumbnails/4.jpg)
IOS 7.1 > ANDROID 4.3 >
https://developer.apple.com/ibeacon/http://altbeacon.github.io/android-
beacon-library/index.html
https://github.com/jbeuckm/TiBeaconshttps://github.com/dwk5123/android-
altbeacon-module
MAX 20 REGIONS SIMULTANUOUS UNLIMITED REGIONS?
Bluetooth 4.0 / 2.4 Ghz Bluetooth 4.0 / 2.4 Ghz
![Page 5: Beacons in Appcelerator Titanium](https://reader034.fdocuments.in/reader034/viewer/2022052211/5872baed1a28ab523c8b790b/html5/thumbnails/5.jpg)
MONITORING VS RANGING
![Page 6: Beacons in Appcelerator Titanium](https://reader034.fdocuments.in/reader034/viewer/2022052211/5872baed1a28ab523c8b790b/html5/thumbnails/6.jpg)
SIGNAL STRENGTH
RSSI
![Page 7: Beacons in Appcelerator Titanium](https://reader034.fdocuments.in/reader034/viewer/2022052211/5872baed1a28ab523c8b790b/html5/thumbnails/7.jpg)
LOCATION & DIRECTION
![Page 8: Beacons in Appcelerator Titanium](https://reader034.fdocuments.in/reader034/viewer/2022052211/5872baed1a28ab523c8b790b/html5/thumbnails/8.jpg)
LOCATION & DIRECTION
FARNEAR
IMMEDIATE
![Page 9: Beacons in Appcelerator Titanium](https://reader034.fdocuments.in/reader034/viewer/2022052211/5872baed1a28ab523c8b790b/html5/thumbnails/9.jpg)
IMPLEMENTING IN TITANIUM
![Page 10: Beacons in Appcelerator Titanium](https://reader034.fdocuments.in/reader034/viewer/2022052211/5872baed1a28ab523c8b790b/html5/thumbnails/10.jpg)
IOS
Ti.Geolocation.requestAuthorization(Ti.Geolocation.AUTHORIZATION_ALWAYS);
var Beacons = require('org.beuckman.tibeacons');
Beacons.addEventListener('determinedRegionState', function (e) { if (e.regionState === 'inside') { Beacons.startRangingForBeacons({ uuid: e.uuid }); } });
Beacons.addEventListener('beaconProximity', function (beacon) { if (_.isUndefined(beacon.rssi)) return; // do your thing });
Beacons.startMonitoringForRegion({uuid: '<uuid>'});
![Page 11: Beacons in Appcelerator Titanium](https://reader034.fdocuments.in/reader034/viewer/2022052211/5872baed1a28ab523c8b790b/html5/thumbnails/11.jpg)
ANDROID
var Beacons = require('com.drtech.altbeacon');
Beacons.addEventListener('serviceBound', function () { Beacons.startMonitoringForRegion({uuid: '<uuid>'}); });
Beacons.addEventListener('beaconProximity', function (beacon) { if (_.isUndefined(beacon.rssi)) return; // do your thing });
Beacons.setAutoRange(true); Beacons.setRunInService(true); Beacons.addBeaconLayout('m:2-3=0215,i:4-19,i:20-21,i:22-23,p:24-24');
Beacons.bindBeaconService();
![Page 12: Beacons in Appcelerator Titanium](https://reader034.fdocuments.in/reader034/viewer/2022052211/5872baed1a28ab523c8b790b/html5/thumbnails/12.jpg)
BACKGROUND PROCESSES
THE INTERNET LIES
![Page 13: Beacons in Appcelerator Titanium](https://reader034.fdocuments.in/reader034/viewer/2022052211/5872baed1a28ab523c8b790b/html5/thumbnails/13.jpg)
TIMODULE.XML FOR IOS
<ti:module> <iphone> <plist> <dict> <key>UIBackgroundModes</key> <array> <string>location</string> <string>bluetooth-central</string> <string>bluetooth-peripheral</string> </array> </dict> </plist> </iphone> </ti:module>
![Page 14: Beacons in Appcelerator Titanium](https://reader034.fdocuments.in/reader034/viewer/2022052211/5872baed1a28ab523c8b790b/html5/thumbnails/14.jpg)
TIMODULE.XML FOR IOS
<ti:module> <iphone> <plist> <dict> <key>UIBackgroundModes</key> <array> <string>location</string> <string>bluetooth-central</string> <string>bluetooth-peripheral</string> </array> </dict> </plist> </iphone> </ti:module>
![Page 15: Beacons in Appcelerator Titanium](https://reader034.fdocuments.in/reader034/viewer/2022052211/5872baed1a28ab523c8b790b/html5/thumbnails/15.jpg)
TIMODULE.XML FOR IOS
<ti:module> <iphone> <plist> <dict> <key>UIBackgroundModes</key> <array> <string>location</string> <string>bluetooth-central</string> <string>bluetooth-peripheral</string> </array> </dict> </plist> </iphone> </ti:module>
![Page 16: Beacons in Appcelerator Titanium](https://reader034.fdocuments.in/reader034/viewer/2022052211/5872baed1a28ab523c8b790b/html5/thumbnails/16.jpg)
TIMODULE.XML FOR ANDROID
<ti:module> <android> <manifest> <uses-permission android:name="a….p….BLUETOOTH"/> <uses-permission android:name="a….p….BLUETOOTH_ADMIN"/> <uses-permission android:name="a….p….ACCESS_COARSE_LOCATION"/> <application> <service android:enabled="true" android:exported="false" android:isolatedProcess="false" android:label="beacon" android:name="org.altbeacon.beacon.service.BeaconService"/> <service android:name="org.altbeacon.beacon.BeaconIntentProcessor" android:enabled="true"/> </application> </manifest> </android> </ti:module>
![Page 17: Beacons in Appcelerator Titanium](https://reader034.fdocuments.in/reader034/viewer/2022052211/5872baed1a28ab523c8b790b/html5/thumbnails/17.jpg)
TIMODULE.XML FOR ANDROID
<ti:module> <android> <manifest> <uses-permission android:name="a….p….BLUETOOTH"/> <uses-permission android:name="a….p….BLUETOOTH_ADMIN"/> <uses-permission android:name="a….p….ACCESS_COARSE_LOCATION"/> <application> <service android:enabled="true" android:exported="false" android:isolatedProcess="false" android:label="beacon" android:name="org.altbeacon.beacon.service.BeaconService"/> <service android:name="org.altbeacon.beacon.BeaconIntentProcessor" android:enabled="true"/> </application> </manifest> </android> </ti:module>
![Page 18: Beacons in Appcelerator Titanium](https://reader034.fdocuments.in/reader034/viewer/2022052211/5872baed1a28ab523c8b790b/html5/thumbnails/18.jpg)
DO YOUR THING?
![Page 19: Beacons in Appcelerator Titanium](https://reader034.fdocuments.in/reader034/viewer/2022052211/5872baed1a28ab523c8b790b/html5/thumbnails/19.jpg)
SENSIMITY
![Page 20: Beacons in Appcelerator Titanium](https://reader034.fdocuments.in/reader034/viewer/2022052211/5872baed1a28ab523c8b790b/html5/thumbnails/20.jpg)
![Page 21: Beacons in Appcelerator Titanium](https://reader034.fdocuments.in/reader034/viewer/2022052211/5872baed1a28ab523c8b790b/html5/thumbnails/21.jpg)
![Page 22: Beacons in Appcelerator Titanium](https://reader034.fdocuments.in/reader034/viewer/2022052211/5872baed1a28ab523c8b790b/html5/thumbnails/22.jpg)