ibeacon-android

onServicesDiscovered not be called on BluetoothGattCallback

荒凉一梦 提交于 2019-12-18 07:22:33
问题 I start working with ibeacon and android. But there are some problem need for your helps. On blutoothGatCallback I implement onConnectionStateChange and call discoverServices(). Althougth, discoverServices() return true but there is not any callback execute, I hope onServicesDiscovered being called, but not. @Override public void onConnectionStateChange(BluetoothGatt gatt, int status, int newState) { Log.i(TAG, "onConnectionStateChange : " + status + " newState : " + newState); if (newState =

How to check battery consumption caused by Bluetooth Scans

岁酱吖の 提交于 2019-12-14 03:03:38
问题 I have an Android application to detect Eddystone beacons using the Android Beacon Library. I would like to test the battery consumption caused by the application to find the optimal background and foreground scan rates. In Settings > Apps > MyBeaconDetectorApp, it shows 0% battery usage after having the bluetooth On for more than an hour. I think the application is in background and hence it is 0%. However, how do I check the battery consumption caused by Bluetooth scans. I have set my

In Android, How to get ibeacon details onExitedRegion when Region is created with proximity UUID only

孤街浪徒 提交于 2019-12-13 05:47:09
问题 I am working on android application with Estimote beacons. I am trying to work on a scenario where i will be using more than 100 beacons. For this, instead of creating separate Region for each beacon, I am creating single Region by assigning common Proximity UUID for all beacons and declaring Region by passing Proximity UUID only. I am keeping Major and Minor for uniquely identifying the beacons. Since my application has to be in background, I am using BeaconManager.MonitoringListener

Android beacon Monitoring while Ranging

三世轮回 提交于 2019-12-13 04:34:44
问题 In continuation with my previous question asked here, I am no longer following the approach of creating single Region for all beacons. Now i am creating Regions at run-time. I did ranging first. Below is code that i am trying to implement. public void onBeaconsDiscovered(Region region, final List<Beacon> beacons) { for(int i =0;i<beacons.size();i++) { Region r = new Region("RegionID", beacons.get(i).getProximityUUID(), beacons.get(i).getMajor(), beacons.get(i).getMinor()); try { beaconManager

Detect beacon exited a range

試著忘記壹切 提交于 2019-12-13 04:34:12
问题 I am using Android with the AltBeacon library. I am starting to develop a BLE app which should tell me when a beacon is entering and when it is exiting a range inside a region so I can start an action. I could detect when a beacon is entering a region and determine his range. Therefore I used the didRangeBeaconsInRegion Method. My problem is now how to detect that a beacon has left/exited that range in the region? I couldn't find anything in the lib to do so. How can I achieve this? 回答1: The

iBeacon Ranging Service Not Returning any Beacons (Part 2)

倾然丶 夕夏残阳落幕 提交于 2019-12-12 06:35:57
问题 My code has now reached checkpoint 1 and 2. However, it is only detecting the beacon once. I want it to keep receiving the location of the beacon (distance) every five seconds. How can I implement this? Thanks again public class RangingService extends Service implements BeaconConsumer { private BeaconManager beaconManager = BeaconManager.getInstanceForApplication(this); Handler handler; String b = ""; @Override public IBinder onBind(Intent arg0) { return null; } @Override public void onStart

Convert from millis to hex String

好久不见. 提交于 2019-12-12 05:39:36
问题 I want to set the current time as the major and minor values of a beacon. Lets suppose this is the current time 1465398279009 . I want 9827 to be the value of the major and 9009 the value of the minor. I use a java code to call the shell script. this is my java code Long millis = System.currentTimeMillis(); String time=Long.toString(millis); // String major1=time.substring(...); String major1="99"; String major2="99"; String minor1="99"; String minor2="99"; ProcessBuilder pb2=new

Android robolectric tests manifest merge issue (android beacon library)

允我心安 提交于 2019-12-12 05:38:50
问题 I have the simple Test Case @Config(constants = BuildConfig.class) @RunWith(RobolectricGradleTestRunner.class) public class BaseTest { @Test public void startEverTestSugarAppAsFirst() { BeaconManager.setsManifestCheckingDisabled(true); } } Unfortunately the runner hits manifestmerger issue java.lang.RuntimeException: org.altbeacon.beacon.BeaconManager$ServiceNotDeclaredException: The BeaconService is not properly declared in AndroidManifest.xml. If using Eclipse, please verify that your

AltBeacon application crashes on Android tab

非 Y 不嫁゛ 提交于 2019-12-12 04:56:55
问题 I have been trying to use the AltBeacon Monitoring Example Code to monitor my Kontakt.io beacon as described http://altbeacon.github.io/android-beacon-library/samples.html here. I could import the library (android-beacon-library-2.1.3.aar) in my android studio (1.0.2) and there is no error in the monitoring code. But when I want to run it on my tab (LG Tab 7 API 19) it stops working with a message on the screen. I can be sure that the Altbeacon lib is imported successfully as it appears in

Detect nearby beacons with Bluez

大憨熊 提交于 2019-12-12 04:27:00
问题 I installed Bluez and I am trying to scan and get UUID Major, Minor and if possible mac address for nearby ibeacon. I found similar questions and they refer to a script which I found here . When I launch the script I get this error Set scan parameters failed: Input/output error Did someone know how to solve the problem or has another solution ? If I start transmitting with the beacon and then I start the scan I get no result at all and I have to interrupt the script. 回答1: You should test that