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

  • Home
  • SEARCH
  • 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 6998869
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T20:28:00+00:00 2026-05-27T20:28:00+00:00

I need a help in working with GPS Logger. I have a toggle button.

  • 0

I need a help in working with GPS Logger. I have a toggle button. Where i set it on i need to start the GPS Logger and i need to set logger interval. I need to display the latitude and longitude in sqlite DB and update the DB based on log interval.

Any working sample code will be helpful for me. I have found many sample application. But didn’t work. Any sample working links will be of great help.

  • 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-05-27T20:28:01+00:00Added an answer on May 27, 2026 at 8:28 pm
    public class LocalisationService extends Service
    {
        private LocationManager locationManager;
        private BroadcastReceiver receiver;
    
        //Define a listener that responds to location updates
        private LocationListener locationListener = new LocationListener()
        {
            //Called when a new location is found by the network location provider
            public void onLocationChanged(Location location)
            {
                //insertion of the location in the DB
            }
    
            public void onStatusChanged(String provider, int status, Bundle extras) {}
    
            public void onProviderEnabled(String provider) {}
    
            public void onProviderDisabled(String provider) {}
        };
    
        @Override
        public IBinder onBind(Intent intent){return null;}
    
        @Override
        public void onCreate()
        {
            super.onCreate();
            int interval = 1; //Specify the update interval
    
            locationManager = (LocationManager) this.getSystemService(Context.LOCATION_SERVICE);
    
            // Register the listener with the Location Manager to receive location updates
            locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, interval, 0, locationListener);
    
            IntentFilter filter = new IntentFilter();
            filter.addAction("STOP_LOCALISATION_SERVICE");
    
            receiver = new BroadcastReceiver()
            {
                @Override
                public void onReceive(Context context, Intent intent)
                {
                    stopSelf();
                }
            };
            registerReceiver(receiver, filter);
        }
    
        @Override
        public void onDestroy()
        {
            unregisterReceiver(receiver);
            locationManager.removeUpdates(locationListener);
            super.onDestroy();
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have a problem, i'm working on a gallery php script and need help,
I'm working with jQuery for the first time and need some help. I have
Need help trying to figure out why the button onCLick event isn't working. I
I'm working on organizing my application and I need some help sending the GPS
I'm working on a blog theme and I need help. I have two scripts
I need help working with very big numbers. According to Windows calc, the exponent
Ok, I need help. This is my first question here. Background: I am working
I really need some help in Regular Expressions, i'm working on a function like
I've been given a lighttpd.conf that someone else wrote and need help working out
I am weak in SQL and need some help working through some logic with

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.