Hi you can use network provider for it
plse see following code
if gps not working then you can use network provider
Sorry for code indentation
LocationManager myManager =
(LocationManager)getSystemService(Context.LOCATION_SERVICE);
Location
gpsLoc=myManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);
Location
nwloc=myManager.getLastKnownLocation(LocationManager.NETWORK_PROVIDER);;
Double latPoint=0D;
Double longPoint=0D;
String currentPhoneLocation=null;
if(gpsLoc==null){
Log.i("Mobsec","gps null");
currentPhoneLocation="no location";
}else{
latPoint
=myManager.getLastKnownLocation(LocationManager.GPS_PROVIDER).getLatitude();
longPoint
=myManager.getLastKnownLocation(LocationManager.GPS_PROVIDER).getLatitude();
currentPhoneLocation = "Current phone location: Latitude:
"+latPoint+" Longitude: "+longPoint;
}
if(nwloc==null){
Log.i("Mobsec","nwloc null");
currentPhoneLocation="no location";
}else{
latPoint
=myManager.getLastKnownLocation(LocationManager.NETWORK_PROVIDER).getLatitude();
longPoint
=myManager.getLastKnownLocation(LocationManager.NETWORK_PROVIDER).getLatitude();
currentPhoneLocation = "Current phone location: Latitude:
"+latPoint+" Longitude: "+longPoint;
}
-Deeps
On Mon, Feb 14, 2011 at 6:07 PM, JAlexoid (Aleksandr Panzin) <
[email protected]> wrote:
> In theory it is possible using accelerometer. But that will trash the
> battery and will not be reliable. In addition to being heavy on
> computation.
>
> On 4 фев, 15:55, dica <[email protected]> wrote:
> > Hi
> >
> > Is it possible to track movement without GPS? The GPS signal is too
> > weak on my phone to work indoors. I want to be able to track where
> > I've been within a building. Possible?
> >
> > Tks
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en