GithubHelp home page GithubHelp logo

vitas / beaconloc Goto Github PK

View Code? Open in Web Editor NEW
103.0 12.0 43.0 576 KB

Beacon Locator - android application for scan, track and management of beacons

License: Apache License 2.0

Java 100.00%
beacons beacon-locator altbeacon-library beacon android-application

beaconloc's Introduction

Beacon Locator

An Android application to interact with beacons.
Implemented in nice material design using Mvvv pattern + data binding and could be used as a reference application for Altbeacon android library github of altbeacon library.

Get it on F-Droid Get it on Google Play

What can this application do?

The application can scan and locate beacons (Eddystone, iBeacons or AltBeacons) and present detailed information about beacons properties. The application allows you to define actions that will be triggered when a specified event occurs.

Supported events

  • Beacon enters a region
  • Beacon leaves the region
  • Beacon is near you

For each event you can define an unlimited number of actions

  • Open an application
  • Open url
  • Get Gps Location
  • Broadcast intent action
  • Set Normal / Silent mode
  • Execute [tasker action] (http://tasker.dinglisch.net)

For example, you may set a silent mode entering your bedroom...and set normal sound profile leaving it.

More features are coming soon in next release. Please, do hesitate to contact us if you have some ideas about new features or want to contribute.

Screenshots

Limitations

Android 4.3 with Bluetooth 4.0 LE or newer is required.

License

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

beaconloc's People

Contributors

aioue avatar poussinou avatar vitas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

beaconloc's Issues

Make it possible to set the background scan interval even shorter, maybee 5-10 seconds?

It should be possible to set the background scan interval even shorter, maybee 5-10 seconds?

My intended use is to control a door look by placing a beacon near the door. When getting near the door with my phone in my pocket, the Beacon locator app should send an command on WiFi to Domoticz controlling the electric look. So the background scan should be possible to set so short that the door opens imediately, or within a few seconds.

Another nice feature might be controlling background scanning on/off based on wifi connections SSID-name, and/or GPS location?

Execute [tasker action]

Hi ,
Can someone show what syntax to use to inform tasker during an action? because I can't find an example.
thank you all

v1.1.6 crash

Hello there.
I had version 1.1.5, which worked fine, however 1.1.6 crashes on launching the app.

Related log:

10-25 08:01:42.180  3569  6108 I ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.samebits.beacon.locator/.ui.activity.MainNavigationActivity (has extras)} from uid 10042
10-25 08:01:42.241  3569 24234 I ActivityManager: Start proc 22086:com.samebits.beacon.locator/u0a162 for activity com.samebits.beacon.locator/.ui.activity.MainNavigationActivity
10-25 08:01:42.347 22086 22086 I BeaconManager: BeaconManager started up on pid 22086 named 'com.samebits.beacon.locator' for application package 'com.samebits.beacon.locator'.  isMainProcess=true
10-25 08:01:42.352 22086 22086 D BeaconParser: Parsing beacon layout: m:2-3=beac,i:4-19,i:20-21,i:22-23,p:24-24,d:25-25
10-25 08:01:42.396 22086 22086 W JobInfo : Specified interval for 1 is +5m10s0ms. Clamped to +15m0s0ms
10-25 08:01:42.396 22086 22086 W JobInfo : Specified flex for 1 is 0. Clamped to +5m0s0ms
10-25 08:01:42.396 22086 22086 W JobInfo : Specified interval for 1 is +5m10s0ms. Clamped to +15m0s0ms
10-25 08:01:42.396 22086 22086 W JobInfo : Specified flex for 1 is 0. Clamped to +5m0s0ms
10-25 08:01:42.397 22086 22086 D BeaconParser: Parsing beacon layout: s:0-1=feaa,m:2-2=00,p:3-3:-41,i:4-13,i:14-19
10-25 08:01:42.398 22086 22086 D BeaconParser: Parsing beacon layout: s:0-1=feaa,m:2-2=10,p:3-3:-41,i:4-21v
10-25 08:01:42.399 22086 22086 D BeaconParser: Parsing beacon layout: m:2-3=beac,i:4-19,i:20-21,i:22-23,p:24-24,d:25-25
10-25 08:01:42.399   420   420 E lowmemorykiller: Error writing /proc/22014/oom_score_adj; errno=22
10-25 08:01:42.400 22086 22086 D BeaconParser: Parsing beacon layout: m:2-3=0215,i:4-19,i:20-21,i:22-23,p:24-24,d:25-25
10-25 08:01:42.400 22086 22086 D BeaconParser: Parsing beacon layout: m:2-3=0215,i:4-19,i:20-21,i:22-23,p:24-24
10-25 08:01:42.400 22086 22086 D BeaconParser: Parsing beacon layout: m:0-3=4c000215,i:4-19,i:20-21,i:22-23,p:24-24
10-25 08:01:42.401 22086 22086 D BeaconLocator: Enable Background Scan
10-25 08:01:42.412 22086 22086 D BeaconLocator: Ignore Background scan, no regions
10-25 08:01:42.428  3569 10170 I ActivityManager: Process com.google.android.partnersetup (pid 22014) has died: fore TRNB
10-25 08:01:42.429  3569 10170 W ActivityManager: Scheduling restart of crashed service com.google.android.partnersetup/.InstalledAppJobService in 1000ms
10-25 08:01:42.491 22086 22086 I AppCompatViewInflater: app:theme is now deprecated. Please move to using android:theme instead.
10-25 08:01:42.591 22086 22104 D OpenGLRenderer: HWUI GL Pipeline
10-25 08:01:42.604 22086 22086 D AndroidRuntime: Shutting down VM
10-25 08:01:42.612 22086 22086 E AndroidRuntime: FATAL EXCEPTION: main
10-25 08:01:42.612 22086 22086 E AndroidRuntime: Process: com.samebits.beacon.locator, PID: 22086
10-25 08:01:42.612 22086 22086 E AndroidRuntime: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.samebits.beacon.locator/com.samebits.beacon.locator.ui.activity.MainNavigationActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'int com.samebits.beacon.locator.ui.adapter.BeaconAdapter.getItemCount()' on a null object reference
10-25 08:01:42.612 22086 22086 E AndroidRuntime: 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2817)
10-25 08:01:42.612 22086 22086 E AndroidRuntime: 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2892)
10-25 08:01:42.612 22086 22086 E AndroidRuntime: 	at android.app.ActivityThread.-wrap11(Unknown Source:0)
10-25 08:01:42.612 22086 22086 E AndroidRuntime: 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1593)
10-25 08:01:42.612 22086 22086 E AndroidRuntime: 	at android.os.Handler.dispatchMessage(Handler.java:105)
10-25 08:01:42.612 22086 22086 E AndroidRuntime: 	at android.os.Looper.loop(Looper.java:164)
10-25 08:01:42.612 22086 22086 E AndroidRuntime: 	at android.app.ActivityThread.main(ActivityThread.java:6541)
10-25 08:01:42.612 22086 22086 E AndroidRuntime: 	at java.lang.reflect.Method.invoke(Native Method)
10-25 08:01:42.612 22086 22086 E AndroidRuntime: 	at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
10-25 08:01:42.612 22086 22086 E AndroidRuntime: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
10-25 08:01:42.612 22086 22086 E AndroidRuntime: Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'int com.samebits.beacon.locator.ui.adapter.BeaconAdapter.getItemCount()' on a null object reference
10-25 08:01:42.612 22086 22086 E AndroidRuntime: 	at com.samebits.beacon.locator.ui.fragment.DetectedBeaconsFragment.emptyListSetup(DetectedBeaconsFragment.java:149)
10-25 08:01:42.612 22086 22086 E AndroidRuntime: 	at com.samebits.beacon.locator.ui.fragment.DetectedBeaconsFragment.onCanScan(DetectedBeaconsFragment.java:177)
10-25 08:01:42.612 22086 22086 E AndroidRuntime: 	at com.samebits.beacon.locator.ui.fragment.ScanFragment.onBeaconServiceConnect(ScanFragment.java:154)
10-25 08:01:42.612 22086 22086 E AndroidRuntime: 	at org.altbeacon.beacon.BeaconManager.bind(BeaconManager.java:418)
10-25 08:01:42.612 22086 22086 E AndroidRuntime: 	at com.samebits.beacon.locator.ui.fragment.ScanFragment.onCreate(ScanFragment.java:60)
10-25 08:01:42.612 22086 22086 E AndroidRuntime: 	at com.samebits.beacon.locator.ui.fragment.DetectedBeaconsFragment.onCreate(DetectedBeaconsFragment.java:83)
10-25 08:01:42.612 22086 22086 E AndroidRuntime: 	at android.support.v4.app.Fragment.performCreate(Fragment.java:2180)
10-25 08:01:42.612 22086 22086 E AndroidRuntime: 	at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1244)
10-25 08:01:42.612 22086 22086 E AndroidRuntime: 	at android.support.v4.app.FragmentTransition.addToFirstInLastOut(FragmentTransition.java:1085)
10-25 08:01:42.612 22086 22086 E AndroidRuntime: 	at android.support.v4.app.FragmentTransition.calculateFragments(FragmentTransition.java:976)
10-25 08:01:42.612 22086 22086 E AndroidRuntime: 	at android.support.v4.app.FragmentTransition.startTransitions(FragmentTransition.java:95)
10-25 08:01:42.612 22086 22086 E AndroidRuntime: 	at android.support.v4.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2146)
10-25 08:01:42.612 22086 22086 E AndroidRuntime: 	at android.support.v4.app.FragmentManagerImpl.optimizeAndExecuteOps(FragmentManager.java:2103)
10-25 08:01:42.612 22086 22086 E AndroidRuntime: 	at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:2013)
10-25 08:01:42.612 22086 22086 E AndroidRuntime: 	at android.support.v4.app.FragmentController.execPendingActions(FragmentController.java:388)
10-25 08:01:42.612 22086 22086 E AndroidRuntime: 	at android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:607)
10-25 08:01:42.612 22086 22086 E AndroidRuntime: 	at android.support.v7.app.AppCompatActivity.onStart(AppCompatActivity.java:178)
10-25 08:01:42.612 22086 22086 E AndroidRuntime: 	at com.samebits.beacon.locator.ui.activity.BaseActivity.onStart(BaseActivity.java:134)
10-25 08:01:42.612 22086 22086 E AndroidRuntime: 	at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1333)
10-25 08:01:42.612 22086 22086 E AndroidRuntime: 	at android.app.Activity.performStart(Activity.java:6992)
10-25 08:01:42.612 22086 22086 E AndroidRuntime: 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2780)
10-25 08:01:42.612 22086 22086 E AndroidRuntime: 	... 9 more
10-25 08:01:42.615  3569 11147 W ActivityManager:   Force finishing activity com.samebits.beacon.locator/.ui.activity.MainNavigationActivity
10-25 08:01:42.622  3569 22105 W DropBoxManagerService: Dropping: data_app_crash (3245 > 0 bytes)
10-25 08:01:42.625  3569  3585 I ActivityManager: Showing crash dialog for package com.samebits.beacon.locator u0
10-25 08:01:43.118  3569  3584 W ActivityManager: Activity pause timeout for ActivityRecord{d9a796d u0 com.samebits.beacon.locator/.ui.activity.MainNavigationActivity t3267 f}
10-25 08:01:43.376  3569  3578 I zygote64: Background concurrent copying GC freed 159564(6MB) AllocSpace objects, 10(360KB) LOS objects, 42% free, 21MB/37MB, paused 427us total 131.646ms
10-25 08:01:43.443  3569  3584 I ActivityManager: Start proc 22107:com.google.android.partnersetup/u0a27 for service com.google.android.partnersetup/.InstalledAppJobService

Running this on Android 8.0.0, security patch 5th October 2017.

Thanks for having a look.

Support Bluetooth LE-devices in general / Allow using Tile beacons

It would be awesome if you could add the trackers for Tile as well:
https://www.thetileapp.com/en-us/

Using RaMBLE (scanner-app for bluetooth LE) I found it shows up easily as:
Service UUIDs: Tile promimity tracker (0xfeed)
Also accoring to the list of UUIDs the company is assigned 0xfeec and 0xfeed: https://www.bluetooth.com/specifications/assigned-numbers/

Maybe it would be an option to be wide more open to scan/track "any" bluetooth LE devices, like RaMBLE does? That might solve a number of other inqueries people have here in the issues for "could you please support tracker X or Y" - which is mainly just any kind of Bluetooth LE-device detected.

Editing Actions for an event incomplete?

Editing the properties of an action for an event seems to be incomplete.
Selecting an App for "Start application" or entering an URL for "Open URL" and such is not possible.

Viability to support CyanogenMod profiles?

I was looking into some app capable of switching CyanogenMod profiles (something like Tasker profiles, but built-in with the CyanogenMod ROM and tight integration with the system) with Beacon.

I realized that this project may be interested in adding that feature, given that there are some "trigger actions" available and Tasker does not have direct support for CyanogenMod profiles. I am not a very good Android programmer, but I don't mind to try to add the feature. That is, if it is of any interest. Or maybe there is some better idea on the integration of those profiles.

Beacon continuously enters/leaves region

I have some Estimote beacons and am using this App to send MQTT messages via Tasker when beacons enter and leave regions. I'm noticing that when the phone is near a beacon it comes & goes constantly.

For example, my phone sits on a wireless charger on my bedside table overnight and is approximately 1m from a beacon. Here is an extract from my MQTT log showing this behaviour:

2016-11-16 01:16:02 /Beacon/Ice: ON
2016-11-16 01:16:51 /Beacon/Ice: OFF
2016-11-16 01:17:06 /Beacon/Ice: ON
2016-11-16 01:21:48 /Beacon/Ice: OFF
2016-11-16 01:21:54 /Beacon/Ice: ON
2016-11-16 01:26:50 /Beacon/Ice: OFF
2016-11-16 01:32:02 /Beacon/Ice: ON
2016-11-16 01:36:50 /Beacon/Ice: OFF
2016-11-16 01:36:53 /Beacon/Ice: ON
2016-11-16 01:40:59 /Beacon/Ice: OFF
2016-11-16 01:42:12 /Beacon/Ice: ON
2016-11-16 01:46:00 /Beacon/Ice: OFF

Note: "ON" corresponds to entering the region, "OFF" leaving it.

Always vibrates

I'm trying to get silent notifications on entry. Notifications work, but always vibrate even with the vibration slider off. I tried toggling it - had no effect.

When I shut off notifications completely, then turned them back on they were silent for a while, but started vibrating within 30 minutes again.

Actions not triggering

I have a Gimbal Series 10.
This device rotates the bluetooth mac address every X minutes.

It seems that the app uses the bluetooth mac address as a key to identify the beacon.
This means that when the mac address changes the actions are not triggering anymore. The app thinks that it is a new device.

If I perform a new scan, I find my beacon there but with a new mac address.
When I tap on the beacon it is added to the list as a different beacon.

Maybe this should be changed. The UUID should be the only key that identifies the device.
I will try to take a screenshot and add it here to make it more clear.

most apps cannot be started on event

when setting "ACTION":
Action Type: Start Application
Action Parameter: com.package.name

most application cannot be started by this way.
Is there some limitation or privileges problem?

Failed to resolve: support-compat

I download this code and open in my android studio but getting this error , try to solve many but not solve.

Failed to resolve: support-compat

My Android studio version is : 3.2.1 stable

Another request for more refined background scanning times

I think that with today's more efficient phones and batteries it would be good to have the option for shorter background scanning times. I certainly think 30 seconds would be advantageous to my usage requirements which is as a Presence sensor for home automation routines. I'd gladly pay for a pro version of the app that supports this option.

Add more than one event to a beacon

Currently I can only select "Enter region" or "Leave region" or "Beacon near you" as event, but not more than one of these. So, for example, for one beacon I cannot add an action for "Enter" and a different action for "Leave".

last version not working

Version 1.1.8 not working on OnePlus 5 with Android 8. Scan didn't discover any beacon.
Version 1.1.1: Scan discover the beacon, but didn't execute any action.

How to get Beacon Distance

what is the formula of getting distance

i found this function but i don't understand mManagedBeacon.getDistance() get distance getting value

public String getDistance() {
        return BeaconUtil.getRoundedDistanceString(mManagedBeacon.getDistance());
    }

is it work on rssi value and masurpower or other?

Please provide the formula of getting distance like this

fun Int.getDistance(txPower: Int): Double {
    return Math.pow(10.0, ((Math.abs(this) - Math.abs(txPower)) / (10 * 2)).toDouble())
}

Background scan not working

Hi,

I'm testing this out with the PyBeacon software (https://github.com/nirmankarta/PyBeacon) on my laptop and my HTC M7 (Android version 5.0.2). I can see the beacon just fine in a manual scan, but the background scan never seems to detect it and as such my actions aren't executed.

Any ideas? Happy to collect any debug logs, etc. you need.

No scan button

Hi,

Just tried the app 1.1.4 (F-droid build) on 3 different phones:

  • Moto X Style (Android 7.0)
  • Oukitel U2 (Android 5.1)
  • Sony Xperia E3 (Android 4.4)

There is no "scan button" available in the scan screen!

Version 1.19 still not working on Android 8

Version 1.1.9 not working on OnePlus 5 with Android 8. Scan didn't discover any beacon.
Version 1.1.8 not working on OnePlus 5 with Android 8. Scan didn't discover any beacon.
Version 1.1.1: Scan discover the beacon, but didn't execute any action.

Action Parameter for "Broadcast Intent" not sent?

I'm trying to send a "Broadcast Intent" when finding a specific beacon, using the Action parameter to identify the beacon. However, while the intent is received by the App "Automagic" without problems there seem to be no parameters attached to the intent, so I cannot distinguish the beacons.

You should also specify the complete name of the intent somewhere. Since I'm not an Android programmer it took me a while to guess the correct name com.somebits.beacon.locator.action.NOTIFY_BEACON_ENTERS_REGION ;-)

Add MQTT support

MQTT is an industry standard for home automation and machine 2 machine communication so it would be nice to have that implemented in your app to directly interface with home automation software.

Action type 'open url' not working

After update to new version, the action type 'open url' stopped working. Open weburl stil work, but i dont want to open a new browser window each time action is run.

AltBeacon is detected as iBeacon

Steps to reproduce

  1. Get in proximity of an AltBeacon (or simulate one).
  2. Scan for beacons.

Expected behaviour

Beacon is reported as an AltBeacon.

Actual behaviour

Beacon is detected as an iBeacon. The decoded values (UUID, major, minor) appear to be otherwise correct.

Other details

It looks like the issue is here:

@Override
public boolean isEddystone() {
return (getBeaconTypeCode() == TYPE_EDDYSTONE_UID)
|| (getBeaconTypeCode() == TYPE_EDDYSTONE_URL) || (getBeaconTypeCode() == TYPE_EDDYSTONE_TLM);
}
@Override
public BeaconType getBeaconType() {
if (isEddystone()) {
switch (getBeaconTypeCode()) {
case TYPE_IBEACON_ALTBEACON:
return BeaconType.ALTBEACON;
case TYPE_EDDYSTONE_TLM:
return BeaconType.EDDYSTONE_TLM;
case TYPE_EDDYSTONE_UID:
return BeaconType.EDDYSTONE_UID;
case TYPE_EDDYSTONE_URL:
return BeaconType.EDDYSTONE_URL;
default:
return BeaconType.EDDYSTONE;
}
}
return BeaconType.IBEACON;
}

TYPE_IBEACON_ALTBEACON is only tested in a switch statement if isEddystone() == true. But the tests in isEddystone already exclude TYPE_IBEACON_ALTBEACON.

Looking at the upstream matcher (m:2-3=beac), to test for AltBeacon you'd need to look for getBeaconTypeCode() == 0xBEAC.

Version tested

Version 1.2.2 (F-Droid)

OpenBeacon supported?

Beacon Locator's F-droid page says:

Scan, locate and track Bluetooth LE beacons (Eddystone, iBeacons or AltBeacons) allows you to define actions that will be triggered when a specified event occurs.

Can OpenBeacon also be used?

Crash in version 1.0.6

If you enable scanning in either the scan, and the rader tab, and than switch to the manage tab, the app will crash.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.