Code example for Location

Methods: getAccuracygetAltitudegetBearinggetLatitudegetLongitudegetProvidergetSpeedgetTime

0
     */ 
    private NativeLocation GetNativeLocation( Location aLocation )
    { 
        NativeLocation lNativeLoc = new NativeLocation();
 
        lNativeLoc.mLongtitude = (int) Math.round(aLocation.getLongitude()
                * (double) mFixedPointFactor);
 
        lNativeLoc.mLatitude = (int) Math.round(aLocation.getLatitude()
                * (double) mFixedPointFactor);
 
        lNativeLoc.mAltitude = (int) Math.round( aLocation.getAltitude() );
 
        lNativeLoc.mGpsTime = (int) (aLocation.getTime() / 1000); // Time in
        // seconds 
 
        lNativeLoc.mSpeed = (int) (aLocation.getSpeed() * 1.944); // m/s to
        // knots 
 
        lNativeLoc.mSteering = (int) aLocation.getBearing();
 
        lNativeLoc.mAccuracy = (int) aLocation.getAccuracy();
         
        return lNativeLoc;
    } 
 
    private void UpdateNativeLayer( final byte aStatus, final Location aLoc )
    { 
        // Log the update 
        int isCellData = 0;
        double hdop;
        if ( aLoc == null )
            return;         
         
        NativeLocation loc = GetNativeLocation( aLoc );
         
        // No GPS - use cell information 
        if ( aLoc.getProvider().equals( LocationManager.NETWORK_PROVIDER ) )
        { 
            isCellData = 1;
        } 
        
        // GPS Available - handle trough the satellites 
        if ( aLoc.getProvider().equals( LocationManager.GPS_PROVIDER ) )
        { 
        	int satelliteNumber = 0;
            // Update native layer wit the satellite information 
//            Bundle extraParams = aLoc.getExtras(); 
//            if ( extraParams != null ) 
//            { 
//                satelliteNumber = extraParams.getInt( "satellites"); 
//                SatteliteListenerCallbackNTV( satelliteNumber ); 
//            } 
             
            // Why this???? Taken from the iphone implementation 
            //Dilution data 
            if ( aLoc.getAccuracy() <= 20) 
            { 
               hdop = 1;
            }  
            else if (aLoc.getAccuracy() <= 50) 
            { 
               hdop = 2;
            }  
            else if (aLoc.getAccuracy() <= 100) 
            { 
               hdop = 3;
            }  
            else  
            {