Android library and Emulator - android

This question may seems very stupid but I'm really stuck. To run the map on my app on my emulator I need to run with Google Api library and on emulator), but for textview and rest of the stuff I run with Android 4.2.. How can I run the whole app?

When you choose "Google APIs" as your SDK target, that includes the full Android API for that level as well.
Thus, if you choose "Google APIs (level 17)", that will include Android 4.2.
Note that in addition to the setting the appropriate API level, you may need additional libraries to support particular Google services. For example, see https://developers.google.com/maps/documentation/android/start for details on adding the maps library, or http://developer.android.com/google/gcm/gs.html#libs for details on adding the helper libraries for Google Cloud Messaging.

Related

How to implement google maps with best possible backward compatibility in an android?

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.

Which one to choose as Project build target ? Google APIs or SDK platform

I have been searching but couldn't find the difference between both of these things. I have read other questions in which people have said that we should use Google Apis as build target when we want to integrate Google Maps Api or use other Google apis.
The problem is that i am using maps on projects that were build on simple Android 4.4 not Google API (platform 4.4) and the maps are working just fine on my Galaxy s3.
How are they possibly working?
And if they are working then what is the difference between Google APIs and SDK platform?
Or is the difference only related to emulators?
It is really pointless to use the Google API's now because most if not all things included in that have been deprecated and moved to google play services. Selecting Google API will not do anything except maybe increase the size of your program. The difference being is in addition to the 4.4 SDK you would also get all the Google API stuff with it
You don't need (but it won't hurt you) to use Google APIs if you use Google Maps Android API v2. Google APIs is for when you work with deprecated Google Maps Android API v1 or you program USB.
The google API includes Google Maps and other Google-specific libraries. The Android one only includes core android libraries.
As for which one to choose, I would go with the Android API until you find that you need the Google API; such as when you need Google Maps functionality.
http://code.google.com/android/add-ons/google-apis/index.html is a link to the Google API page.

Targeting Google APIs

I'm new to Android Development and Eclipse and I'm going through the various tutorials.
When setting up Eclipse I installed Android 2.3.3 SDK Platform along with Google APIs for that platform.
When I create new projects for most all of the tutorial programs I select Android 2.3.3 as my target.
However, when going through the Google Map Views tutorial I am told to select Google APIs instead of Android 2.3.3 when creating the project. I did this and the map view program works just fine.
But this seems like a binary OR decision; I'm allowed to select one or the other. Does the Google APIs include all that's in the Android 2.3.3 platform? In other words could I just always select Google APIs target for the platform level that I want and it would work?
Thanks,
Dean
Yes, it would always work because the Google APIs is a superset of the Android SDK.
Google APIs Add-On is an extension to the Android SDK development environment that lets you develop applications for devices that include Google's set of custom applications, libraries, and services. A central feature of the add-on is the Maps external library, which lets you add powerful mapping capabilities to your Android application.
You shouldn't make use of it unless you need to. This will save the system the extra work required to load these unnecessary features at runtime.
Right now the Google API SDK is mostly used for the proprietary Google Maps API in it.
You only want to select this as your target when you require specific API's inside of it. If you don't use Maps in your app, you can usually leave it off. It does include everything that is in its accompanying Android SDK.
When you select this as your target, it makes it so only devices that are running a ROM with the Google API SDK can see your app on the market.

Considerations for updating Android app using Android API to Google API

I have an Android geolocation application released into the market named apna ilaka.
It is using Android API level 2.1. In order to allow a user to add places I would like to display a Google map with which the user could find different locations and would be able to add place indicators and information.
Following are my questions :
Do I really need to change my Android API level to Google API level in config path?
Since my app is already in market if I upload this new apk on market will it create any issue in updating the software on user side?
You only need to update the API level of you app if you want to use any api that are higher than the currently set level.
Supporting multiple API levels can be tricky but it isn't a nightmare, check out this great post by google on this subject:
http://android-developers.blogspot.com/2010/07/how-to-have-your-cupcake-and-eat-it-too.html
I guess you are talking about "Google API" versus "Android API"? If you need Google Maps you will need to use "Google API" as it contains the Maps libraries. Otherwise you could not use Maps classes when developing/compiling.
No, as far as I know you should not have any problems.

Android app using Google Maps library, installable everywhere

Is it possible to use Google Maps Android library in my app in a way, that the app can be installed even on phones without Google Maps? On phones without Google Maps, the maps feature would be disabled.
Is it possible to use Google Maps Android library in my app in a way, that the app can be installed even on
phones without Google Maps?
There is an undocumented android:required="false" flag you can put on the <uses-library> element. I am hopeful that they will document this in a future release. With that set to false, you would need to use reflection to see if Google Maps is loaded (e.g., try to find the MapView class) -- if not, disable whatever would lead the user to a map.
If anybody else has the same problem (I do):
On this Android Developer page it says -- as far as I can tell -- that you can reference the Maps API and thus have e.g. a map activity in your app by using Google Play services:
"The Google Maps Android APIs are not included in the Android
platform, but are available on any device with the Google Play Store
running Android 2.2 or higher, through Google Play
services.
To integrate Google Maps into your app, you need to install the Google
Play services libraries for your Android SDK. For more details, read
about Google Play
services."
Apparently it is an actual app (it is installed on my phone) that updates certain Google stuff.
So it seems it is possible, but only for devices running Android 2.2 (API level 8) and above.
I find the explanation on that site a bit unclear, however, and I have not been able to test this on my own.
In my case, I guess I have to live with the fact that not all devices will be able to install my app, since I target an API < 8.

Categories

Resources