Semper-Viventem / MetaRadar

The app for BLE ether monitoring tracks your environment, finds some devices, makes relations between devices around you, and tracks devices' movements.
GNU General Public License v3.0
560 stars 28 forks source link

Add ability to scan for devices without turning on location and cell network. #116

Open Username1111111111 opened 8 months ago

Username1111111111 commented 8 months ago

The location and map are not needed generally to scan nearest devices. Sometimes it hurts the privacy and completely not needed. In case of creating map locations leave turning ON as required. Just not to force user to turn it on.

Semper-Viventem commented 8 months ago

The location and map are not needed generally to scan nearest devices.

I'm working on the feature Network Silent Mode which allows you to disable the map and any network connections when turned on. It will save the traffic and reduce your activity in the network.

Talking about location permission - it is not possible to work with Bluetooth without location permission based on the Android privacy rules. Also, the main purpose of the app is to analyze device location as well. So this permission will not be removed or disabled.

Username1111111111 commented 8 months ago

I don't know much about Android privacy rules, but it seems like google forces you as developer to use the location permission otherwise bluetooth API won't work at all, right? Or is this only related to not being able to publish app on google store (not F-droid) if you violate those rules in your app?

Semper-Viventem commented 8 months ago

@Username1111111111 This is the system-level policy. The app cannot have access to Bluetooth without the location permission. It makes sense because you can heuristically detect the approximate location based on the Bluetooth and Wi-Fi environment. Some apps did that before.

Semper-Viventem commented 8 months ago

Also the offline mode will be available since the version 23.0-beta: https://github.com/Semper-Viventem/MetaRadar/issues/112#issuecomment-1957586834

jayb-g commented 3 months ago

Talking about location permission - it is not possible to work with Bluetooth without location permission based on the Android privacy rules. Also, the main purpose of the app is to analyze device location as well. So this permission will not be removed or disabled.

@Semper-Viventem I have seen this reply on multiple issues. Came here for same to check if other people have the same issue having their location accessed, say every few mins if scan frequency is higher. This ultimately leads to very high battery usage and not desired. According to the link you always refer to bt-permissions itself indicates ACCESS_FINE_LOCATION is required only in case of Android 11 or lower. Also see this

I already use Apps like Gadgebride and Garmin Connect, Amazon Music, all of them have nearby devices permission, But they work fine without allowing location permission ever. ie they automatically detect and connect to watch/preferred speaker when nearby without having to access location.

All this to say, that it is indeed possible to be able to use Nearby permission without location. Besides, for Android 11 or lower, app has to have the location permission granted but not really need to use it if user wants to use BLE Radar as just that - RADAR which shows nearby devices without need to know their GPS location. In general, Radar shows relative position and I understand that mapping devices is a stated feature but it can be made optional only for those who want to use it. Rest of us can use it as just RADAR.

Don't get me wrong. I love the App. It's just amazing. But constant(whatever BLE scan frequency you have set) location access in the background drains my battery fast and makes the app and features useless.

Semper-Viventem commented 3 months ago

Hey @jayb-g , thank you for your noticing. Your proposal sounds reasonable, I'll try to support optional location permission

jayb-g commented 3 months ago

@Semper-Viventem I also stumbled upon OwnTracks which mentions:

We'd like you to read this bit again: waits for the smart phone to tell it that the device has moved.

Which means you can implement something similar to make 'device is following me' feature work even when location permissions are not granted. I'm assuming currently this feature does use location to detect if user device has moved and some other device is still nearby and hence considered following it.

Semper-Viventem commented 3 months ago

@jayb-g the problem is that phone acceleration sensors could consume the battery even more than location. Also I'm not completely sure that it doesn't require any access as well.

jayb-g commented 3 months ago

@Semper-Viventem I'm not sure that might be the case since doesn't the phone have some sensor always enabled already, to detect for example, when you pick up the phone or detect automatically that you're in a vehicle.? The sensor is already ON, app just accesses it when needed. The power consumption(shouldn't be much) results from your app running and registered for sensor events. So really depends what the app really does after the events. If there are network events triggered by the sensor event(eg app wants to upload any info to server immediately), then battery consumption could potentially be high and keep the device from sleeping.

Again, I'm not sure. Just speculating.

jayb-g commented 3 months ago

@Semper-Viventem Also checkout your local weather.

Update by accelerometer: Location is updated by a distance counted by accelerometer. When distance is longer then minimal value for update, application update your location. Distance derived by accelerometer depends on the way how you carry your phone - when you carry your phone in a pocket the distance is increases faster - the phone is moving back and forth as you go. The weather is updated immediately after the update of location. The weather is updated when screen goes on too - but not more often then once per 15 minutes (and when weather is not updated in the last 15 minutes).