Location API and Google Maps in Android - Tutorial

435 views
Skip to first unread message

Bz

unread,
Mar 6, 2011, 7:45:00 PM3/6/11
to vogella
Hi I was recently doing the Location API and Google Maps in Android -
Tutorial. I went on to part four using google map api, all was fine
until I tried to implement the override GeoUpdateHandler implements
LoctionListener class ( the final part). When I enter the "@override"
above the method onLocationChanged, Eclipse keeps telling me as a
error "The method onLocationChanged(Location) of type
MosqueFinder.GeoUpdateHandler must override a superclass method". I am
new to Android and would apreciate the help.Thanks

Lars Vogel

unread,
Mar 8, 2011, 5:29:32 PM3/8/11
to vog...@googlegroups.com
Hi,

you have to set the Java version is Eclipse to Java 1.6. Google should
help in finding the answer to this.

Best regards, Lars

2011/3/7 Bz <bzkh...@googlemail.com>:

> --
> You received this message because you are subscribed to the Google Groups "vogella" group.
> To post to this group, send email to vog...@googlegroups.com.
> To unsubscribe from this group, send email to vogella+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/vogella?hl=en.
>
>

--
Lars
http://www.vogella.de - Tutorials about Java, Eclipse and Web programming
http://www.twitter.com/vogella - Lars on Twitter

sunny

unread,
Mar 19, 2011, 7:37:20 AM3/19/11
to vogella
hi i am working on your code
i am getting r cannot be resolved error at following

"
latituteField = (TextView) findViewById(R.id.TextView02);
longitudeField = (TextView) findViewById(R.id.TextView04);
""
i hav dbl checked frm site + in main.xml where dis was defined

I hav one more doubt :
How to set up geoposition is nt very clear to me >

regards
On Mar 9, 3:29 am, Lars Vogel <lars.vo...@googlemail.com> wrote:
> Hi,
>
> you have to set the Java version is Eclipse to Java 1.6. Google should
> help in finding the answer to this.
>
> Best regards, Lars
>
> 2011/3/7 Bz <bzkhan...@googlemail.com>:
>
>
>
>
>
>
>
>
>
> > Hi I was recently doing the Location API and Google Maps in Android -
> > Tutorial. I went on to part four using google map api, all was fine
> > until I tried to implement the override  GeoUpdateHandler implements
> > LoctionListener class ( the final part). When I enter the "@override"
> > above the method onLocationChanged, Eclipse keeps telling me as a
> > error "The method onLocationChanged(Location) of type
> > MosqueFinder.GeoUpdateHandler must override a superclass method". I am
> > new to Android and would apreciate the help.Thanks
>
> > --
> > You received this message because you are subscribed to the Google Groups "vogella" group.
> > To post to this group, send email to vog...@googlegroups.com.
> > To unsubscribe from this group, send email to vogella+u...@googlegroups.com.
> > For more options, visit this group athttp://groups.google.com/group/vogella?hl=en.
>
> --
> Larshttp://www.vogella.de- Tutorials about Java, Eclipse and Web programminghttp://www.twitter.com/vogella- Lars on Twitter

Russell Bateman

unread,
Mar 19, 2011, 10:18:24 AM3/19/11
to vog...@googlegroups.com
Please read what I have to say about this problem at http://www.javahotchocolate.com/tutorials/android.html. I think you'll find the solution is one of those listed in there.

Principally, though, until your layout(s), strings and other XML resources are set up accurately, all sorts of bad things from a missing R to R missing a field can happen.

Also, from your code, I see you're not giving useful names to some of your resources (like your second TextView definition). Ensuring good names takes a couple of seconds longer, but it's clean and helpful later.

Best of luck...


Subject: Re: Location API and Google Maps in Android - Tutorial
Sent: Saturday, 19 March 2011 4:37:20 -0700 (PDT)
From: sunny <sunnyk...@gmail.com>
To: vogella <vog...@googlegroups.com>


Lars Vogel

unread,
Mar 19, 2011, 10:51:32 AM3/19/11
to vog...@googlegroups.com
Hi Russ,

Which part of your tutorial extension does relate to the question?

Best regards, Lars


2011/3/19 Russell Bateman <ru...@windofkeltia.com>:

Lars Vogel

unread,
Mar 19, 2011, 10:53:48 AM3/19/11
to vog...@googlegroups.com
Try Project -> Clean to recreate the the R.java for
http://www.vogella.de/articles/AndroidLocationAPI/article.html

If this does not help, please have a look at the LogCat View as
described in http://www.vogella.de/articles/Android/article.html


2011/3/19 sunny <sunnyk...@gmail.com>:

Russell Bateman

unread,
Mar 19, 2011, 11:40:59 AM3/19/11
to vog...@googlegroups.com
There is a table of contents. Look down for "R.java" under a discussion of XML questions.

Sorry, I should have given that because it's a very long article.

http://www.javahotchocolate.com/tutorials/android.html#r-java

sunny

unread,
Mar 19, 2011, 1:55:22 PM3/19/11
to vogella
ty russell

On Mar 19, 7:18 pm, Russell Bateman <r...@windofkeltia.com> wrote:
>   Please read what I have to say about this problem athttp://www.javahotchocolate.com/tutorials/android.html. I think you'll
> find the solution is one of those listed in there.
>
> Principally, though, until your layout(s), strings and other XML
> resources are set up accurately, all sorts of bad things from a missing
> R to R missing a field can happen.
>
> Also, from your code, I see you're not giving useful names to some of
> your resources (like your second TextView definition). Ensuring good
> names takes a couple of seconds longer, but it's clean and helpful later.
>
> Best of luck...
>
> ------------------------------------------------------------------------
> *Subject:* Re: Location API and Google Maps in Android - Tutorial
> *Sent:* Saturday, 19 March 2011 4:37:20 -0700 (PDT)
> *From:* sunny <sunnykradi...@gmail.com>
> *To:* vogella <vog...@googlegroups.com>
> >> Larshttp://www.vogella.de-Tutorials about Java, Eclipse and Web programminghttp://www.twitter.com/vogella-Lars on Twitter

sunny

unread,
Mar 19, 2011, 2:01:28 PM3/19/11
to vogella
the problem was in id creation i got thru it .
can ny 1 elaborate on setting up geoposition for avd


On Mar 19, 8:40 pm, Russell Bateman <r...@windofkeltia.com> wrote:
>   There is a table of contents. Look down for "R.java" under a
> discussion of XML questions.
>
> Sorry, I should have given that because it's a very long article.
>
> http://www.javahotchocolate.com/tutorials/android.html#r-java
>
> On 2011.03.19 8:51, Lars Vogel wrote:
>
>
>
>
>
>
>
> > Hi Russ,
>
> > Which part of your tutorial extension does relate to the question?
>
> > Best regards, Lars
>
> > 2011/3/19 Russell Bateman<r...@windofkeltia.com>:
> >> Please read what I have to say about this problem at
> >>http://www.javahotchocolate.com/tutorials/android.html. I think you'll find
> >> the solution is one of those listed in there.
>
> >> Principally, though, until your layout(s), strings and other XML resources
> >> are set up accurately, all sorts of bad things from a missing R to R missing
> >> a field can happen.
>
> >> Also, from your code, I see you're not giving useful names to some of your
> >> resources (like your second TextView definition). Ensuring good names takes
> >> a couple of seconds longer, but it's clean and helpful later.
>
> >> Best of luck...
>
> >> ________________________________
> >> Subject: Re: Location API and Google Maps in Android - Tutorial
> >> Sent: Saturday, 19 March 2011 4:37:20 -0700 (PDT)
> >> From: sunny<sunnykradi...@gmail.com>
> >> Larshttp://www.vogella.de-Tutorials about Java, Eclipse and Web
> >> programminghttp://www.twitter.com/vogella-Lars on Twitter

Abhi

unread,
Mar 22, 2011, 5:43:07 AM3/22/11
to vogella
Hi,
I am working on your code. The GPS application runs without any errors
but it isnt displaying the coordinates. It just says "Provider not
available". I'm using the DDMS perspective to send the coordinates to
the emulator. At the startup a toast saying "Disenabled provider
network" pops up. Please help me.

Bz

unread,
Mar 24, 2011, 6:29:58 AM3/24/11
to vogella
HI Lars, Me again!! (LOL). The tutorial above works fine now. The
problem I have is when I start up the emulator, there is marker their
to show your position (sometimes), when I changed my position using
the emulator controls the map location of the new positions comes up
but the position marker does not. Please can you help thanking you in
advance. Bz

Lars Vogel

unread,
Apr 29, 2013, 4:56:37 AM4/29/13
to vog...@googlegroups.com
Because you used SupportFragment I assume. If you use Fragment this works fine.


2013/4/28 letscommunicate.co.uk <terranmic...@gmail.com>
Hi all - Android is new to me so I've been heavily using Vogellas tutorials ( thanks for these ) and I wanted to share this link ( http://stackoverflow.com/questions/16004137/supportmapfragment-cannot-cast-from-fragment-to-mapfragment )

In short I was following the Maps API2 tutorial and wanted to use it with in a fragment how ever I was getting the Error "Cannot cast from Fragment to MapFragment".

The fix was to use SupportMapFragment and not MapFragment.... hopfully this will help some one.

Terran

--
You received this message because you are subscribed to the Google Groups "vogella" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vogella+u...@googlegroups.com.

To post to this group, send email to vog...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages