Android Tutorial (old) Google Maps Android v2 tutorial

Discussion in 'Tutorials & Examples' started by Erel, Dec 18, 2012.

Thread Status:
Not open for further replies.
  1. Erel

    Erel Administrator Staff Member Licensed User

    You should update to a newer android.jar (22+) under Tools - Configure Paths.
     
  2. pal57

    pal57 Member Licensed User

    Thankx Erel,
    I updated to android.jar (23) and increased the dex memory and everything went fine, only for one thing.

    It seems that I tried out your apk and then I disinstalled it before my compiled example.
    It wont install my compile apk saying that there is an esisting package with the same name and a signuture in conflict al ready installed.

    What did I did wrong.

    Bye
    Pal57
     
  3. pal57

    pal57 Member Licensed User

    Sorry,
    everything is working fine now.
    Don't know why but I had two old apk of mine installed with the same name. I disinstalled them and now installed my new google map apk.

    Thankx again Erel.
    now I'll try to study on it.

    Happy New Year :D

    Pal57
     
  4. Pablo Torres

    Pablo Torres Active Member Licensed User

    I cant get it to work well
    It doesnt compile

    this is the error:

    B4A version: 5.50
    Parsing code. (0.00s)
    Compiling code. (0.04s)
    Compiling layouts code. (0.00s)
    Generating R file. Error
    c:\users\pablo\desktop\android\extras\google\google_play_services\libproject\google-play-services_lib\res\values-v21\appinvite_styles.xml:5: error: Error retrieving parent for item: No resource found that matches the given name '@android:style/Theme.Material.Light.DialogWhenLarge.NoActionBar'.

    can someone please help me?
     
  5. Erel

    Erel Administrator Staff Member Licensed User

    Update android.jar under Tools - Configure Paths to platform level 19+.
     
  6. Pablo Torres

    Pablo Torres Active Member Licensed User

    updated to sdk 23
    now the error is:

    B4A version: 5.50
    Parsing code. (0.00s)
    Compiling code. (0.41s)
    Compiling layouts code. (0.05s)
    Generating R file. (6.91s)
    Compiling debugger engine code. (5.15s)
    Compiling generated Java code. (7.25s)
    Convert byte code - optimized dex. Error
    UNEXPECTED TOP-LEVEL ERROR:
    java.lang.OutOfMemoryError: GC overhead limit exceeded
    at com.android.dx.util.ByteArray.slice(ByteArray.java:98)
    at com.android.dx.cf.cst.ConstantPoolParser.parseUtf8(ConstantPoolParser.java:368)
    at com.android.dx.cf.cst.ConstantPoolParser.parse0(ConstantPoolParser.java:262)
    at com.android.dx.cf.cst.ConstantPoolParser.parse(ConstantPoolParser.java:150)
    at com.android.dx.cf.cst.ConstantPoolParser.parseIfNecessary(ConstantPoolParser.java:124)
    at com.android.dx.cf.cst.ConstantPoolParser.getPool(ConstantPoolParser.java:115)
    at com.android.dx.cf.direct.DirectClassFile.parse0(DirectClassFile.java:482)
    at com.android.dx.cf.direct.DirectClassFile.parse(DirectClassFile.java:406)
    at com.android.dx.cf.direct.DirectClassFile.parseToInterfacesIfNecessary(DirectClassFile.java:388)
    at com.android.dx.cf.direct.DirectClassFile.getMagic(DirectClassFile.java:251)
    at com.android.dx.command.dexer.Main.parseClass(Main.java:764)
    at com.android.dx.command.dexer.Main.access$1500(Main.java:85)
    at com.android.dx.command.dexer.Main$ClassParserTask.call(Main.java:1684)
    at com.android.dx.command.dexer.Main.processClass(Main.java:749)
    at com.android.dx.command.dexer.Main.processFileBytes(Main.java:718)
    at com.android.dx.command.dexer.Main.access$1200(Main.java:85)
    at com.android.dx.command.dexer.Main$FileBytesConsumer.processFileBytes(Main.java:1645)
    at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:284)
    at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:166)
    at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144)
    at com.android.dx.command.dexer.Main.processOne(Main.java:672)
    at com.android.dx.command.dexer.Main.processAllFiles(Main.java:574)
    at com.android.dx.command.dexer.Main.runMonoDex(Main.java:311)
    at com.android.dx.command.dexer.Main.run(Main.java:277)
    at com.android.dx.command.dexer.Main.main(Main.java:245)
    at com.android.dx.command.Main.main(Main.java:106)

    cant get it working
     
  7. Erel

    Erel Administrator Staff Member Licensed User

  8. GMan

    GMan Well-Known Member Licensed User

    How exactly can i read the marker positions from a mysql-database ?
    is rdc better or quicker as "simple" Google Maps ?
    Is ALWAYS a script (php or java) needed on the server side or can i use the database directly from the app ?
     
  9. Pablo Torres

    Pablo Torres Active Member Licensed User

    if is a MySQL database you can use Don Manfred MySQL Library (MSMYSQL) to connect directly, no server extra files
    You can connect with webservices to any database, I recommend you this option, but need to install the webservice on the server
    Both ways are super fast (If you are loading Name, Id, Latitude and Longitude for example, you can get 1000 records in 1-2 seconds)
     
    GMan likes this.
  10. GMan

    GMan Well-Known Member Licensed User

    Gracias Pablo,
    as i think i used that lib some years ago - but forgot it (is this a programmers problem or mine only ? ) ;-)
    Will use it again.

    So another problem is this: actually i read out Lat & Long from a lblLat.Text and lblLon.Text.
    No error occus while compiling and running, but no marker was shown ?
    Here's the part i am using:
    Code:
    Sub Map_Ready
       
    Log("map ready")
       gmap = mFragment.GetMap
       
    If gmap.IsInitialized = False Then
          
    ToastMessageShow("Error initializing map."True)
       
    Else
          gmap.AddMarker(lblLat.Text , lblLon.Text, 
    "Standort")
          
    Dim cp As CameraPosition
          cp.Initialize(lblLon.text, lblLat.text, gmap.CameraPosition.Zoom)
          gmap.AnimateCamera(cp)
       
    End If
    End Sub
    The format of that text is
    lblLat.Text="51.1943"
    lblLon.Text="6.29451"
     
  11. Pablo Torres

    Pablo Torres Active Member Licensed User

    I use this code:
    Code:
    Dim EsteMarcador As Marker
         EsteMarcador=gMapLista.AddMarker (Estelocal.Latitud,Estelocal.Longitud,Estelocal.Nombre)
    [\code]
    instead the one you posted 
    and it works fine for me, perhaps you can try that
     
  12. Leni Berry

    Leni Berry Active Member Licensed User

    dear erel,

    how to show button zoom plus (+)/min(-) that own by gmap?
    on my map, there is only locate button.
     
  13. eurojam

    eurojam Well-Known Member Licensed User

    My name is not Erel, but I can help you to - it is always better to ask all people in the forum then a specific person.
    to enable the the zoombuttons you use the UISettings like this:
    Code:
    GoogleMap1.GetUiSettings.ZoomControlsEnabled=True
     
    Beja likes this.
  14. Leni Berry

    Leni Berry Active Member Licensed User

    thank u very much eurojam, it works.
    i'm so sorry for not to ask all people in the forum.
     
  15. Cebuvi

    Cebuvi Active Member Licensed User

    Hello,

    with google play services version 30, have disappeared the folders "\libproject\google-play-services_lib\res" had to be added in #AdditionalRes.


    Which is now the path added in #AdditionalRes attribute?

    Thanks.

    César
     
  16. Erel

    Erel Administrator Staff Member Licensed User

  17. Cebuvi

    Cebuvi Active Member Licensed User

    Thanks Erel.
     
  18. scrat

    scrat Active Member Licensed User

    hello

    I try to use B4a beta 6.0 with google maps. (this lib because i don't use designer)

    I configured firebase and added google-services.json file to the root project path, updated the 4 sdk lib.
    In my project i removed #AdditionalRes and #ExcludeClasses and added #AdditionalJar: com.google.android.gms: play-services-maps + Manifest snippets for google play services and firebase and the com.google.android.geo.API_KEY part.

    Now my playservices version is V30

    When I compile i have this error :

    Code:
    B4A version: 6.00 BETA #1
    Parsing code.  (
    1.19s)
    Compiling code.  (
    1.65s)
    Compiling layouts code.  (
    0.00s)
    Generating R 
    file.  (0.20s)
    Compiling generated Java code.  (
    5.13s)
    Convert byte code - optimized dex.  (
    9.94s)
    Packaging files.  (
    1.64s)
    Copying libraries resources  Error
    Le fichier 
    'C:\Program Files (x86)\Anywhere Software\Basic4android-beta\libraries\google-play-services.jar' est introuvable. ("not found")
    If I put google-play-service.jar V29 in my additional lib dir the project compile but use V29 lib

    How to use googlemaps with V30 googleplay services ?

    Thanks
     
  19. Erel

    Erel Administrator Staff Member Licensed User

    There should be no space here: "com.google.android.gms: play-services-maps"
     
  20. scrat

    scrat Active Member Licensed User

    Yes. The space is only on the post because : and P = :p
     
Thread Status:
Not open for further replies.
Loading...
  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