I wrote a simple code which implements MapView using Eclipse and ADT plug-in updated today. in order to test it I created a new emulator based on Galaxy Nexus device and target for Google APIs level 17. The emulator has been created without errors and starts properly.
I set project properties for targeting Google APIs. I compiled the project and I tried to run in on my emulator, but I got a warning message: No compatible targets were found, Do you wish to add a new Android Virtual Device?
Independently on the button I click, a new avd windows appear and my new emulator is highlighted by a red cross instead of the green check sign.
I can choose to ignore the warning and continue with my emulator, but my application blocks before reaching main activity onCreate() method I am sure because I have placed a breakpoint inside the method which is never reached.
I added internet permission tag to manifest ans API keycode I got from Google.
Is anyone able to explain me what is the problem with my project?
Thank you very much.
If you used Google APIs level 17 as the target of your project, make sure your emulator's API level is also 17.
You could have possibly created an emulator using Google API but the API level is different.
To check the emulator's API level, open your AVD, then confirm if target name is Google APIs(Google Inc.) and API level is 17.
Related
I have downloaded SDK tools and installed Google API's Intal x86 Atom image, however when I want to create my AVD it sais there is no system images installed for this target. BUT I have downloaded everything. I am using Ubuntu, on Windows machine same configuration works perfect, also for my colleagues same configuration works just fine.
If I select as target Android API 23, not Google API's it's okay, but I don't need Android API, since it's not working for me. I saw lots of reported defect, but none of them could help me.
Anyone has any idea that's going on there?
I had the same problem myself today and I found a bug report:
https://code.google.com/p/android/issues/detail?id=210223
To quote the solution:
There seems to be some underlining refactoring which means the configuration now required is:
Target = Android X.X - API Level XX
CPU/ABI = Google APIs Intel Atom (x86)
So, to create a new AVD with Google APIs support, just don't pick Google APIs as the Target. Pick generic Android with desired API level as the Target and then pick your desired Google APIs version in CPU/ABI. It works just fine, you will get Google Maps etc. on the AVD.
About that "but I don't need Android API, since it's not working for me" - I'm not sure what do you mean. You can't have Google APIs without using Android APIs, because Google APIs are running on Android device.
I have Android API Levels 15,19,20,21 and Android Studio 1.0.1.
Robotium Recorder needs API 15 or higher version. Information about Robotium API support
I follow that guide from Robotium's page
and also I tried many things like those (all following steps were tested separately from each other);
I created emulators that's API level 15 and 19, Than I tried to start Robotium,It did not work.
I connected my Android phone which is API level 19,that did not work again.
I started Android Studio with administrator permission everytime.
I downloaded robotium.jar here It did not work.
I tried every method in my mind.
My minimum sdk version and target sdk version is also 19.
But when I clicked "New Robotium Test" button, immediately appears warning text that is "Please install a compatible Android API level (15 or higher)"
There is a screenshot about problem. Any advice?
You probably have two Android SDK:s installed in your computer. If you go to settings (on the left side of "New Robotium Test") you can change the SDK to be used by Robotium Recorder.
http://robotium.com/pages/user-guide-android-studio
My problem is that my Android Virtual Device (AVD) doesnt update when I update my code.
For instance, I run the AVD with my first code. Then I make some changes in the code (removing stuff and adding stuff). But still, the things that are shown on my AVD are from the old code. Stuff that should be there because I removed it from the code are still there when I run my AVD. And of course the new stuff isnt there.
I do:
Save my new changes.
Restart my AVD
But still it doesnt work.
If I restart my computer the changes might appear... help!
What helped me sometimes was deleting the old apk that was saved. For some reason it wasn't running replacing the old apk to be installed on the avd properly.
Also...more info could help. Are you running the code through eclipse/android studio/command line? Is your android application native or running html with the help of phonegap?
There is no need to restart the AVD. The thing you have to do is to reinstall yout application. Clicking Run in Eclipse will do the job.
I used the wrong API for my development. I used 20 when my book told me 17.
The Target was wrong. Used: "Android 4.4W.2 - API Level 20" but needed to use: "Google APIs (Google Inc.) - API Level 17"
I thought a higher API would be able to handle all lesser API numbers.
I dont know the difference between Targets "Android 4.2.2 - API Level 17" and "Google APIs (Google Inc.) - API Level 17" though.
Anyway all my problems seems to be resolved now.
im new to android programming and im trying to create an android app that loads google maps v2.
I got api key, my code is working with no errors, i'v used some guide to write the code
But here's the problem : if im using min Sdk Version 8 my app crash and not even starts.
if im trying higher Sdk Version i cant test it because i dont have any device besides galaxy s2 and google maps v2 cant load in the emulator.
I will be glad to hear some advices.
Use SupportMapFragment from a FragmentActivity, instead of MapFragment from an Activity. To use fragments on devices older than API Level 11, you need to use the Android Support package's backport of fragments (where FragmentActivity comes from).
http://android-er.blogspot.de/2012/12/using-supportmapfragment.html
Also Please check below step..
check if the "libs" folder containing the "android-support-v4.jar" exists in your project.
"android-support-v4.jar" is located in "/extras/android/compatibility/v4/android-support-v4.jar" under your "android-sdk" drectory.
Before running your project, you must set your project Build target to "Google APIs", not Android x.x. version : Select your project and click Project > Properties > Project Build Target in Eclipse and select any "Google APIs ", and then run your project on your phone. If you use the emulator, also MUST set the AVD of the emulator to the any "Google APIs ".
Once more, you don't need to create the new Google Maps API key in order to test your project, Just use the default provided API key, which is shown as "Key for browser apps (with referers) "in your Google APIs Console.
Finally, the most important is to add Google Play services as an Android library project as follows:
Select File > Import > Android > Existing Android Code Into Workspace and click Next. Select Browse..., enter /extras/google/google_play_services/libproject/google-play-services_lib, and click Finish.
https://developers.google.com/maps/documentation/android/start
reference link
Google maps v2 on android devices with minSDK below 11
Google has stop supporting android api version below 9, So if you are building new app set your min sdk level to 9.
And to test the google map you can use emulator just open sdk manager and install android latest version 4.4, build new emulator configured with android 4.4 and you can run google map in it. Hope this will help you
I am wondering how can I know which API level I am using with my ADT. I posted a question about an error that occurred when I was trying to run a sample app source codes which use a View (http://developer.android.com/shareables/training/Animations.zip). Someone asked me which API level I am using? So how do I know this?
When you make an Android app, you have to choose the minimum API level. You can check this in the first lines of your manifest.
You can check the API level of an android device under Settings->about phone. This will give you the Android version number (which is not the same as the API level).
You can look for the API level here when you have the version number.
If you want to get it programatically you will have to do something like this:
Integer.valueOf(android.os.Build.VERSION.SDK);
The Android SDK library is included in the project when you create a project. From there you can find out which OS version you are using and from that the api level.
If you are in eclipse and ADT is installed then right click on the project and go to properties. There select Android in resources. You can find the API level corresponding to the target OS version.