This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Activity = require('android.app.Activity'); | |
var PackageManager = require('android.content.pm.PackageManager'); | |
function doClick(e) { | |
alert(checkInstalled("com.bluetooth.app") ); | |
if(checkInstalled("com.bluetooth.app")){ | |
try{ | |
var intent = Ti.Android.createIntent({ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var BLE = require('ti.bluetooth'); | |
var myPeripheral; | |
var media = require('permissions/media'); | |
var centralManager = BLE.createCentralManager(); | |
$.btn1.addEventListener('click', function(){ | |
if (centralManager.isScanning()) { | |
alert('Already scanning, please stop scan first!'); | |
return; | |
} else if (centralManager.getState() != BLE.MANAGER_STATE_POWERED_ON) { |