i have been getting the locations fine...thats not issue..so please be
assured that i have set the manifest file right...
i just need to send the lcoations to another activity and i am not
able to do that....

i just thought of this...start a service that would collect gps data
at regular intervals of time...
and then just start my activity that would use getLastKnownLocation()
and get the locations..

Can some one please advise if i am going on the right directio n

On Apr 19, 12:22 am, Anurag Singh <anusingh...@gmail.com> wrote:
> Have you set uses permission in manifiest file.
>
> <uses-permission
> android:name="android.permission.ACCESS_FINE_LOCATION" />
>
> - Anurag Singh
>
> Hi,
>
>
>
>
>
> > I am trying to retrieve the GPS location of the phone. I believe I
> > cannot create an object of the class which stores the location in a
> > variable. So that once the class gets instantiated I use a get method
> > and retrieve the content in the variable.
> > So I am trying to do this....
>
> > locationListener = new MyLocationListener();
>
> >        lm.requestLocationUpdates(
> >            LocationManager.GPS_PROVIDER,0,0,locationListener);
> >        if(!information.equals(null)){
> >                Bundle bundle = new Bundle();
> >                bundle.putString("hello", information);
> >                Intent intent = new Intent(LocationActivity.this,
> > MainActivity.class);
> >                intent.putExtras(bundle);
> >                startActivity(intent);
> >        }
>
> > and in the locationlistener class
>
> > public void onLocationChanged(Location loc) {
> >            if (loc != null) {
> >                double lat=loc.getLatitude();
> >                double lon=loc.getLongitude();
> >                information = " "+lat +lon;
> >                Toast.makeText(getBaseContext(),
> >                "Location Changed:"+information,
> >                Toast.LENGTH_LONG).show();
> >            }
> >            else
> >                information="bad luck";
> >        }
>
> > The mainactivity then displays that...but its not happening...could
> > some one please help me how to get the values of this.
>
> > Thanks...Raqeeb
>
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Android Developers" group.
> > To post to this group, send email to android-developers@googlegroups.com
> > To unsubscribe from this group, send email to
> > android-developers+unsubscr...@googlegroups.com<android-developers%2bunsubscr...@googlegroups.com>
> > 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 android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group 
> athttp://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 android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to