Recent

Author Topic: [SOLVED] LAMW : GPS : number of satellite  (Read 6789 times)

majid.ebru

  • Sr. Member
  • ****
  • Posts: 388
[SOLVED] LAMW : GPS : number of satellite
« on: February 22, 2017, 10:39:47 am »
in some GPS apk ,like " Maverick", show number of satellite
how can i show like this ???
« Last Edit: March 06, 2017, 11:11:57 am by majid.ebru »

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1345
Re: LAMW : GPS : number of satellite
« Reply #1 on: February 22, 2017, 11:23:10 am »
With LAMW, you can't at the moment.
There is no implementation yet of "android.location.GpsStatus".

But you can ask the author for this feature !
In most cases, he is very willing to implement feature requests like this.

jmpessoa

  • Hero Member
  • *****
  • Posts: 1623
Re: LAMW : GPS : number of satellite
« Reply #2 on: February 22, 2017, 05:38:54 pm »

Quote
But you can ask the author for this feature !
In most cases, he is very willing to implement feature requests like this.

Ok.
I'll try to implement this feature!

Thank you!
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

jmpessoa

  • Hero Member
  • *****
  • Posts: 1623
Re: LAMW : GPS : number of satellite
« Reply #3 on: February 25, 2017, 05:02:23 am »

Done!

Please,  update from github

ref.

https://github.com/jmpessoa/lazandroidmodulewizard

code example:
[from "AppLocationDemo1"]
Code: Pascal  [Select][+][-]
  1. procedure TAndroidModule1.jLocation1GpsStatusChanged(Sender: TObject;
  2.   countSatellites: integer; gpsStatusEvent: TGpsStatusEvent);
  3. var
  4.   i: integer;
  5. begin
  6.  
  7.   case gpsStatusEvent of
  8.  
  9.      gpsStarted: ShowMessage('gpsStarted');
  10.      gpsStopped: ShowMessage('gpsStopped');
  11.      gpsFirstFix: ShowMessage( FloatToStr( jLocation1.GetTimeToFirstFix() ) );
  12.  
  13.      gpsSatelliteStatus:
  14.      begin
  15.        ShowMessage(IntToStr(countSatellites));
  16.        for i:= 0 to countSatellites-1 do
  17.        begin
  18.          ShowMessage(jLocation1.GetSatelliteInfo(i));
  19.        end;
  20.      end;
  21.  
  22.   end;
  23.  
  24. end;
  25.  

Thank you!
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

jmpessoa

  • Hero Member
  • *****
  • Posts: 1623
Re: LAMW : GPS : number of satellite
« Reply #4 on: February 26, 2017, 05:43:18 am »

try:
Code: Pascal  [Select][+][-]
  1.  if  myLoc.IsGPSProvider() then .....
  2.  

or

Code: Pascal  [Select][+][-]
  1.  if  not myLoc.IsGPSProvider() then .....
  2.  

Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

majid.ebru

  • Sr. Member
  • ****
  • Posts: 388
Re: LAMW : GPS : number of satellite
« Reply #5 on: February 26, 2017, 05:45:52 am »
sorry
i want to Enable or Disable the GPS and i (think that) write mistake code

i mistake
 %) %) ::) ::)
« Last Edit: February 26, 2017, 05:50:19 am by majid.ebru »

majid.ebru

  • Sr. Member
  • ****
  • Posts: 388
Re: LAMW : GPS : number of satellite
« Reply #6 on: February 26, 2017, 01:19:12 pm »

Done!

Please,  update from github

ref.

https://github.com/jmpessoa/lazandroidmodulewizard

code example:
[from "AppLocationDemo1"]
Code: Pascal  [Select][+][-]
  1. procedure TAndroidModule1.jLocation1GpsStatusChanged(Sender: TObject;
  2.   countSatellites: integer; gpsStatusEvent: TGpsStatusEvent);
  3. var
  4.   i: integer;
  5. begin
  6.  
  7.   case gpsStatusEvent of
  8.  
  9.      gpsStarted: ShowMessage('gpsStarted');
  10.      gpsStopped: ShowMessage('gpsStopped');
  11.      gpsFirstFix: ShowMessage( FloatToStr( jLocation1.GetTimeToFirstFix() ) );
  12.  
  13.      gpsSatelliteStatus:
  14.      begin
  15.        ShowMessage(IntToStr(countSatellites));
  16.        for i:= 0 to countSatellites-1 do
  17.        begin
  18.          ShowMessage(jLocation1.GetSatelliteInfo(i));
  19.        end;
  20.      end;
  21.  
  22.   end;
  23.  
  24. end;
  25.  

Thank you!

Hi
this code dose not work ?!?

i change that to :
Code: Pascal  [Select][+][-]
  1. procedure TamMain.myLocGpsStatusChanged(Sender: TObject;
  2.   countSatellites: integer; gpsStatusEvent: TGpsStatusEvent);
  3. var
  4.   i: integer;
  5. begin
  6.   case gpsStatusEvent of
  7.      gpsStarted: begin
  8.        jTextView2.Text:='gpsStarted'+#10+#13+
  9.        'countSatellites = '+IntToStr(countSatellites);
  10.      end;
  11.      gpsStopped: begin
  12.        jTextView2.Text:='gpsStopped'+#10+#13+
  13.        'countSatellites = '+IntToStr(countSatellites);
  14.      end;
  15.      gpsFirstFix: begin
  16.         jTextView2.Text:=FloatToStr(myLoc.GetTimeToFirstFix())+#10+#13+
  17.         'gpsFirstFix';
  18.      end;
  19.      gpsSatelliteStatus: begin
  20.        jTextView2.Text:='gpsStopped'+#10+#13+
  21.        'countSatellites = '+IntToStr(countSatellites);
  22.        for i:= 0 to countSatellites-1 do
  23.        begin
  24.          jTextView1.Text:= (myLoc.GetSatelliteInfo(i));
  25.        end;
  26.      end;
  27.   end;
  28. end;
  29.  

but all time countSatellites = 0 ?!?

jmpessoa

  • Hero Member
  • *****
  • Posts: 1623
Re: LAMW : GPS : number of satellite
« Reply #7 on: February 26, 2017, 04:53:10 pm »
You may have to wait a lot more ... or even move to an open area ...
[I tested the code and it works!]

to better info fix here...
Code: [Select]
gpsSatelliteStatus: begin
       jTextView2.Text:='gpsSatelliteStatus'+#10+#13+     //FIX HERE!
       'countSatellites = '+IntToStr(countSatellites);
       for i:= 0 to countSatellites-1 do
       begin
         jTextView1.Text:= (myLoc.GetSatelliteInfo(i));
       end;
     end;
« Last Edit: February 26, 2017, 04:56:42 pm by jmpessoa »
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

majid.ebru

  • Sr. Member
  • ****
  • Posts: 388
Re: LAMW : GPS : number of satellite
« Reply #8 on: February 28, 2017, 04:40:51 am »
Hi
the program find my position but no show number satellite ?!?

jTextView2.Text alternative show 'gpsStarted' and  'gpsStoped' but no show show number satellite ?

jmpessoa

  • Hero Member
  • *****
  • Posts: 1623
Re: LAMW : GPS : number of satellite
« Reply #9 on: February 28, 2017, 05:31:44 am »
Please, first try demo "AppLocationDemo1"

You need:

1. Enable Wifi in your smartphone
2. Enable  gps in your smartphone
3. Run app
4. Click the first button "Try StartTracker"

and wait.... wait.... wait....
[here, in my house, I need go to an open area...]
« Last Edit: February 28, 2017, 05:55:02 pm by jmpessoa »
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

majid.ebru

  • Sr. Member
  • ****
  • Posts: 388
Re: LAMW : GPS : number of satellite
« Reply #10 on: February 28, 2017, 10:40:33 am »
i completely understand what you say.
i find my position whit my app.
.
.
also my WiFi is OFF.
but see attach please
« Last Edit: February 28, 2017, 10:42:18 am by majid.ebru »

jmpessoa

  • Hero Member
  • *****
  • Posts: 1623
Re: LAMW : GPS : number of satellite
« Reply #11 on: February 28, 2017, 06:01:58 pm »
 
Yes, when "gpsStarted"  we get countSatellites = 0 !
[that is right!]

wait until  "gpsSatelliteStatus",  so we will get  the real
countSatellites <> 0 !!!

[You need WIFI = ON!   Enable it!]

Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

majid.ebru

  • Sr. Member
  • ****
  • Posts: 388
Re: LAMW : GPS : number of satellite
« Reply #12 on: March 04, 2017, 06:14:50 am »
don't work again !! :-\ :-\ :-\ :'( :'(

i enable WiFi and google find my position but , don't show satellite number??

value of gpsStatusEvent is only :  gpsStarted and gpsStopped
and never gpsFirstFix and gpsSatelliteStatus Event( or show) ?!?!

jmpessoa

  • Hero Member
  • *****
  • Posts: 1623
Re: LAMW : GPS : number of satellite
« Reply #13 on: March 05, 2017, 03:39:52 pm »
Quote
value of gpsStatusEvent is only :  gpsStarted and gpsStopped
and never gpsFirstFix and gpsSatelliteStatus Event( or show) ?!?!

Well, You need wait until value of gpsStatusEvent = gpsSatelliteStatus
[or gpsFirstFix ] but In your area this does not seem easy... here in my house I always need to go to an open area [backyard... or  street ...]
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

 

TinyPortal © 2005-2018