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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T02:03:54+00:00 2026-05-26T02:03:54+00:00

package my.pack; import java.util.Iterator; import android.app.Activity; import android.content.Context; import android.location.GpsSatellite; import android.location.GpsStatus; import android.location.GpsStatus.NmeaListener;

  • 0
  package my.pack;

  import java.util.Iterator;

  import android.app.Activity;
  import android.content.Context;
  import android.location.GpsSatellite;
  import android.location.GpsStatus;
  import android.location.GpsStatus.NmeaListener;
  import android.location.Location;
  import android.location.LocationListener;
  import android.location.LocationManager;
  import android.os.Bundle;
  import android.util.Log;
  import android.widget.Toast;

  public class SatellitesActivity extends Activity {
LocationManager locMgr;
double lat;
double lon;
  /** Called when the activity is first created. */
  @Override
   public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

     locMgr = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
     MyGpsListener listener = new MyGpsListener();
     MyLocationListener locListener = new MyLocationListener();
     locMgr.addGpsStatusListener(listener);      
     locMgr.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, locListener);
     locMgr.addNmeaListener(new NmeaListener() {

        @Override
        public void onNmeaReceived(long timestamp, String nmea) {
            // TODO Auto-generated method stub
            Log.e("Test!", nmea);
        }
    });

   }



  public class MyGpsListener implements GpsStatus.Listener{
    @Override
    public void onGpsStatusChanged(int event) {
        // TODO Auto-generated method stub
        switch(event){
        case GpsStatus.GPS_EVENT_STARTED:Log.e("Started", "");
            break;
        case GpsStatus.GPS_EVENT_FIRST_FIX:Log.e("FirstFix", "");
            break;
        case GpsStatus.GPS_EVENT_STOPPED:Log.e("Sopped", "");
            break;
        case GpsStatus.GPS_EVENT_SATELLITE_STATUS:GpsStatus xGpsStatus = locMgr.getGpsStatus(null) ; 
        Iterable<GpsSatellite> iSatellites = xGpsStatus.getSatellites() ; 
        Iterator<GpsSatellite> it = iSatellites.iterator() ; 
        while ( it.hasNext() ) 
        { 
                GpsSatellite oSat = (GpsSatellite) it.next() ; 
                if(oSat.usedInFix()){
                    Log.e("A fost folosit ", "int fix!");
                }
                if(oSat.toString()!=null){

                    Log.e("Test", "SNR:"+oSat.getSnr()+"; Azimuth:"+oSat.getAzimuth()+"; Elevation:"+oSat.getElevation()+" "+oSat.toString()+"; PRN:"+oSat.getPrn());
                }
        } 
        break ; 


        }
    }
    }

public class MyLocationListener implements LocationListener{

    @Override
    public void onLocationChanged(Location location) {
        // TODO Auto-generated method stub

        if(location!=null){
            lat = location.getLatitude();
            lon = location.getLongitude();
            Toast.makeText(getApplicationContext(), ""+lat+"\n"+lon, Toast.LENGTH_LONG).show();
        }
    }

    @Override
    public void onProviderDisabled(String provider) {
        // TODO Auto-generated method stub

    }

    @Override
    public void onProviderEnabled(String provider) {
        // TODO Auto-generated method stub

    }

    @Override
    public void onStatusChanged(String provider, int status, Bundle extras) {
        // TODO Auto-generated method stub

    }}

}

  • 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-26T02:03:54+00:00Added an answer on May 26, 2026 at 2:03 am

    Satellites don’t really have names that you can grab. The best you can get is the PRN, which your code already shows you getting.

    Edit
    After some more reading, I have found that some people have attempted to map PRN numbers even though sometimes this is incorrect. Try http://www.losangeles.af.mil/shared/media/document/AFD-070530-036.pdf

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

package test; import java.awt.*; import java.awt.event.*; import java.awt.geom.Ellipse2D; import java.awt.image.BufferedImage; import javax.swing.*; public class
Here's my canvas class extending JPanel : package start; import java.awt.Color; import java.awt.Graphics; import
I have the following code: package in.res.num.tapb.ui; import java.awt.BorderLayout; import java.awt.CardLayout; import java.awt.Dimension; import
package pack; public class sample{ public static void main(String input[]) { NumberFormat numberFormat =
package { import mx.controls.LinkButton; import flash.text.TextLineMetrics; public class multiLineLinkButton extends LinkButton { override protected
Is there a Java package providing funcionality like the .Net System.Data namespace ? Specificaly
Pack.java imports pack.TestPack; but it cannot access it. I cannot understand why it cannot
What is best way to show function FUNCTION1 from package PACK ? DESC PACK.FUNCTION1
the code is: typedef struct _Package { char* data; int dataLen; }Package; Package *pack=(Package
I am trying to develop a tiny android app that just opens a browser

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.