Question

I have downloaded a Geofence Sample Application form here but it is not working .I have replaced actions in GeofenceUtils class by putting app package name e.g com.example.android.geofence.ACTION_CONNECTION_ERROR is replaced by com.geofencesample.ACTION_CONNECTION_ERROR , here com.geofencesample is my app package name .I have put all the possible permissions regarding Location in manifest file , here is my manifest file .

MANIFEST FILE :

<?xml version="1.0" encoding="utf-8"?>

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.geofencesample"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="18" />
<!--
        Requests address-level location access, which is usually
        necessary for geofencing
-->

    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

    <uses-permission android:name="android.permission.VIBRATE"/>
    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS"/>
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
    <uses-permission android:name="android.permission.AUTHENTICATE_ACCOUNTS"/>
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
    <uses-permission android:name="android.permission.CHANGE_NETWORK_STATE"/>
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/title_activity_geofence" 
        android:theme="@style/AppTheme" >
        <activity
            android:name="com.geofencesample.MainActivity"
            android:label="@string/title_activity_geofence" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <!--
                    This activity should be linked to the app's Launcher icon
                 -->
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <service
             android:name="com.geofencesample.ReceiveTransitionsIntentService"
             android:exported="true" >
        </service>
    </application>

</manifest>

I am passing lattitude , logitude and radius(10m) of geofence through UI , After clicking on "Register geofence" button I am entering and exiting from geofence but nothing happens . I am not getting any notification or any vibrate alert (I have added it in MainActivity$GeofenceSampleReceiver.handleGeofenceTransition) . Which suitable fix should I do . Any help will be appreciated .

Was it helpful?

Solution

I have tested it using proper radius and app package name .Now App is working ,but in some cases it gives false entry notification . I am using Mock Locations provider app so that I can test it by keeping himself at a place . Still I am not getting proper notification .

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top