Where are the Android API Demos? - android

From where can I download apidemos for Android 2.1?

For API 18 its on sdk/samples/android-18/legacy/ApiDemos
and
for others its on sdk/samples/android-x/ApiDemos

Hi dey are available in the folder android-sdk/samples/apidemos

android.googlesource.com
https://android.googlesource.com/platform/development is the official repository that contains the "API Demos" app at path samples/apidemos.
That repository is mirrored at: https://github.com/android/platform_development
${SDK_DIR}/samples/ also contains many other interesting sample apps.
I was also maintaining some unofficial demos which are more minimal than the official ones: https://github.com/cirosantilli/android-cheat

If you have just installed the Android plugin through Eclipse, check your android-sdk-windows folder for SDKManager.exe.
Double click on that and a window will pop up asking you which packages you want to install.
The APIDemos you are looking for will be in samples for SDK API 7(8), revision 1
These files shall be installed to the directory /android-sdk/samples/...

As of 2015 Google has moved a number of their Android samples apps to github:
https://github.com/googlesamples?utf8=%E2%9C%93&query=android

Currently it's in :
C:\Users\User\AppData\Local\Android\Sdk\system-images\android-25\google_apis_playstore\x86\data\app
but it's just the APK for some reason

And you can download API Demos application from Google Play

I found mine at C:\Users\User\AppData\Local\Android\Sdk\system-images\android-25\google_apis_playstore\x86\data\app\ApiDemos.

Related

Missing "<sdk>/extras/google/google_play_services/libproject" folder after update to revision 30

I updated the Google Play Services version from the revision 29 to 30 using the Android SDK Manager, but after updating the directory "<sdk>/extras/google/google_play_services/libproject" disappeared, leaving only the directories "docs" and " samples".
I've tried uninstall and reinstall several times but always happens to miss the directory "libproject".
Anyone had this problem with the update?
I'm using Debian Linux 8.4 (jessie) although not believe it has anything to do with the problem.
Looks like Google just broke down Google Play Services into multiple libraries. You'll find them in <sdk>/extras/google/m2repository/com/google/android/gms, if you also updated Google Repository through the SDK Manager.
The individual libraries are in aar format, so you'll have to extract the jar yourself, if that's what you're after.
I am working on a legacy project in Eclipse and I fixed the problem a slightly different way than the others. For me using the project from Google Play Services revision 29, had all sorts of dependency problems which I could not resolve. For example it wanted the compatibility library v4 so I imported it but even then it could not find some required resources.
However, I was able to use Revision 28 without such issues and set the minimum version of my app to be ICS. Below is a link to version 28. Download it, unzip it and extract the libproject folder to where it would normally have been prior to removal.
Import the project in Eclipse (ensure copy files is selected) the usual way and all will be fine.
https://dl-ssl.google.com/android/repository/google_play_services_8298000_r28.zip
For now I downgraded back to revision 29 (and worked well) using the version history available on this site: http://www.smorgasbork.com/2015/01/05/google-play-services-sdk-version-history
I believe it is possible that this is the new format that Google will provide the libs (in .aar files) up because of the description of the update:
The revision number 29 says "client library and sample code" and the revision number 30 says "javadocs and and sample code".
The m2repository folder contains aar files used for android studio. If you look at the samples folder and open some of the sample apps project.properties file you will see that the sample apps still reference the google-play-services_lib. This is for sure to be fixed by google, I saw also people complaining about display ads problem, so maybe they will come back with an update quite soon.
I posted a question about this in the Google Mobile Ads SDK Developers forum. Summarizing the steps in the answer (from Veer Busani, Mobile Ads SDK Team):
We would never recommend you to rename/edit any part of the Android SDK. If you find any issues, do let us know and we would look into it. As to your Mobile Ads/Unity/Android integration, I will certainly help you. Please follow these steps if you are on Google Play Service revision 30.0 (v 9.0) -
Make a new project and import the Mobile Ads Unity package.
Copy our demo script, make a new empty GameObject and add the script as the component.
Right click on Assets > PlayServicesResolver folder and select Google Play Services > Resolve Client Jars.
There is a known issue with GMS revision 30 in Unity. To build for Android, you would need to select Assets > Plugins > Android > firebase-common-9.0.0.aar file and in the Unity Inspector, deselect Android under the Platform for Plugins sections.
Finally, edit the Bundle Identifier in your Player Settings and deploy your awesome project to your Android device.
This worked.

Google-Play-Services Lib Project - Gone Today After SDK Update [duplicate]

I updated the Google Play Services version from the revision 29 to 30 using the Android SDK Manager, but after updating the directory "<sdk>/extras/google/google_play_services/libproject" disappeared, leaving only the directories "docs" and " samples".
I've tried uninstall and reinstall several times but always happens to miss the directory "libproject".
Anyone had this problem with the update?
I'm using Debian Linux 8.4 (jessie) although not believe it has anything to do with the problem.
Looks like Google just broke down Google Play Services into multiple libraries. You'll find them in <sdk>/extras/google/m2repository/com/google/android/gms, if you also updated Google Repository through the SDK Manager.
The individual libraries are in aar format, so you'll have to extract the jar yourself, if that's what you're after.
I am working on a legacy project in Eclipse and I fixed the problem a slightly different way than the others. For me using the project from Google Play Services revision 29, had all sorts of dependency problems which I could not resolve. For example it wanted the compatibility library v4 so I imported it but even then it could not find some required resources.
However, I was able to use Revision 28 without such issues and set the minimum version of my app to be ICS. Below is a link to version 28. Download it, unzip it and extract the libproject folder to where it would normally have been prior to removal.
Import the project in Eclipse (ensure copy files is selected) the usual way and all will be fine.
https://dl-ssl.google.com/android/repository/google_play_services_8298000_r28.zip
For now I downgraded back to revision 29 (and worked well) using the version history available on this site: http://www.smorgasbork.com/2015/01/05/google-play-services-sdk-version-history
I believe it is possible that this is the new format that Google will provide the libs (in .aar files) up because of the description of the update:
The revision number 29 says "client library and sample code" and the revision number 30 says "javadocs and and sample code".
The m2repository folder contains aar files used for android studio. If you look at the samples folder and open some of the sample apps project.properties file you will see that the sample apps still reference the google-play-services_lib. This is for sure to be fixed by google, I saw also people complaining about display ads problem, so maybe they will come back with an update quite soon.
I posted a question about this in the Google Mobile Ads SDK Developers forum. Summarizing the steps in the answer (from Veer Busani, Mobile Ads SDK Team):
We would never recommend you to rename/edit any part of the Android SDK. If you find any issues, do let us know and we would look into it. As to your Mobile Ads/Unity/Android integration, I will certainly help you. Please follow these steps if you are on Google Play Service revision 30.0 (v 9.0) -
Make a new project and import the Mobile Ads Unity package.
Copy our demo script, make a new empty GameObject and add the script as the component.
Right click on Assets > PlayServicesResolver folder and select Google Play Services > Resolve Client Jars.
There is a known issue with GMS revision 30 in Unity. To build for Android, you would need to select Assets > Plugins > Android > firebase-common-9.0.0.aar file and in the Unity Inspector, deselect Android under the Platform for Plugins sections.
Finally, edit the Bundle Identifier in your Player Settings and deploy your awesome project to your Android device.
This worked.

Download Google's API in Android SDK Manager

According to Android documentation, Google API is included in Android 4.0.3(API15), however, it did not download for me and there is no option for me to add third party APIs anywhere (see image below)
Is there a way to add Google APIs by Google Inc.?
Thanks!
I Googled your question, and it turned out another StackOverflow question regarding this matter.
Maybe this solution would help you.
Eclipse/Android: can't install Google APIs targets
Basically it says you need to update your ADT Plugin for the eclipse.
try performing the update that shows up in your ADT (can see it in the image you posted)
Good luck
When I run my SDK manager the Google APIs shows up under Android 4.0.3. Maybe update your Android SDK Tools?

Android SDK source code

I need to look at the .java files of the android sdk. I have developed applications before but I never needed to look at them so it wasn't a problem then. I saw there is a jar file android.jar that contains all the class files structured but actual sources are not there. git gives various problems to me because I am behind a weird proxy so http://source.android.com/source/using-eclipse.html hasn't been very helpful. What should I do?
EDIT: I'm talking about the java files, just to clarify. And in case you are okay with browsing the code online, Where can I find Android source code online? http://www.google.com/codesearch/p?hl=en#uX1GffpyOZk/core/java/android/
Just open the Android SDK Manager and select the Sources for Android SDK of the API level you are trying to support and click Install packages:
(In this case I selected those for SDK v4.3 API-18 and SDK v4.2.2 API-17 but I already have them installed)
If for some reason you SDK manager button doesn't show up on the Eclipse toolbar, follow this recommendations.
To link the source code to Eclipse just follow this instructions; Android Sources are usually under [ANDROID_SDK_FOLDER]/sdk/sources/android-[API_LEVEL]
You can download the ICS sources via the adk manager to your local machine and then attach them to your project in you IDE. See e.g. the blog of Lars Vogel
It is a online latest linux and android source code browsing website.
Android/Linux Source Code Cross Reference
http://hala01.com/
You can browse the .java files of the Android SDK here:
http://grepcode.com/project/repository.grepcode.com/java/ext/com.google.android/android
The links in the other 2 answers, http://hala01.com/ and http://grepcode.com/project/repository.grepcode.com/java/ext/com.google.android/android are no longer working.
You can download and view android SDK source code from this site. As of today in October 2021, source code of up to API level 31 is available.
Since such websites may become unavailable in the future, you may want to download local copies for safe keeping.

Android SDK Examples

My Android emulator contains A list of 'API Demos', including a nice looking password PIN form (with validation) within the App->Device Admin section.
Any idea where the source can be found? Or does anyone know of a good example off a user PIN input sample?
All the examples are included with the Eclipse ADT plugin, I think. Start a new "Android Example" project and you can choose any of the samples.
The samples source and project can be found in your sdk directory. Specifically under ANDROID_SDK/samples/android-XX/ApiDemos (where XX is a certain API level)
If the samples folder is not present, you have to install the samples via the SDK manager first.

Categories

Resources