Android Tutorial Google Maps

Discussion in 'Tutorials & Examples' started by Erel, Feb 24, 2016.

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

    Erel Administrator Staff Member Licensed User

  2. aldrin paul santos

    aldrin paul santos New Member

    i have already installed them
     
  3. Erel

    Erel Administrator Staff Member Licensed User

    The files are missing. Make sure that Android SDK is not installed inside Program Files as it will fail to update.
     
  4. DonManfred

    DonManfred Expert Licensed User

    Make sure you follow the Guide https://www.b4x.com/b4a.html exactly.
    Especially

    2. Android SDK
    • Download Android SDK.
    • Install the SDK. The SDK doesn't work properly when it is installed in a path with spaces (like "Program Files").
      It is recommended to install it to a custom folder similar to C:\Android
      .
    • Install Android SDK Tools, Android SDK Platform-Tools, Android SDK Build-tools (v23.0.3 is recommended),
      Android Support Repository, Google Repository and at least one platform (see the image below). Use API 14 or above.
    • You can also install Google USB Driver if you need to connect a physical device with USB. A list of other drivers is available here.

      [​IMG]
     
  5. Powie

    Powie Member Licensed User

    Hello, today I started to upgrade all libraries of our MADB project. I'm in problems in upgrading also the GoogleMaps libraries.... I think configuration of libraries, manifest and so on is OK, the map is displayed...

    The issue for me ist that ( based on the tutorial code) MapFragment1_Ready() isn't triggered.
    So I tried this also on the way to make a clean app with only the code from post1, struggling also with the same issue.
    Triggered is Map_CameraChange...

    Do I miss anything?
     
  6. Erel

    Erel Administrator Staff Member Licensed User

    Have you added MapFragment with the designer?
     
  7. Powie

    Powie Member Licensed User

    Yes!
     
  8. Powie

    Powie Member Licensed User

  9. Powie

    Powie Member Licensed User

    Yes, I can confirm this. mapready was ignored, because after starting the activity I show a logo screen.

    If I disable the intro and the activity map_ready works as designed.
     
  10. ldb68

    ldb68 Member Licensed User

    How I can get from the map the current direction of the user (compass)?
    I need the direction shown by the compass in the map without having to use the sensors directly (that gives me very mixed results).
    thanks
     
  11. Erel

    Erel Administrator Staff Member Licensed User

    Please start a new thread for this question.
     
  12. Yayou49

    Yayou49 Active Member Licensed User

    V5.80
    Hi everybody,

    Even after a long read of all requests of this thread, I didn't found a solution to my problem.
    I've installed Google Play service Rev 39 in my SDK directory:

    - No way to find google-play-services.jar in any of my drives
    - you said to add a res like "<android sdk>\extras\google\google_play_services\libproject\google-play-services_lib\res, com.google.android.gms"
    but if I look into my directory "<android sdk>\extras\google\google_play_services\" I have only 2 sub directories: (docs & samples)

    What's wrong ???....

    Thanks in advance.
     
  13. MarcoRome

    MarcoRome Expert Licensed User

    Look THIS
    My suggestion "Is time to switch Rel. B4A 6.80"
     
    Yayou49 likes this.
  14. Yayou49

    Yayou49 Active Member Licensed User

    Nice shot Marco !!!
    Seems to work, in debug mode, it's compliling .... until "Installing file to device", I get this error:

    XXXXX_RAPID_DEBUG.apk: 1 file pushed. 8.7 MB/s (2777756 bytes in 0.304s)
    pkg: /data/local/tmp/XXXXX_RAPID_DEBUG.apk
    Failure [INSTALL_PARSE_FAILED_MANIFEST_MALFORMED]

    Here is my manifest. If I remove the 2 first addManifestText, no more compiling error:

    AddManifestText(<permission
    android:name="$PACKAGE$.permission.MAPS_RECEIVE"
    android:protectionLevel="signature"/>
    <uses-feature android:glEsVersion="0x00020000" android:required="true"/>)
    AddApplicationText(<meta-data
    android:name="com.google.android.maps.v2.API_KEY"
    android:value="AIzaSyA0kIYq2_tvkxxxxxxxxxxxxxxx-0"/>
    <meta-data android:name="com.google.android.gms.version"
    android:value="@Integer/google_play_services_version" />)


    AddManifestText(
    <uses-sdk android:minSdkVersion="5" android:targetSdkVersion="14"/>
    <supports-screens android:largeScreens="true"
    android:normalScreens="true"
    android:smallScreens="true"
    android:anyDensity="true"/>)
    SetApplicationAttribute(android:icon, "@drawable/icon")
    SetApplicationAttribute(android:label, "$LABEL$")
    AddManifestText(
    <uses-sdk android:minSdkVersion="4" android:targetSdkVersion="17"/>
    <supports-screens android:largeScreens="true"
    android:normalScreens="true"
    android:smallScreens="true"
    android:anyDensity="true"/>)
    AddManifestText(<uses-feature android:name="android.hardware.telephony" android:required="false" />)
    AddManifestText(<uses-feature android:name="android.hardware.camera" android:required="false" />)
    AddManifestText(<uses-feature android:name="android.hardware.camera.autofocus" android:required="false" />)
    AddManifestText(<uses-feature android:name="android.hardware.camera.flash" android:required="false" />)
    'AddPermission("android.permission.ACCESS_COARSE_LOCATION")
    AddManifestText(<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />)
    AddPermission("android.permission.INTERNET")
    'AddPermission("android.permission.ACCESS_FINE_LOCATION")
    'AddPermission("android.permission.WAKE_LOCK")
    'AddPermission("android.permission.DEVICE_POWER")
    'AddPermission("android.permission.ACCESS_COARSE_UPDATES")
    AddPermission("android.permission.READ_PHONE_STATE")
    'AddPermission("android.permission.VIBRATE")
    AddPermission("android.permission.CAMERA")
    AddPermission("android.permission.FLASHLIGHT")
    AddPermission("android.hardware.camera")
    SetApplicationAttribute(android:icon, "@drawable/icon")
    SetApplicationAttribute(android:label, "$LABEL$")


    Any idea ?
     
  15. DonManfred

    DonManfred Expert Licensed User

    Yes, you are NOT using tags... Use quotetag for logs or code tags for code.
     
  16. Yayou49

    Yayou49 Active Member Licensed User

  17. evbedp

    evbedp Member Licensed User

    Dear Erel,

    could you help me to solve this one?.. i got this error when i call this code .getMap()

    i'm using B4A 6.80

    Code:
    ** Service (starter) Create **
    ** 
    Service (starter) Start **
    ** 
    Activity (main) Create, isFirst = true **
    ** 
    Activity (main) Resume **
    java.lang.NoSuchMethodError: No virtual method getMap()Lcom/google/android/gms/maps/
    GoogleMapin class Lanywheresoftware/b4a/objects/MapFragmentWrapper$MyMapFragment; or its super classes (declaration of 'anywheresoftware.b4a.objects.MapFragmentWrapper$MyMapFragment' appears in /data/app/e.moto.workshop-1/base.apk)
        at anywheresoftware.b4a.objects.MapFragmentWrapper.GetMap(MapFragmentWrapper.java:132)
        at e.moto.workshop.main._gm_ready(main.java:
    943)
        at java.lang.reflect.Method.invoke(Native Method)
        at java.lang.reflect.Method.invoke(Method.java:
    372)
        at anywheresoftware.b4a.shell.Shell.runMethod(
    Shell.java:710)
        at anywheresoftware.b4a.shell.Shell.raiseEventImpl(
    Shell.java:339)
        at anywheresoftware.b4a.shell.Shell.raiseEvent(
    Shell.java:249)
        at java.lang.reflect.Method.invoke(Native Method)
        at java.lang.reflect.Method.invoke(Method.java:
    372)
        at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:
    134)
        at anywheresoftware.b4a.BA.raiseEvent2(BA.java:
    167)
        at anywheresoftware.b4a.BA.raiseEvent(BA.java:
    163)
        at anywheresoftware.b4a.objects.MapFragmentWrapper$MyMapFragment.onViewCreated(MapFragmentWrapper.java:
    191)
        at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:
    913)
        at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:
    1072)
        at android.app.BackStackRecord.run(BackStackRecord.java:
    852)
        at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:
    1488)
        at android.app.FragmentManagerImpl$
    1.run(FragmentManager.java:452)
        at android.os.Handler.handleCallback(Handler.java:
    815)
        at android.os.Handler.dispatchMessage(Handler.java:
    104)
        at android.os.Looper.loop(Looper.java:
    210)
        at android.app.ActivityThread.main(ActivityThread.java:
    5833)
        at java.lang.reflect.Method.invoke(Native Method)
        at java.lang.reflect.Method.invoke(Method.java:
    372)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:
    1113)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:
    879)
     
  18. Erel

    Erel Administrator Staff Member Licensed User

  19. evbedp

    evbedp Member Licensed User

    i got this error when update google play service in Android SDK manajer to Rev 39. could you help me?

    my project is work before i'm update google play service.
     
  20. evbedp

    evbedp Member Licensed User

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