Jump to content
WFO

Android,JLocationManager -addNmeaListener

Recommended Posts

I'm developing an app for use on Android and want to parse the nmea strings.

 

I'm using the class like this 

 

----------------------------------------------

TLocationListener = class(TJavaLocal, JLocationListener)
  private
    [weak]
    FParent : TForm1;
  public
    constructor Create(AParent : TForm1);
    procedure onFlushComplete(requestCode: Integer); cdecl;
    procedure onLocationChanged(location: JLocation); overload; cdecl;
    procedure onLocationChanged(locations: JList); overload; cdecl;
    procedure onProviderDisabled(provider: JString); cdecl;
    procedure onProviderEnabled(provider: JString); cdecl;
    procedure onStatusChanged(provider: JString; status: Integer; extras: JBundle); cdecl;
  end;
-------------------------------------------------

 

It works well is solid and reliable, but i cant find one single example on how to use / add the ' addNmeaListener' function.

 

Can anyone advise on how to use it ?

 

 

Share this post


Link to post
10 hours ago, WFO said:

It works well is solid and reliable, but i cant find one single example on how to use / add the ' addNmeaListener' function.

Implementation for an OnNmeaListener here:

https://github.com/DelphiWorlds/Kastri/blob/6d21cdb8000c43e7bcc7a0dc44bcbad1058106e1/Features/Location/DW.Location.FusedLocation.Android.pas#L44

 

..adding it to LocationManager here:

https://github.com/DelphiWorlds/Kastri/blob/6d21cdb8000c43e7bcc7a0dc44bcbad1058106e1/Features/Location/DW.Location.FusedLocation.Android.pas#L212

 

I have no idea how to use what is actually in the message - someone else asked for the implementation I came up with.

 

Share this post


Link to post

Thank you so much, it took a lot of extra work, but i finally managed to get the nmea messages.

 

 

 

 

  • Like 2

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×