I'm a new Android developer, I recently encountered a problem on updating my app to Android 5.0. Same issue here: Android 5.0 (L) Service Intent must be explicit in Google analytics
According to that solution, I'm gonna updating from google analytics V2 to V4 (google play service). But the painful part is seems for every page, I need to change the tracking code. There are around 30 pages(activities and fragments) in my app, this is really not scalable, and easy to make regression bugs.
I was wondering is there any better way to do the migration? Thanks.
I created a small class, it's have same siganture of v2 in the body it's call a v4 methods, you can check it at my
gist
Related
I'm building a simple android app that uses Google maps api to display map and navigation. As you may know Google maps need Play services Library to run on client android phone. i want my app to run in much older android OS's(14,15,..)
Problems:
1- Clients need to install or activate Play services app.
2- then Clients have to update play services app to the latest version to use my app with google maps.
3- how to make app to run in older androids? just by specifying min sdk ?
so in order to solve first and third problem i've no idea but for the second one :
building project with older Play service dependencies may help but i dont know how to do this or even it helps or not.
it'll appreciate if guys offer any solutions !
Thank you all.
What are the recommended practices for maintaining the widest backwards compatibility of an Android app while depending on Google Play Services?
Here are the pointers I was able to aggregate concerning backwards compatibility, including those that use Google Play Services.
The Google Maps Android API uses OpenGL ES version 2 to render the map. The least Android API version that has support for this is API 8 or Android 2.2 .
Compile against the oldest version of Google Play Services that contains the APIs that you need. As further discussed in this thread, refrain from using wildcards like 5.+ because that updates to the latest play services. Instead use a widely used version like com.google.android.gms:play-services:5.0.89.
Use the V4 support library to verify and request permissions.
com.android.support:support-v4:23.0.1
You might also check some additional insight from this SO thread.
I have a library which makes use of Google Maps. When I give out this library how do I handle the api key scenario and registration of the client app on my google dashboard for the maps to be loaded on the android app?
Is there a way that I don't manage the maps and the client using my library just does it?
So, the solution was pretty easy.
What needs to be done is remove the mention of the API key in the manifest of the library. And ask the one implementing the library to put an API key the application module's manifest.
This is a very good solution as this takes away all the headache of management of the API key from the library and gives the handle directly to the user of the library.
Many thanks to Christophe Beyls for the solution.
I want to implement Google Analytics in my android app. I'm not interested in eCommerce and Global Tracking. All I want to track is the screens visited and events generated by users.
Tried using Google Analytics V3 and it works fine.
Want to migrate to V4 (Should I?).
Google Analytics V4 is now integrated with Google Play Services, which is HUGE. I now get this 65K method problem in android.
Found a good article on that here. The Google Play Services Modular structure is for Gradle. I'm using Eclipse with the android SDK.
Is there any similar work around? Why add the huge library when you just want to use a part of it?
If I've already started an Android 2.3.3 platform and I have lots of code, how do I add a google map to my application? Do I really need to have the Google API? What is the difference?
I've added this to my manifest
<uses-library android:name="com.google.android.maps" />
Is this enough? I tried extending my class with MapActivity but doesn't work.
Do I even need this?
Thanks
Simply put, yes, you need the Google API version.
The reason for this is that the stock Android API does not come with the functionality such as Google Maps (and others, but I can't think of any at the moment).
This is the reason why, even though you added a reference to the library, your project is failing to compile. It simply can't find the library as it's part of the Google Apis.
Just change your build target to the Google API version of 2.3.3, and you should be fine. All other Android functionality is present in it, along with some other useful things so it's always a wise decision to use the Google API version by default. In my opinion at least, please correct me if there are downsides to doing this.
Does anyone have a Google Maps solution for MonoDroid? To make it work, we need to inherit from MapActivity (com.google.android.maps).
I see on the MonoDroid Roadmap that this feature is coming to MonoDroid 1.1, but there's no release date yet.
At this time, the maps API is not already bound for you. You will have to do the binding yourself. An example is available here:
https://github.com/xamarin/monodroid-samples
Since the previous post, they have now bound the google maps in the latest release. Download the latest API from xamarin and an example is here:
https://github.com/xamarin/monodroid-samples/tree/master/MapsDemo