Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8039795
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T03:41:25+00:00 2026-06-05T03:41:25+00:00

In my android app i am using Latest Geoloqi API to implement Geofence concept.when

  • 0

In my android app i am using Latest Geoloqi API to implement Geofence concept.when user entered into some region he has notify, for that purpose i am using Push Notifications.in GeoReceiver class three callback methods are calling but not onPushMessageReceived().please help me how to do it?
I am creating trigger with current location is it required to enter into region manually or since i am already in the location its not calling?
Note:I ve given required credentials in assets/geoloqi.properties file.when app is launched in logcat “Successfully registered for the C2DM service” msg also displayed.my code:

GeoloqiExampleActivity.java

public class GeoloqiExampleActivity extends Activity{
    String TAG = "Geoloqi Example";

     private LQService mService;
     private boolean mBound;
     GeoReceiver geoReceiver = new GeoReceiver();
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        Intent intent = new Intent(this, LQService.class);
        startService(intent);
    }


    @Override
    public void onResume() {
        super.onResume();

        // Bind to the tracking service so we can call public methods on it
        Intent intent = new Intent(this, LQService.class);
        bindService(intent, mConnection, 0);

        // Wire up the sample location receiver
        final IntentFilter filter = new IntentFilter();
        filter.addAction(GeoReceiver.ACTION_LOCATION_CHANGED);
        filter.addAction(GeoReceiver.ACTION_TRACKER_PROFILE_CHANGED);
        filter.addAction(GeoReceiver.ACTION_LOCATION_UPLOADED);
        filter.addAction(GeoReceiver.ACTION_PUSH_MESSAGE_RECEIVED);
        registerReceiver(geoReceiver, filter);

    }

    @Override
    public void onPause() {
        super.onPause();

        // Unbind from LQService
        if (mBound) {
            unbindService(mConnection);
            mBound = false;
        }
        // Unregister our location receiver
        unregisterReceiver(geoReceiver);
    }
    public void sendRequest() {

         // Performing a Trigger POST request
        if (mService != null) {
            LQSession session = mService.getSession();
            LQTracker tracker = mService.getTracker();
            tracker.setSession(session);
            // Build your request
            JSONObject trigger = new JSONObject();
            try {
                trigger.put("text", "Popcornapps");
                trigger.put("type", "message");
                trigger.put("latitude", 17.42557068);
                trigger.put("longitude",  78.42022822);
                trigger.put("radius", 500);
                trigger.put("place_name", "Banjara Hills");
            } catch (JSONException e) {
               Log.d(TAG, e.getMessage());
            }

            // Send the request
            session.runPostRequest("trigger/create", trigger, new OnRunApiRequestListener() {
                @Override
                public void onSuccess(LQSession session, HttpResponse response) {

                    Toast.makeText(GeoloqiExampleActivity.this, "Success", Toast.LENGTH_SHORT).show();
                    try {
                        BufferedReader reader = new BufferedReader(new InputStreamReader(response.getEntity().getContent(), "UTF-8"));
                        StringBuilder s = new StringBuilder();
                        String sResponse;
                        while ((sResponse = reader.readLine()) != null) {
                            s = s.append(sResponse);
                        }
                    String result = s.toString().trim();
                    Log.d("On success Result", result);

                    } catch (UnsupportedEncodingException e) {
                        e.printStackTrace();
                    } catch (IllegalStateException e) {
                        e.printStackTrace();
                    } catch (IOException e) {
                        e.printStackTrace();
                    }
                }
                @Override
                public void onFailure(LQSession session, LQException e) {
                    Log.e(TAG, e.getMessage());
                    Toast.makeText(GeoloqiExampleActivity.this, "Fail", Toast.LENGTH_LONG).show();
                }
                @Override
                public void onComplete(LQSession session, HttpResponse response, StatusLine status) {
                    Toast.makeText(GeoloqiExampleActivity.this, "Complete", Toast.LENGTH_LONG).show();
                }
            });
        } else{
            Toast.makeText(this, "service null", Toast.LENGTH_LONG).show();
        }
    }

     /** Defines callbacks for service binding, passed to bindService() */
    private ServiceConnection mConnection = new ServiceConnection() {
        @Override
        public void onServiceConnected(ComponentName name, IBinder service) {
            try {
                // We've bound to LocalService, cast the IBinder and get LocalService instance.
                LQBinder binder = (LQBinder) service;
                mService = binder.getService();
                mBound = true;
                sendRequest();//Sending API Request
            } catch (ClassCastException e) {
            }
        }

        @Override
        public void onServiceDisconnected(ComponentName name) {
            mBound = false;
        }
    };
}

GeoReceiver.java

public class GeoReceiver extends LQBroadcastReceiver {

    @Override
    public void onLocationChanged(Context arg0, Location arg1) {
        Toast.makeText(arg0, "Loc Changed ", Toast.LENGTH_SHORT).show();
    }

    @Override
    public void onPushMessageReceived(Context context, Bundle data) {
        Toast.makeText(context, "Push Msg Received ", Toast.LENGTH_LONG).show();

    }

    @Override
    public void onLocationUploaded(Context arg0, int arg1) {
        Toast.makeText(arg0, "Location Uploaded ", Toast.LENGTH_SHORT).show();
    }

    @Override
    public void onTrackerProfileChanged(Context arg0, LQTrackerProfile oldp,
            LQTrackerProfile newp) {
        Toast.makeText(arg0, "onTrackerProfileChanged ",Toast.LENGTH_SHORT).show();
    }
}

AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.pop.geoloqi"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk android:minSdkVersion="8" />

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION" />

    <permission
        android:name="com.pop.geoloqi.permission.C2D_MESSAGE"
        android:protectionLevel="signature" />

    <uses-permission android:name="com.pop.geoloqi.permission.C2D_MESSAGE" />
    <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />

    <application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name" >

         <activity
            android:name=".GeoloqiExampleActivity"
            android:label="@string/app_name"
            android:screenOrientation="portrait" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

        <service
            android:name="com.geoloqi.android.sdk.service.LQService"
            android:exported="false" />

        <receiver
            android:name=".GeoReceiver"
            android:enabled="false"
            android:exported="false" >
            <intent-filter>
                <action android:name="com.geoloqi.android.sdk.action.LOCATION_CHANGED" />
            </intent-filter>
        </receiver>
        <receiver
            android:name="com.geoloqi.android.sdk.receiver.LQDeviceMessagingReceiver"
            android:permission="com.google.android.c2dm.permission.SEND" >
            <intent-filter>
                <action android:name="com.google.android.c2dm.intent.RECEIVE" />
                <action android:name="com.google.android.c2dm.intent.REGISTRATION" />

                <category android:name="com.pop.geoloqi" />
            </intent-filter>
        </receiver>

    </application>
</manifest>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T03:41:28+00:00Added an answer on June 5, 2026 at 3:41 am

    There was a bug in earlier versions of the Geoloqi Android SDK. If you update to the latest version this problem should be resolved.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using webview in my android app to fetch some webpages from multiple
I developed my app using Mono for Android. I have the latest version 4.0.3.
I have a working android app using TextView, some formatting (line breaks, rows of
I wrote an Android App using the Mixare ( link to mixare project )
I am developing an android app using code from a normal java application. In
if yes, is there a tutorial available for creating an android app using the
I would like to crash my Android app by using command-line ADB tool during
I got the following problem: In my Android App I am using a table
I am using MediaRecorder in my Android app. I referred to the online documentation
I'm using eclipse to build an android app which is tracked in TFS. There's

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.