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

RxAndroidBle on Android Wear #142

Closed
jcamins opened this issue Feb 26, 2017 · 19 comments
Closed

RxAndroidBle on Android Wear #142

jcamins opened this issue Feb 26, 2017 · 19 comments

Comments

@jcamins
Copy link

jcamins commented Feb 26, 2017

Summary

When I use the example scanning code from the website, I get a LOCATION_SERVICES_DISABLED error, even though when I go into the developer options, location says it is turned on. However, per the documentation (https://developer.android.com/training/articles/wear-location-detection.html#Connect), regular location services should not be used on Android Wear devices, and there does not seem to be any way to disable RxAndroidBle's location services check.

@jcamins
Copy link
Author

jcamins commented Feb 26, 2017

I confirmed that I could make the scan work by simply commenting out the location services check, but that doesn't really seem like something that should be upstreamed.

@uKL
Copy link
Collaborator

uKL commented Feb 27, 2017

Hey! Thanks for trying the library on Android Wear. Frankly speaking, we didn't test in on the Wear. Validators you are mentioning are strictly for Android. We will talk about it internally how we can resolve the problem.

If you have any ideas please don't hesitate to mention them.

@dariuszseweryn
Copy link
Owner

Hello @jcamins
I think you that you have mixed the Location options available. The location needed (or supposed) to be on is under normal Settings - not under the Developer Options.
The application does not really use the Location Services - it only checks wether they are on.
Why commenting out the check has helped is described here #106 but for now we cannot be certain wether this check is needed or not for a particular device - so it is always on as this may lead to tracking app user's location.
If you will have an idea how to solve the problem without using whitelisting / blacklisting - feel free to speak up.
Best Regards

@jcamins
Copy link
Author

jcamins commented Mar 1, 2017

@DariuszAniszewski the only location option I can find on Android Wear is under Developer Options. Which makes sense, since Android Wear doesn't support location services at all.

So I guess the fact that you closed this means that you're officially not supporting Android Wear? That's a shame.

@dariuszseweryn
Copy link
Owner

I am @dariuszseweryn ;)
I am developing on Sony SmartWatch 3 - quite old but that is the only one I have at the moment. When I go to the Settings - just under Bluetooth switch - I see Location - this one has to be on.
Seems to work on Android Wear. I will check with other watches but I do not expect a different behaviour. Feel free to provide more information if you think that something is wrong.

@dariuszseweryn
Copy link
Owner

@jcamins You could add what watch do you use so I could check what is your case.

@jcamins
Copy link
Author

jcamins commented Mar 1, 2017

@dariuszseweryn sorry about that. GitHub autocompleted for me, apparently to the wrong person. My Asus ZenWatch 2 does not have a Location option in the main settings screen, and the one in the Developer Options doesn't seem to do anything (and doesn't seem like a reasonable thing to ask users to find, anyway). Your watch would seem to contradict the documentation, which says that location services are not available on Android Wear. Do you have Android Wear 2.0? Maybe support for location services is changing with AW 2.0.

@dariuszseweryn
Copy link
Owner

dariuszseweryn commented Mar 1, 2017

Sony SmartWatch 3 is definitely Android Wear 1.5 (API 23)
I am trying to get access LG Watch Urbane - there is a chance to grab one tomorrow.
I have also checked the emulator with API 23 - it indeed does not have the Location setting - need to dig deeper.

@jcamins
Copy link
Author

jcamins commented Mar 2, 2017

How do I check the API version? I have Android Wear 1.5, but I don't know how to check API version.

@jcamins
Copy link
Author

jcamins commented Mar 2, 2017

Also, does your Sony SmartWatch 3 require location services? Maybe we could just check whether the user is on Wear when deciding whether or not to throw if the services are not enabled?

@dariuszseweryn
Copy link
Owner

If it is not visible in the About Settings page - you can connect your watch to the computer and the Android Studio lists the current API level - then compare with wikipedia Android Wear topic.

Sony SmartWatch 3 does not require location services to be turned on to get BLE scan results though the situation is the same as in #106 and I did not found any official guides for BLE scanning on Android Wear yet.

@jcamins
Copy link
Author

jcamins commented Mar 2, 2017

Ah, right. It wasn't in the settings, but according to Android Studio, ZenWatch 2 is also API 23.

@dariuszseweryn
Copy link
Owner

It seems that Sony SmartWatch 3 is having a GPS receiver. It would explain why Location setting is available.

Still - we should find some official guidelines about when we should allow scan on Android Wear - google groups discussion would be sufficient. @jcamins if you have a moment - you could try to find something. I have different project at the moment on my plate.

Best Regards

@jcamins
Copy link
Author

jcamins commented Mar 2, 2017

I couldn't find anything about BLE on Android Wear online. Probably because AW 1 is intended to be used in concert with a phone.

@dariuszseweryn
Copy link
Owner

I do not have an idea. I am trying to reach someone from Google to shed some light.

@viktoschi
Copy link

You need Location permission for scanning BT devices.
My advice is to use The Scanner from setting Menü. Boundcon BT device. And in your App get The bounded devices and Connect to Them.
Appart from that habe a Look at this
https://github.com/NightscoutFoundation/xDrip/blob/master/wear/src/main/java/com/eveningoutpost/dexdrip/LocationPermissionActivity.java
Maybe ist is what you are looking for

@jcamins
Copy link
Author

jcamins commented Mar 13, 2017

@LadyViktoria the issue here is not location permissions, which I was able to grant, but rather location services, which are not necessarily available at all on Android Wear.

dariuszseweryn added a commit that referenced this issue Mar 23, 2017
…o start scan even if Location Services are off (or unavailable due to lack of GPS).

Summary: #142

Reviewers: pawel.urban

Reviewed By: pawel.urban

Differential Revision: https://phabricator.polidea.com/D2253
@dariuszseweryn
Copy link
Owner

@jcamins I have just pushed a commit that should fix your issue with Android Wear. Feel free to give feedback and reopen if necessary.

@MGasztold
Copy link

MGasztold commented Jul 30, 2019

Does anybody know a modern (2017/2018/2019) android wear BUDGET smart watch for which it is possible to develop apps leveraging Bluetooth Low Energy communication with custom BLE devices?

I am confused because I struggle to find anything. Anybody can share some experience and point some particular easy to buy smart watch model? Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants