Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add beacon based sitemap selection #213 #252

Closed

Conversation

fspiekermann
Copy link
Contributor

@fspiekermann fspiekermann commented Nov 25, 2016

I added beacon based sitemap selection, like described in Feature Proposal [#213].

Implements Bluetooth low energy (BLE) support for beacons in 'AbstractLocateBeacons'. Based on the Android version the 'MainActivity' will create a 'LocateBeaconsTask' with the belonging BLE API. To show the beacons, a new fragment ('NearRooms') is created. The location of a beacon is set in 'OpenHABWriteBeaconActivity', like a NFC-Tag. The 'BluetoothStateBroadcastReceiver' checks whether the user turns off Bluetooth while scanning for beacons and hold the 'Bluetoothadapter' enabled until the BLE scanner is shut down. The 'BeaconHandler' will handle the known and founded beacons for the whole system.

I have added two new menu items, one to start the localization and one to set the actual sitemap to the Beacon. menuItems. To set the beacon position an activity was created, which looks like the one from NFC-Tag. In the 'NearRoom' fragment it is possible to get an overview of all near beacons. Unknown beacons get the name 'UNKOWN'.
NearRooms setBeacon

Fabio Spiekermann added 3 commits November 25, 2016 08:40
Implements Bluetooth low energy (BLE) support for beacons in AbstractLocateBeacons. Based on the Android version the MainActivity will create a LocateBeaconsTask with the belonging BLE API. To show the beacons, a new fragment (NearRooms) is created. The location of a beacon is set in OpenHABWriteBeaconActivity, like a NFC-Tag. The BluetoothStateBroadcastReceiver checks whether the user turns off Bluetooth while scanning for beacons and hold the Bluetoothadapter enabled until the BLE scanner is shut down. The BeaconHandler will handle the known and founded beacons for the whole system.
Implements Bluetooth low energy (BLE) support for beacons in AbstractLocateBeacons. Based on the Android version the MainActivity will create a LocateBeaconsTask with the belonging BLE API. To show the beacons, a new fragment (NearRooms) is created. The location of a beacon is set in OpenHABWriteBeaconActivity, like a NFC-Tag. The BluetoothStateBroadcastReceiver checks whether the user turns off Bluetooth while scanning for beacons and hold the Bluetoothadapter enabled until the BLE scanner is shut down. The BeaconHandler will handle the known and founded beacons for the whole system.
…213-beacon-based-sitemaps

# Conflicts:
#	mobile/src/main/java/org/openhab/habdroid/ui/OpenHABMainActivity.java
#	mobile/src/main/java/org/openhab/habdroid/util/Constants.java
#	mobile/src/main/res/values-de/strings.xml
@digitaldan
Copy link
Contributor

Hi thanks for the PR, I'm a little busy over the next few days, but I hope to get to it over the weekend.

@digitaldan
Copy link
Contributor

Hi, couple of comments before I go through the code.

  1. pressing "Set Beacon position" crashes the app ( i don't have a beacon yet discovered).
  2. I managed to link to a RadBeacon, but at first it was not clear when trying to "save" a beacon what was happening (there was this small line that said something like "click here" but it was buried in text).
  3. I linked a sitemap page to a beacons, but now what? Not sure what is suppose to happen. I would expect that if the app opens and is near a beacon it would go to that sitemap fragment?
  4. How do I remove a beacon so I can scan and link again?
  5. What does locate in the menu do? is this needed to discover beacons? Or is this required to to locate beacons you have already added or both? Should this be in the preference menu instead (enable bluetooth proximity) ?

@fspiekermann
Copy link
Contributor Author

Hi,

  1. That the app crashes, by pressing "Set Beacon position", I can't rebuild. In all my tests it never happened. Could you tell me when it happens?
  2. The "Set Beacon position" activity I have to revise. I have done some usability tests for this activity and the most of the test persons couldn't get the functionality. At the moment the nearest Beacon will be set to the last Sitemap fragment. I am thinking about a dropdown-menu to choose which beacon will be set. Further on there have to be a better response after setting a beacon and the text have to be more understandable.
  3. At the moment it isn't possible to remove a beacon, it only can be overwritten, when it is set to a new Sitemap fragment.
    3/5. Locate starts the Bluetooth scan. So Beacons will be discovered and ordered by the distance. If the nearest Beacon is link to a Sitemap Fragment, the App will change to the linked fragment, but only when the app is open. So Locate is both, discovery und locate.
    I put it in the menu, that the user will be able to start/stop the location without switching to the preference menu

At the moment I am very busy, writing my Bachelor thesis, but after it I am looking forward to work on it

mueller-ma and others added 6 commits February 9, 2017 11:29
* Modified encoding of passwords. Loading of images failed if the password contains a line terminator.

* Improved error handling in case of http response code greater or equal 400
Signed-off-by: Volker Daube <vd-github@online.de> (github: Snickermicker)
Signed-off-by: Wouter Born <eclipse@maindrain.net>
Implements Bluetooth low energy (BLE) support for beacons in
AbstractLocateBeacons. Based on the Android version the MainActivity
will create a LocateBeaconsTask with the belonging BLE API. To show the
beacons, a new fragment (NearRooms) is created. The shown beacons are
clickable to manage the beacon or change to the belonging sitemap
fragment. The location of a beacon is set in OpenHABWriteBeaconActivity,
like a NFC-Tag. The BluetoothStateBroadcastReceiver checks whether the
user turns off Bluetooth while scanning for beacons and hold the
Bluetoothadapter enabled until the BLE scanner is shut down. The
BeaconHandler will handle the known and founded beacons for the whole
system.
@fspiekermann
Copy link
Contributor Author

Hi,

1.) I have added longclick functions to NearRoomFragment, to remove or edit a beacon.

2.) Before setting a beacon, a list of all near beacons is shown, to choose the beacon which will be set.
3.) I added dropdown menus for Sitemap and Group in OpenHABWriteBeaconActivity.

4.) After this changes the App should not crash, after clicking set Beacon Position.

@digitaldan digitaldan closed this Jun 19, 2017
@kaikreuzer
Copy link
Member

It seems to me that this had been closed by accident (which is a pity as it is imho a wonderful feature).

@fspiekermann Are you still around (even a year after finishing your thesis) and not too upset that you have never got further feedback here? If so I'd love to revive it as the Android app has gained some new momentum (thanks to @mueller-ma and @maniac103!). Wdyt?

@mueller-ma
Copy link
Member

This sounds like a very interessting feature. I'll reopen it

@mueller-ma mueller-ma reopened this Apr 21, 2018
@stickler-ci
Copy link

I couldn't find a .stickler.yml file in this repository. I can make one for you, or you can create one by following the documentation.

@kthoms
Copy link

kthoms commented Apr 21, 2018

Note that @fspiekermann is currently writing his master thesis on a different topic. So time is very limited and he might need support to work together on this. Let‘s see what he can tell.

@kaikreuzer
Copy link
Member

currently writing his master thesis on a different topic. So time is very limited

Haha, I would think that time constraints will be much worse once he isn't a student anymore, but takes on a job :-)

@Tony080
Copy link

Tony080 commented Apr 24, 2018

Hello, My name is Chengzhi Hu. I'm a graduate student interested in this PR and I'm also enrolled in Eclipse "Integrate openHAB with Google's Physical Web" project from GSoC.
For now, I have merged openHAB master and this PR branch into my local git. And I have done some dummy staffs of reading URL from Eddystone beacons.
I'll move this PR forward and finish what @fspiekermann wish to do.

@mueller-ma
Copy link
Member

mueller-ma commented Apr 25, 2018

Hey, sounds great. Please note that some modifications have to be made, e.g. not adding strings to values-* directories and using autovalue for OpenhabBeacons.java

@Tony080
Copy link

Tony080 commented Apr 25, 2018

@mueller-ma Thanks for the notifications.
I understand that I can only add English values if necessary during development. For other languages translations, I have to go Crowdin to submit my suggestions. BTW, I have already submitted some Chinese translation suggestions on Crowdin.
I'll follow your notice and read the contribution guidelines carefully in case I mess up the code.

@kaikreuzer
Copy link
Member

This is superseded by #880.

@kaikreuzer kaikreuzer closed this May 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

10 participants