AutoLocation Customizable Geofence Responsiveness

Discussion in 'AutoApps' started by RicardoG, Jun 16, 2020.

  1. RicardoG

    RicardoG New Member

    Joined:
    Jun 28, 2019
    Messages:
    15
    Likes Received:
    1
    Hi Joao,

    I have been doing some research regarding geofences these days. Based on my tests it's true that enabling geofences seems monitors to request for locations more frequently than usual (about 20-25 requests per hour depending on whether the phone is active or slept, instead of 5-7 requests on normal usage). Documentation already says it: "Background apps can receive geofencing transition events more frequently than updates from the Fused Location Provider."

    Since in many cases we might want those request not to be as frequent as the default values (based on documentation, the latency is about 2-3 minutes on average, or near 6 if the phone was stacionary for a long time), could you implement "Notification Responsiveness" on AutoLocation? More info here:

    https://developers.google.com/andro...ce.Builder#setNotificationResponsiveness(int)

    Even though geofences are battery-friendly, a low latency could lead to more battery drain. And as documentation says: "Setting a big responsiveness value, for example 5 minutes, can save power significantly". Default value is 0. I think it could be very easy to implement, adding a textfield on AutoLocation and passing that info to that Geofence Builder's method.

    In my case, I would appreciate it, since I don't need a very high responsiveness for my geofences.

    Regards
     
    Last edited: Jun 16, 2020
  2. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,468
    Likes Received:
    795
  3. RicardoG

    RicardoG New Member

    Joined:
    Jun 28, 2019
    Messages:
    15
    Likes Received:
    1
    Hi Joao,

    Sorry for the delay, I didn't receive any email notifying your reply o_O

    I have tried your app and it crashes when trying to start geofence monitor (or adding a new geofence). This is the error:

    com.joaomgcd.autolocation version 1.2.3

    Source com.google.android.packageinstaller
    OS Build GM1903_14_200519
    OS Code 29
    Device GM1903
    Manufacturer OnePlus
    Product OnePlus7_EEA

    java.lang.ClassCastException: java.lang.Boolean cannot be cast to java.lang.String
    at android.app.SharedPreferencesImpl.getString(SharedPreferencesImpl.java:288)
    at com.joaomgcd.common.w.c(SourceFile:148)
    at com.joaomgcd.common.aq.a(SourceFile:36)
    at com.joaomgcd.autolocation.a.f.a(Unknown Source:8)
    at com.joaomgcd.autolocation.a.f.b(SourceFile:6)
    at com.joaomgcd.autolocation.a.b.i(SourceFile:242)
    at com.joaomgcd.autolocation.util.e.a(SourceFile:119)
    at com.joaomgcd.autolocation.util.e.a(SourceFile:32)
    at com.joaomgcd.autolocation.util.r.a(SourceFile:113)
    at com.joaomgcd.autolocation.util.r.b(SourceFile:148)
    at com.joaomgcd.autolocation.activity.ActivityMain$3$1.a(SourceFile:122)
    at com.joaomgcd.autolocation.activity.ActivityMain$3$1.run(SourceFile:117)
    at com.joaomgcd.autolocation.util.r.<init>(SourceFile:55)
    at com.joaomgcd.autolocation.util.e.<init>(SourceFile:38)
    at com.joaomgcd.autolocation.util.e.a(SourceFile:46)
    at com.joaomgcd.autolocation.activity.ActivityMain$3.onPreferenceClick(SourceFile:117)
    at android.preference.Preference.performClick(Preference.java:1165)
    at android.preference.PreferenceScreen.onItemClick(PreferenceScreen.java:260)
    at android.widget.AdapterView.performItemClick(AdapterView.java:330)
    at android.widget.AbsListView.performItemClick(AbsListView.java:1257)
    at android.widget.AbsListView$PerformClick.run(AbsListView.java:3265)
    at android.os.Handler.handleCallback(Handler.java:883)
    at android.os.Handler.dispatchMessage(Handler.java:100)
    at android.os.Looper.loop(Looper.java:214)
    at android.app.ActivityThread.main(ActivityThread.java:7710)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:516)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)


    I don't know if it's related to that crash but, where is it supposed to be introduced the geofence responsiveness? I have seen the option to enable/disable it on "Advanced" but not the option to customize the responsiveness in millis.

    By the way, I have seen a minor but which I think it's there too on older version:

    This is how the dialog appears when selecting first geofence:

    upload_2020-7-1_18-49-16.png


    And this is how the dialog appears when selecting latest geofence on the list:

    upload_2020-7-1_18-50-20.png

    This is a minor error, not a problem, just to let you know :)

    Regards and thank you very much again.
     
    virtual likes this.
  4. RicardoG

    RicardoG New Member

    Joined:
    Jun 28, 2019
    Messages:
    15
    Likes Received:
    1
  5. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,468
    Likes Received:
    795

Share This Page