FYI: "Nothing is working" is not a very helpful problem description.

I just fired up a quick test with Geofencing on Android 6 (Nexus 5) to make
sure it is working.  It appeared to be working OK.

I used mock locations to do the testing.  (See this SO comment for
instructions: http://stackoverflow.com/a/29414735/2935174)

Here is the test app:

https://gist.github.com/shannah/5fefa4b322f9c19d088788b57dd9ec2a

I didn't have to add any special build hints, except the MOCK_LOCATION
permission as described in that SO comment to get mock locations working.

Stebe


On Fri, Apr 7, 2017 at 4:14 AM, <[email protected]> wrote:

> steve :
>
> Nothing its working , my android.xpermissions is <uses-permission
> android:name="android.permission.ACCESS_NETWORK_STATE"/> <uses-permission
> android:name="com.google.android.providers.gsf.
> permission.READ_GSERVICES"/><uses-feature         
> android:glEsVersion="0x00020000"
> android:required="true"/><uses-permission android:name="android.
> permission.ACCESS_NETWORK_STATE"/><uses-permission android:name="android.
> permission.ACCESS_WIFI_STATE"/><uses-permission android:name="android.
> permission.BLUETOOTH"/><uses-permission android:name="android.
> permission.BLUETOOTH_ADMIN"/><uses-permission android:name="android.
> permission.ACCESS_FINE_LOCATION"/>
>
> any idea?
>
> thanks
>
> On Thursday, April 6, 2017 at 2:02:25 PM UTC-3, Steve Hannah wrote:
>>
>> It has been a while since I've worked with Geofence on Android.  The
>> Android docs for the GEOFENCE_NOT_AVAILABLE status code says:
>>
>> public static final int *GEOFENCE_NOT_AVAILABLE*
>>>
>>> Geofence service is not available now. Typically this is because the
>>> user turned off location access in settings > location access.
>>> Constant Value: 1000
>>>
>>
>>
>> So check to make sure that you haven't turned off location access.
>>
>> Also check that the app includes the ACCESS_FINE_LOCATION permission:
>>
>> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
>>
>> (Open the app's manifest and make sure that permission is there, if it
>> isn't there, then you should add it using the android.xpermissions build
>> hint.
>>
>> Let me know if it's not there, as I may need to modify the build server
>> to automatically add it when geofence is used.
>>
>> Best regards
>>
>> Steve
>>
>> On Wed, Apr 5, 2017 at 7:07 PM, <[email protected]> wrote:
>>
>>> Steve: i tryed with android 4.4 and i get the message that geofence its
>>> not avalaible.
>>>
>>> my question was about android version.
>>>
>>>
>>>
>>> thanks
>>>
>>> On Wednesday, April 5, 2017 at 2:42:23 PM UTC-3, Steve Hannah wrote:
>>>>
>>>> It was added in October 2015, so it would have been included with
>>>> Codename One 3.3 and later.
>>>>
>>>> Geofence, like most background functionality, can be tricky to debug.
>>>> You'll want to use DDMS to debug and see where your app is going wrong.
>>>>
>>>> Steve
>>>>
>>>> On Wed, Apr 5, 2017 at 10:20 AM, <[email protected]> wrote:
>>>>
>>>>> steve: i tryed but i cant  make it work.
>>>>>
>>>>> do you know since what version of android works the geofence?
>>>>>
>>>>>
>>>>> On Tuesday, April 4, 2017 at 1:11:49 PM UTC-3, roman canoniero wrote:
>>>>>>
>>>>>> Ill check your answear. Thanks
>>>>>> El El mar, 4 de abr. de 2017 a las 13:10, Steve Hannah <
>>>>>> [email protected]> escribió:
>>>>>>
>>>>>>> Geofence isn't implemented in the simulator.  Only on iOS and
>>>>>>> Android.
>>>>>>>
>>>>>>> Steve
>>>>>>>
>>>>>>> On Tue, Apr 4, 2017 at 9:07 AM, roman canoniero <
>>>>>>> [email protected]> wrote:
>>>>>>>
>>>>>>>> Steve: geofence still not working on simulator?? Thanks!
>>>>>>>>
>>>>>>>>
>>>>>>>> El El mar, 4 de abr. de 2017 a las 12:53, Steve Hannah <
>>>>>>>> [email protected]> escribió:
>>>>>>>>
>>>>>>>>> I think you have your "isMinimized()" case reversed.
>>>>>>>>>
>>>>>>>>> if (Display.getInstance().isMinimized()) {
>>>>>>>>>             Display.getInstance().callSerially(() -> {
>>>>>>>>>                 Dialog.show("Welcome", "Thanks for arriving",
>>>>>>>>> "OK", null);
>>>>>>>>>             });
>>>>>>>>>         } else {
>>>>>>>>>             LocalNotification ln = new LocalNotification();
>>>>>>>>>             ln.setId("LnMessage");
>>>>>>>>>             ln.setAlertTitle("Welcome");
>>>>>>>>>             ln.setAlertBody("Thanks for arriving!");
>>>>>>>>>             try {
>>>>>>>>>                 Display.getInstance().scheduleLocalNotification(ln,
>>>>>>>>> 10, LocalNotification.REPEAT_NONE);
>>>>>>>>>             } catch (Exception ex) {
>>>>>>>>>                 Alert.show(ex.getMessage());
>>>>>>>>>             }
>>>>>>>>>
>>>>>>>>>         }
>>>>>>>>>
>>>>>>>>> You're trying to show a dialog when the app is minimized, and
>>>>>>>>> you're trying to send a local notification when it is not minimized.
>>>>>>>>>
>>>>>>>>> Steve
>>>>>>>>>
>>>>>>>>> On Mon, Apr 3, 2017 at 6:26 PM, <[email protected]> wrote:
>>>>>>>>>
>>>>>>>>>> Hi! im tryng to implement the geofence in my code but it didnt
>>>>>>>>>> work. is a problem in the class or i'm no doing something?  im 
>>>>>>>>>> testing on
>>>>>>>>>> android.
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> my code is attached
>>>>>>>>>>
>>>>>>>>>> thanks! Roman
>>>>>>>>>>
>>>>>>>>>> --
>>>>>>>>>> You received this message because you are subscribed to the
>>>>>>>>>> Google Groups "CodenameOne Discussions" group.
>>>>>>>>>> To unsubscribe from this group and stop receiving emails from it,
>>>>>>>>>> send an email to codenameone-discussions+unsubs
>>>>>>>>>> [email protected].
>>>>>>>>>> Visit this group at https://groups.google.com/grou
>>>>>>>>>> p/codenameone-discussions.
>>>>>>>>>> To view this discussion on the web visit
>>>>>>>>>> https://groups.google.com/d/msgid/codenameone-discussions/64
>>>>>>>>>> 73483c-1e37-4397-a4a6-73c411081f2c%40googlegroups.com
>>>>>>>>>> <https://groups.google.com/d/msgid/codenameone-discussions/6473483c-1e37-4397-a4a6-73c411081f2c%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>>>>>>> .
>>>>>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> --
>>>>>>>>> Steve Hannah
>>>>>>>>> Software Developer
>>>>>>>>> Codename One
>>>>>>>>> http://www.codenameone.com
>>>>>>>>>
>>>>>>>>> --
>>>>>>>>> You received this message because you are subscribed to a topic in
>>>>>>>>> the Google Groups "CodenameOne Discussions" group.
>>>>>>>>> To unsubscribe from this topic, visit
>>>>>>>>> https://groups.google.com/d/topic/codenameone-discussions/xG
>>>>>>>>> 9tFYglvgg/unsubscribe.
>>>>>>>>> To unsubscribe from this group and all its topics, send an email
>>>>>>>>> to [email protected].
>>>>>>>>> Visit this group at https://groups.google.com/grou
>>>>>>>>> p/codenameone-discussions.
>>>>>>>>> To view this discussion on the web visit
>>>>>>>>> https://groups.google.com/d/msgid/codenameone-discussions/CA
>>>>>>>>> GOYrKWF_8jr2sjO5onXnWtuvm%3DJXr4ofUBTAvdpeO7J7pxAXA%40mail.
>>>>>>>>> gmail.com
>>>>>>>>> <https://groups.google.com/d/msgid/codenameone-discussions/CAGOYrKWF_8jr2sjO5onXnWtuvm%3DJXr4ofUBTAvdpeO7J7pxAXA%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>>>>>>> .
>>>>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>>>>>
>>>>>>>> --
>>>>>>>> You received this message because you are subscribed to the Google
>>>>>>>> Groups "CodenameOne Discussions" group.
>>>>>>>> To unsubscribe from this group and stop receiving emails from it,
>>>>>>>> send an email to codenameone-discussions+unsubs
>>>>>>>> [email protected].
>>>>>>>> Visit this group at https://groups.google.com/grou
>>>>>>>> p/codenameone-discussions.
>>>>>>>>
>>>>>>> To view this discussion on the web visit
>>>>>>>> https://groups.google.com/d/msgid/codenameone-discussions/CA
>>>>>>>> O%3DXYf1JBP_HKp%3D9kBk2eh3dYr-SQe7EO93_pFvSHZ4cRVEJ%2BA%
>>>>>>>> 40mail.gmail.com
>>>>>>>> <https://groups.google.com/d/msgid/codenameone-discussions/CAO%3DXYf1JBP_HKp%3D9kBk2eh3dYr-SQe7EO93_pFvSHZ4cRVEJ%2BA%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>>>>>> .
>>>>>>>
>>>>>>>
>>>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> Steve Hannah
>>>>>>> Software Developer
>>>>>>> Codename One
>>>>>>> http://www.codenameone.com
>>>>>>>
>>>>>>> --
>>>>>>> You received this message because you are subscribed to a topic in
>>>>>>> the Google Groups "CodenameOne Discussions" group.
>>>>>>> To unsubscribe from this topic, visit https://groups.google.com/d/to
>>>>>>> pic/codenameone-discussions/xG9tFYglvgg/unsubscribe.
>>>>>>> To unsubscribe from this group and all its topics, send an email to
>>>>>>> [email protected].
>>>>>>> Visit this group at https://groups.google.com/grou
>>>>>>> p/codenameone-discussions.
>>>>>>> To view this discussion on the web visit
>>>>>>> https://groups.google.com/d/msgid/codenameone-discussions/CA
>>>>>>> GOYrKUB3z4-AjqvgT3mHPjKMTDrz%2BO1VuKNXZorz7KHoaRx6g%40mail.gmail.com
>>>>>>> <https://groups.google.com/d/msgid/codenameone-discussions/CAGOYrKUB3z4-AjqvgT3mHPjKMTDrz%2BO1VuKNXZorz7KHoaRx6g%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>>>>> .
>>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>>>
>>>>>> --
>>>>> You received this message because you are subscribed to the Google
>>>>> Groups "CodenameOne Discussions" group.
>>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>>> an email to [email protected].
>>>>> Visit this group at https://groups.google.com/grou
>>>>> p/codenameone-discussions.
>>>>> To view this discussion on the web visit
>>>>> https://groups.google.com/d/msgid/codenameone-discussions/48
>>>>> 4a2b10-afe0-47d7-9bd4-0519ebf928aa%40googlegroups.com
>>>>> <https://groups.google.com/d/msgid/codenameone-discussions/484a2b10-afe0-47d7-9bd4-0519ebf928aa%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>> .
>>>>>
>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Steve Hannah
>>>> Software Developer
>>>> Codename One
>>>> http://www.codenameone.com
>>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "CodenameOne Discussions" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to [email protected].
>>> Visit this group at https://groups.google.com/grou
>>> p/codenameone-discussions.
>>> To view this discussion on the web visit https://groups.google.com/d/ms
>>> gid/codenameone-discussions/a8aaea52-4c5c-4565-b01c-25c4ce04
>>> 3b60%40googlegroups.com
>>> <https://groups.google.com/d/msgid/codenameone-discussions/a8aaea52-4c5c-4565-b01c-25c4ce043b60%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>>
>> --
>> Steve Hannah
>> Software Developer
>> Codename One
>> http://www.codenameone.com
>>
> --
> You received this message because you are subscribed to the Google Groups
> "CodenameOne Discussions" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> Visit this group at https://groups.google.com/
> group/codenameone-discussions.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/codenameone-discussions/046d677b-aaad-4618-9471-
> 9140524a5a84%40googlegroups.com
> <https://groups.google.com/d/msgid/codenameone-discussions/046d677b-aaad-4618-9471-9140524a5a84%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Steve Hannah
Software Developer
Codename One
http://www.codenameone.com

-- 
You received this message because you are subscribed to the Google Groups 
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/codenameone-discussions/CAGOYrKVuZ%3DuwHmM0p72dYUXme5yzReTc%2B1rd%3D%2BUrGDPBw9v23g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to