Using Google maps in an android library - android

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.

Related

can I use google recaptcha in a android library

I know that one can integrate recaptcha in an app, but I want to know If I could use it in a library that would be used by hundreds of apps for example and not require to add the package names individually for each app that uses my library?
Each app would still need to setup their own recaptcha account to get an API key etc.
But you could make the recaptcha library a dependency of your library in gradle so for any app using your library the recaptcha library is also installed.

Google maps containsLocation on android

I'm writing an app that needs to determine whether a user falls within one of several defined zones (based on gps location).
The Google maps javascript API has an easy to use function containsLocation(). However I want to be able to do this from an app on android, not a web-based service. Does anyone know if such a call exists in the android version of maps? Any pointers will be helpful!
A bit late, but here's the answer: com.google.maps.android.PolyUtil.containsLocation() from Google Maps Android API utility library.
You can use the Geofencing feature for this purpose. The API's for that are a part of Google Play Services library and hence you can start using it by importing it into your app project.
It even gives the notification if a particular user has entered or exited a specific geofencing location in order for a developer to monitor the number of mobile devices entered in the zone he defined. The implementation is pretty simple, I am pasting some links that may guide you further.
This is Google's official documentation about Geofencing:
http://developer.android.com/training/location/geofencing.html
This link actually implements an app for geofencing.
And this is another link if you want to use a third party plugin in order to get geofencing in your app.
Hope this would help!!!

Google Maps Coordinate android

I want to use google map coordinate in my android application.
http://www.google.com/intl/en/enterprise/mapsearth/products/coordinate.html?utm_source=google&utm_medium=cpc&utm_campaign=NA-LCS-2013-Geo-Products-MapsCoordinate-HouseAds&utm_term=%2Bgoogle%20%2Bcoordinate&utm_content=SearchAd&gclid=COy759vU2LsCFVMdtAodNGYAdg
I found this example on google play: https://play.google.com/store/apps/details?id=com.google.android.apps.geo.enterprise.flak
I searched on internet but didn't find documentation about how to implement google coordinate in my anndoid app.
Did any one used this before? If yes can you please put links of tutorial or links of samples?
Try this link, to the Google Maps Coordinate API Client Library for Java.
Otherwise, if you want to start from scratch, it's a RESTful api. There are a number of clients and libraries that you could use, including Volley. Also, here is a tutorial for making remote calls.
You can find everything you need here.
I have done it following this official tutorial recently. The version 2 of Google Maps Android API is different from version 1 in many points.

Open source Google analytics lib for android

I need to report some events from my android app to GA, but main requirement is not to use API lib in dependencies - all analytics-related code should be encapsulated in my app package (actually it is not an app, but SDK). So I'm looking for some pieces of code for constructing Google Analytics API queries. Can anyone advice something?
See Manually sending data to Google Analytics
A Java library (designed for desktops, but it should probably work in Android) can be found here: http://code.google.com/p/jgoogleanalytics/

Combining main project with google maps project

Quick question regarding Google Maps. I have one fully working Google Maps project and another working project for my main application. I am wondering about combining these. How does one go about doing adding the Google Maps API functionality to the existing Android project.
I have tried researching this online but my search terms seemed to be a bit ambiguous.
Thanks.
Assuming you are using a Single MapActivity, copy that activity to the other project and change the Target Platform for the existing android project to Google API <VersionNo>
Add the Maps API library to your project's Manifest file
<uses-library android:name="com.google.android.maps" />
Obtain the Maps API key, add to your project and also sign the app with the certificate corresponding to the same key
http://code.google.com/android/add-ons/google-apis/mapkey.html
You can easily integrate Google maps with a Maps view into your application.
But make sure you to sign your application with the key that was used for receiving the google maps api key. Otherwise nobody will see the maps when your application is published.
If you have the plugin
Go to:
project,
properties,
android,
on the right hand menu choose the google api of your choice
the library will be added to your project.
Remember you must add the appropriate xml resource from your project and the permissions to your manifest etc

Categories

Resources