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 987159
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T05:26:10+00:00 2026-05-16T05:26:10+00:00

I am bashing around with android localization and already figured out how to receive

  • 0

I am bashing around with android localization and already figured out how to receive NMEA data. Unfortunately, the results seem to be very chaotic. I do only need the GPRMC sentence but get GPGGA, GPVTG etc. returned. Is there any way to control the onNmeaReceived() function?

public class TrackingService extends Service {

private Intent broadcastIntent = new Intent("com.example.locationlogger.TestBroadcastReceiver");
private LocationManager lm;
private LocationListener ll = new LocationListener(){
       //sample listener...
};

GpsStatus.NmeaListener nl = new GpsStatus.NmeaListener() {
   @Override
   public void onNmeaReceived(long timestamp, String nmea) {
      /*
       * Broadcast a message..
       */
      broadcastIntent.putExtra("TESTVAR", "Received some nmea strings: " + nmea);
      sendBroadcast(broadcastIntent);
   }
};

@Override
public void onCreate() {
   lm = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
}

@Override
public void onStart(Intent intent, int startId) {   
   lm.requestLocationUpdates(LocationManager.GPS_PROVIDER, interval * 1000, 0, ll);
   lm.addNmeaListener(nl);
}

}

  • 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-16T05:26:10+00:00Added an answer on May 16, 2026 at 5:26 am

    Thank you for your answers – all valid points. Actually, I solved it with a regex pattern and used matcher.find() to filter relevant sentences. In my case, this was the GPRMC sentence and only this if it included valid data. Here’s the java regex string – maybe someone can re-use this.

    public static Pattern p = Pattern.compile("(\\$GPRMC)\\,((\\d{6})\\.?\\d*)\\,([AV]{1})\\,(\\d*\\.?\\d*)\\,([NS]{1})\\,(\\d*\\.?\\d*)\\,([EW]{1})\\,([0-9]*\\.?[0-9]*)\\,([0-9]*\\.?[0-9]*)\\,([0-9]{6})\\,([0-9]*\\.?[0-9]*)\\,([EW]?)\\,([ADEMSN]{1}.*.[0-9A-F]{2})");
    

    To see how I grouped the regex, use this regex string

    (\$GPRMC)\,((\d{6})\.?\d*)\,([AV]{1})\,(\d*\.?\d*)\,([NS]{1})\,(\d*\.?\d*)\,([EW]{1})\,([0-9]*\.?[0-9]*)\,([0-9]*\.?[0-9]*)\,([0-9]{6})\,([0-9]*\.?[0-9]*)\,([EW]?)\,([ADEMSN]{1}.*.[0-9A-F]{2})
    

    at this website

    http://www.regexplanet.com/simple/index.html

    with this NMEA sentence

    $GPRMC,090248,A,4745.012742,N,01304.143827,E,0.0,0.0,310710,5.3,E,A*48
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

After two days of bashing my head and trying to figure this stuff out
Hey guys, I've been bashing my head around for hours now, over this login
I've been bashing my head against the wall trying to figure out why I
I have been bashing my head against this for a while now and need
So right now I'm bashing my head - at the moment we use an
I often hear people bashing ORMs for being inflexible and a leaky abstraction, but
I've got a Windows batch script issue that I'm bashing my head against (no
I have a problem which I have been bashing my head against for the
I'm finally getting around to adding icons to our pull down menus: In this
So I'm working on familiarizing myself with object oriented programming by messing around 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.