Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: location sensor and gps satellite count



Permlink Replies: 4 - Last Post: Mar 18, 2018 1:20 PM Last Post By: Dave Nottage
peiman f

Posts: 106
Registered: 4/16/14
location sensor and gps satellite count
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 17, 2018 12:58 PM
how can i get number of satellite that my mobile phone is viewing and fixed on android ?
at all is there any way to get more data from that the location sensor providing !?
Dave Nottage

Posts: 1,850
Registered: 1/7/00
Re: location sensor and gps satellite count
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 17, 2018 9:52 PM   in response to: peiman f in response to: peiman f
peiman f wrote:

how can i get number of satellite that my mobile phone is viewing and fixed on android ?
at all is there any way to get more data from that the location sensor providing !?

You should be able to use the TGpsStatus class in the System.Sensors unit, e.g:

var
  LStatus: TGpsStatus;
begin
  // You might want to check TGpsStatus.Supported and TGpsStatus.Authorized first
  LStatus := TGpsStatus.Current;
  if LStatus <>  nil then
  begin
    // Use the Satellites and SatelliteCount properties here
  end;
end;


--
Dave Nottage [MVP, TeamB]
Find hints, tips and tricks at Delphi Worlds blog: http://www.delphiworlds.com
peiman f

Posts: 106
Registered: 4/16/14
Re: location sensor and gps satellite count
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 17, 2018 11:52 PM   in response to: Dave Nottage in response to: Dave Nottage
var
LStatus: TGpsStatus;
begin
// You might want to check TGpsStatus.Supported and TGpsStatus.Authorized first
LStatus := TGpsStatus.Current;
if LStatus <> nil then
begin
// Use the Satellites and SatelliteCount properties here
end;
end;

can you send me more code
with the provided code i got this error
[DCC Error] Unit1.pas(34): E2010 Incompatible types: 'Integer' and 'TGpsStatusClass'
 

on
  LStatus := TGpsStatus.Current;
 

thank you
Dave Nottage

Posts: 1,850
Registered: 1/7/00
Re: location sensor and gps satellite count
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 18, 2018 1:20 PM   in response to: peiman f in response to: peiman f
peiman f wrote:

can you send me more code
with the provided code i got this error
[DCC Error] Unit1.pas(34): E2010 Incompatible types: 'Integer' and 'TGpsStatusClass'
 

on
  LStatus := TGpsStatus.Current;
 

thank you

Then you're not using the code as I described. What have you declared LStatus as?

--
Dave Nottage [MVP, TeamB]
Find hints, tips and tricks at Delphi Worlds blog: http://www.delphiworlds.com
Tomasz Andrzeje...

Posts: 1
Registered: 12/14/09
Re: location sensor and gps satellite count
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 18, 2018 12:23 PM   in response to: peiman f in response to: peiman f
peiman f wrote:
how can i get number of satellite that my mobile phone is viewing and fixed on android ?
at all is there any way to get more data from that the location sensor providing !?

you could use native java interfaces (JLocation).
After you will get instance of JLocation (you have to register receiver JLocationListener) you could get satellites using getExtras

  onLocationChanged(location: JLocation);
       location.getExtras.getInt(JavaString);


Please follow this links

https://stackoverflow.com/questions/43472256/how-to-track-the-user-location-at-full-time-with-a-delphi-app-under-android-ios/43503174#43503174

Edited by: Tomasz Andrzejewski Andrzejewski on Mar 18, 2018 12:23 PM

Edited by: Tomasz Andrzejewski Andrzejewski on Mar 18, 2018 12:24 PM
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02