Android Question Google Maps tutorial

Discussion in 'Android Questions' started by Roger Daley, Jul 31, 2019.

  1. Roger Daley

    Roger Daley Well-Known Member Licensed User

    Hi All,

    Sorry about this, but a couple dumb questions RE: the tutorial.

    I am polishing up an existing App to bring it in line with current GMap requirements.

    1. In the tutorial it says "Don't add #AdditionalRes or #ExcludeClasses."
    Should I remove the existing line "#AdditionalRes: C:\Program Files\Android\android-sdk\extras\google\google_play_services\libproject\google-play-services_lib\res," from Project Attributes?

    2A. I can't add MapFragment in the designer as CustomView is greyed out. Searching the forum shows lacking a suitable library is the usual cause. I already have GoogleMaps library included, this should be enough?
    What else could cause this grey out?

    2B. Currently the Map Fragment is generated in code. Do I really need to do anything in the designer?

    NOTE: The existing App was loosely derived from the venerable GPSEample by Klause. Works well but with Google changing things................?

    Thanks in advance.

    Regards Roger
  2. DonManfred

    DonManfred Expert Licensed User


    Follow the google map tutorial

    Yes. Every customview should be added with the designer.
  3. Roger Daley

    Roger Daley Well-Known Member Licensed User


    Thanks for the reply, you've come to the rescue again.
    I didn't make it really clear in the initial post but I was following the tutorial and needed clarification on these points.

    CustomView: Is still in question.
    1. I can't add a CustomView in the designer because the menu item is Greyed Out. Any ideas as how/why/etc. to get access to the CustomView item in the menu?
    2. This is a working App with an existing MapFragment initialized as in the GPSExample program.
    Why would I need to change this, are there to be changes to Google Maps that would cause problems to the user?

    Regards Roger
  4. klaus

    klaus Expert Licensed User

    The GPSExample doesn't use the GoogleMaps library and therefore doesn't use MapFragment. It was written before the publication of the GoogleMaps library.
    It uses GoogleMaps in a webview, this needs also a license from Google now, their new rules.
  5. Roger Daley

    Roger Daley Well-Known Member Licensed User

    Oh! Bugger!
    Back to the drawing board. :(

    Now I really need to get that CustomView working.

    Thanks Klaus
  6. Erel

    Erel Administrator Staff Member Licensed User

    Start with a new project and carefully follow the tutorial. It will work.
    Later you can integrate it in your existing project.
  7. Roger Daley

    Roger Daley Well-Known Member Licensed User

    Sadly I think you are right. A pain in the rear end but a small practice program is the way to go.

    Any ideas on why CustomView is Greyed?

    Regards Roger
  8. Erel

    Erel Administrator Staff Member Licensed User

    The list of custom views is updated when the visual designer becomes focused. If Google Maps is indeed checked then it should be listed.

    If you don't see it then upload your project.
    Roger Daley likes this.
  9. Roger Daley

    Roger Daley Well-Known Member Licensed User

    Thank you Erel,

    Sorry about the delay getting back but life got in the way. I also dumped the copy I had been modifying in case it had been corrupted by me.
    The Zip is just a bit big to Upload, the LINK to file in dropbox is the working App with changes made by following the tutorial, up to the step creating the MapFragment. CustomView menu item is still Greyed out.

    Thanks in advance for the help.

    Regards Roger

    PS The Google Maps Key is not the real one.
    Last edited: Aug 2, 2019
  10. Roger Daley

    Roger Daley Well-Known Member Licensed User


    Problem solved. I'm an idiot, I hadn't updated the Googlemaps Library files. I thought I had but finally noticed I was still on V1.01.
    I had copied the files to the Additional Libraries folder, the Libraries Manager was loading V1.01 from the Libraries folder
    Updated the Libraries folder with the files attached to the tutorial, problem solved.

    Sorry about the run around.

    Regards Roger.
    Last edited: Aug 2, 2019
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice