i am trying to develop a application that uses Google maps API v2 but since i can't display it on emulator, i tried to use bluestack. it seem to have google play services installed but when i run it, it has an error. i forgot is what error as it is few days ago and did not take down the error. today i wanted to run it again but eclipse did not recognize the bluestack device. usually i make eclipse recognize bluestack is opening bluestack first but it did not work this time.
i believe it is due to this error where the blue stack emulator could not set the target API
. the pic is some time ago.
i can run on my real phone where it display the map with no problem but for presentation purposes i would prefer to display it on an emulator if possible. i can also test gps by sending it location.
You need to set android:targetSdkVersion on uses-sdk in the AndroidManifest.xml file.
As new versions of Android are released, some style and behaviors may change. To allow your app to take advantage of these changes and ensure that your app fits the style of each user's device, you should set the targetSdkVersion value to match the latest Android version available.
Example:
<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="15" />
For more info, refer API Guides - <uses-sdk>
Related
In Google play (app market), if an application is not compatible to your device (for some reason, say small screen size, etc). Then it is not even shown in the list.
Now, as an app developer I never want to unintentionally add a limitation in my app that forbids it from a range of devices.
So, while developing how can I make sure that the application will be able to run on atleast the type of devices that I intend.
Also, right now I'm developing an app & testing it in on my phone with version 2.3.5. And every now & then Google changes some method names & flags.
For newer android releases, I CAN test it on emulator, but testing it on phone/tabs/etc. is a different thing.
Please suggest.
how can I make sure that the application will be able to run on atleast the type of devices that I intend.
In manifest file you can mention, which type of device you want to run your app. And for testing you can create emulators for different devices to test your app. Try to make app UI such that it runs on all devices.
Google changes some method names & flags
Whenever Android changes any thing it will always be upward compatible means if you have made app for 2.2 it will run on 2.2 and above (screen size or resolution is other thing)
Regarding UI see my answer here
Layout for 720*1280 devices
By default apps will be available to as wide a range of users as possible.
There are certain limitations you can define in your manifest file, such as not being available on small screen sizes, but they are at your discretion.
The only limitation Google imposes on you is that any user who has a lower Android version than your minimum SDK version cannot see your app. To get around this, you can either design the app for lower SDK versions (I believe building for 2.2 and up gives you access to about 95% of the user base) or maintain multiple versions of the APK.
Read this. It will really help. Next Eclipse will help you a lot, firstly you can define what you wish to support (screen sizes and hardware requirements or even if they're not necessary but may be used) in the manifest. You can run a version check and implement APIs dependent on which version of Android you're running on. That's personally what I do, I check the API level and if it's greater than or equal to the API I wish to run I run it, otherwise I attempt to find compatible code (often using the compatibility library) or alternatively drop support for that feature, for example JellyBean notifications there's not really any work around for expanded notifications but I can use the NotifcationCompat builder.
Please i have different platforms installed. I just wanted to know what am supposed to do. If i develop with 3.0 platform, would those with a 2.2 be able to use my app??..
The second question which is the main question is I always get this error when i create android projects..
[2011-05-16 16:32:21 - Hello World] Dx no classfiles specified
[2011-05-16 16:32:21 - Hello World] Conversion to Dalvik format failed with error 1
What do I do to it?
There are several reports out there for that error (e.g., this one. All the solutions point simply to reload the project (select it in the tree at your left, and press F5).
Regarding the first question, unless you want to support Honeycomb-only features, then set up the api level to 8 (Froyo).
Eclair, Froyo and Gingerbread are android versions 2.1, 2.2 and 2.3 respectively (also referred in the documentation as API levels 7, 8 and 9). See the table here. If you want to support just mobile phones, set your target to 2.1 or even lower. That way you will be able to target most of the phones in the market. Your app will also run in Honeycomb (3.x) devices.
Honeycomb has new features to support larger screen devices, so if that is your main target, you might consider taking advantage of those features and drop cell phone support. All will depend on what is your objective.
you should have a look at the minSdk and targetSdk features of a manifest file :
<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="8" />
This will help you target a android sdk version and precise what is the minimum sdk level that can run your app.
Regards,
Steff
Developing for Honeycomb or non-tablet version of Android, is different in various things. Your 2.2 application should run correctly on a tablet, but if you want to optimize the graphical interface and use all the notification and other things included only in Honeycomb, then you must use the appropriate API. Until Ice Cream Sandwich is released, we have to develope two different application for the best result.
Regarding the error you get with android projects (I suppose under eclipse?) you'll find some detail at this link, but if you follow all the instruction provided by google in the developers page, you'll be able to write and run your Hello World application.
I built my applications without specifying a minimum sdk in the beginning. However after I added that line to publish to market I found my applications are behaving very differently for example buttons are smaller, etc... In particular I'm having problems with an application that records sound which was working fine when no minimum sdk was specified, but crashes when I specify one. I've tried specifying the minsdk to that of my phone which is 7, but that doesn't seem to help.
What's the default minimum sdk when none is specified? I just want my application to run like it does normally.
If you don't specify a minimum or target SDK version you get a lot of compatibility mode behavior. The device you're running on is probably a HDPI device and you were probably looking at a UI scaled for compatibility mode before you added the minSdkVersion, hence the smaller buttons - your app is now running at the device's native resolution.
Apps that target SDK 3 and below acquire several permissions by default that must be explicitly requested by apps targeting newer SDK versions. Check your exception message when your app crashes, it might be a security exception for a permission that you need to explicitly request in your manifest.
See the following link for more info: http://developer.android.com/guide/practices/screens_support.html
I am making a game in Android where i am generating random number for different colored balls. Currently i am generating buttons dynamically and settings the background resource.
I am using some high resolution icons as images. However when they render on screen, all of them gets slightly pixelated and don't look good on screen. I tried it with different sizes of icons but it was of no use.
Can anyone suggest where i can be going wrong and what can be the best way to take care of these things. I am new to game programming so any help would be appreciated.
I would guess that your application is not running at your phone's maximum resolution. You need to specify the target version of Android in your manifest file, otherwise the app defaults to an early version and only runs at low-res.
If your phone supports Android 2.2 (Froyo) then try adding this line to your AndroidManifest.xml file:
<uses-sdk android:minSdkVersion="8" />
Be sure to put it in the manifest section, not the application section. If you see a line for "android:versionName" then put it immediately after that line.
If your phone doesn't support Android 2.2 then change the minSdkVersion number to 7. If it's an older version then go down to 6 or 5. You'll need to make sure you have the correct SDK files installed on your development machine. (ie: you won't be able to compile an Android 2.2 app if you only have the 2.1 SDK installed.)
I'm trying to run the google maps
example but it keep giving me in the console:
"WARNING: Application does not specify an API level requirement!"
"Device API version is 7 (Android 2.1)"
The application never starts,
instead, it shows that frame with:
"The application (...) has stopped unexpectedly..."
Can Anyone point what might be the the problem?
Thanks
I agree with Jay. That warning is not the source of your error. However, you do want to take care of that warning.
In general, you should build your apps to work on the lowest version of the API possible that supports everything you need (I don't go below 1.5 since 0.1% of current devices out there are that old). However, a large chunk still use 1.5. By using API version 2.1, you are severely restricting the devices you will run on. However, if you really need that version you should specify it as a minimum. This will prevent people who have earlier versions of the SDK from downloading your app. In your manifest you want:
<uses-sdk android:minSdkVersion="7" />.
For more info, reference this article in the developers guide.
Open up the LogCat view and you should see more details on the error. I don't think your Warning is the cause of the application not starting. The warning just says that you have not specified the minimum sdk version in your AndroidManifest.xml. It is a warning, not an error. This is good practice, but should not cause the app to crash if you don't do it.
Edit:
If nothing is in LogCat, you might consider running the app through the debugger and see if any issues show up there.