Android Tutorial Google Maps

Status
Not open for further replies.

Nostrildumbass

Member
Licensed User
Longtime User
Hi everyone, I just wanted to report a finding I made after a bit of troubleshooting. I had the same issue as jchal with the error: ERROR: resource directory 'C:\android\tools\..\extras\google\google_play_services\libproject\google-play-services_lib\res' does not exist.

I found out that my #AdditionalRes attribute (below) was looking at the folder google_play_services, and my folder was called google-play-services. I renamed the folder and everything is looking fine so far.

#AdditionalRes: C:\android\extras\google\google_play_services\libproject\google-play-services_lib\res, com.google.android.gms
 

Croïd

Active Member
Licensed User
Longtime User
Hi,
I changed my application with this new way to insert Google maps.
Now, I have this error ANR !
What is it about ?
 

Attachments

  • ANR- Galaxy S6.txt
    130 KB · Views: 563

Erel

B4X founder
Staff member
Licensed User
Longtime User
It is not related to GoogleMaps.

It is related the MySQL library that you use.

Switch to RDC and everything will work properly.
 

Haris Hafeez

Active Member
Licensed User
Longtime User
You mention Don't add #AdditionalRes or #ExcludeClasses

I take it that you mean not to use additional resources related to Google maps? I ask this because I use AppCompat and other libraries that require additional resources. Hope it doesn't mean an end to this support in 6.
 

DonManfred

Expert
Licensed User
Longtime User

ivan.tellez

Active Member
Licensed User
Longtime User
Hi everyone, I followed the instructions by @Erel :

Instructions for B4A v6+ were added to the first post.

But, Im having a little problem with B4A 6.0 and Google Play Services v30

I updated B4A and the Android SDK, deleted the old google-play-services.jar from libs. Then I started a new project:

  • Follow the instructions on Integrating Firebase Services
  • Add Google Play Services Base snippet from the link above to the manifest editor.
  • Add this snippet to the manifest editor (replace the value with your key):

B4X:
AddApplicationText(
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="AIzaSxxxxxxxxx "/>
)

  • Add this line:
B4X:
#AdditionalJar: com.google.android.gms:play-services-maps

But, got this error:

B4X:
B4A version: 6.00
Parsing code.    (0.00s)
Compiling code.    (0.04s)
Compiling layouts code.    (0.01s)
Organizing libraries.    (0.00s)
Generating R file.    (0.23s)
Compiling debugger engine code.    (0.64s)
Compiling generated Java code.    (0.98s)
Convert byte code - optimized dex.    (1.66s)
Packaging files.    (0.98s)
Copying libraries resources    Error
No se pudo encontrar el archivo 'C:\Program Files (x86)\Anywhere Software\Basic4android\libraries\google-play-services.jar'.


Tested and working:
FireBase Ads
FireBase Remote Config
FireBase Analytics & crash reports
FireBase Notifications / Push messages

Do I have to use an older version of google-play-services.jar? Any idea on how to work with Google Play Services v30?

Thanks
 
Last edited:

ivan.tellez

Active Member
Licensed User
Longtime User
Thank you. I still don't understand why the old solution can not be maintained

You have the answer.

The old solution still sometimes works but is unstable.


I also worked with VB6, I actually mantained a couple of systems working fine along windows 98, 2000, Xp, Vista and 7, just dealing winth some UI tweaks in XP, then some security managment on Vista. Well mantained code in Vb6 Worked fine for almost 15 years.

As for Android, you have to leave the windows thinking. Nowadays, XP still has more than 20% of the windows marketshare, but, Android prior to 4.1 has les than 3% of android marketshare. So, why bother to mantain old code if nobody is going to use it?

I Upgrade all the code in my Apps to leave behind those old versions this january.

You should get the new B4A 6.0, update your SDK and put your code up to date.

If you have more questions, please estar another thread, this is for Google Maps.
 

RichardN

Well-Known Member
Licensed User
Longtime User
Slightly confusing.....

The example manifest for Version 6 at the top of this thread appears to be missing the following couple of lines, it will not compile without:
B4X:
AddApplicationText(
<meta-data
  android:name="com.google.android.geo.API_KEY"
  android:value="AIzaSxxxxxxxxx "/>

<meta-data android:name="com.google.android.gms.version"              <<<<<<<<<
   android:value="@integer/google_play_services_version" />              <<<<<<<<<
)
 

Daniel-White

Active Member
Licensed User
Longtime User
I ha

I have the same message but using B4A Ver 6.0 ?? when I try to run my old project from B4A 5.8 However the example of the post 1 work fine.
 
Last edited:

Daniel-White

Active Member
Licensed User
Longtime User
I added it and now the map is working. in the example of post 1
 

Daniel-White

Active Member
Licensed User
Longtime User
I added it and now the map is working. in the example of post 1
Fixed, so simple really. only need add the custom MapFragment1 that is it. in my case I put it in visible = false in the Abstract designer. on purpose, and work fine. from B4A 5.80 to B4A 6.0 with out any pain , don't need change any code.

I keep using my API key of google map in the manifest with the Snippet B4A 6.0 manifest code. I import my project to firebase with the wizard of Firebase console,
I added the json file to project, I don't know if I really need it there.

using google map lib ver 2.0 and GoogleMapExtras too
and the play-service.jar empty gave us from Erel in this thread. to share lib folder .

and added in the manifiest.
AddApplicationText(
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="AIzaSxxxxxxxxx "/>

<meta-data android:name="com.google.android.gms.version"
android:value="@Integer/google_play_services_version" />
)

The google map is now very nice.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…