I currently have an app which is set to support Android 2.2 and have the Android Manifest file the line of code to enable the app to be installed on to the SD Card. I want to be able to make the App also support Android 2.1 and above. Is there a way I can do this or do I need to have two separate apps. One for Android 2.1 and another for 2.2 and above.
Thanks for your help
No.
Simply in the Manifest editor add the uses-sdk in "Manifest extras" and set only the minSdkVersion attribute to an API version of your choice. Don't set the Targetsdkversion.
This works for my apps.
I set:
android:installLocation="auto"
and
<uses-sdk android:minSdkVersion="7"/>
You can find all this information on the Android dev guide
Related
I learnt i can filter out devices to which my android application is available by using
certain conditions in Manifest file.
But is it possible to specify the Android Version used in the device as a filter?
Scenario :
i actually wan to restrict device based on Android version used in the device..
for example in Galaxy S3 the android Version is 4.0.4...
so if i do the configuration, the only devices with Android version 4.0.4 will be able to download my app in Google store..
if so please suggest.
Your question is unclear to me.
This is how you can set which version of Android can install your app.
<uses-sdk android:minSdkVersion="integer"
android:targetSdkVersion="integer"
android:maxSdkVersion="integer" />
Note: The version numbers are SDK version NOT the Android versions.
Refer docs for more details. Here you can also see what SDK Level corresponds to which Android Platform version.
You use this element in the manifest fo accomplish that, have a look at the Android developer's site:
<uses-sdk>
Lets you express an application's compatibility with one or more
versions of the Android platform, by means of an API Level integer.
The API Level expressed by an application will be compared to the API
Level of a given Android system, which may vary among different
Android devices.
Yes, as like above suggested answers we can restrict using uses-sdk
Below screen shows, which API Level represents which Android Version.
This should be useful to some one.
This can be seen in android SDK Manager.
I set up my project to use Android 3.2 (API Level 12), but it seems like a lot of phones are still using Android 2.2 (API Level 8).
Is there a way to change my project from only supporting Android 3.2+ to supporting back to Android 2.2?
yes...just change the minsdk number in the manifest. You have to be sure that you don't use any feature that is not supported though...
in your AndroidManifest.xml add this line:
<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="16" />
android:minSdkVersion tells the Store what the minimum version you are targeting is. In this case 2.2. Devices less than 2.2 won't be able to download your app.
android:targetSdkVersion tells the store what the best version you are developing for is. In this case 4.1. Devices over 4.1 can still download your app but certain features may run in compatibility mode.
NOTE: When you setup your project to use 3.2, all you did was select the Android SDK you wanted your IDE to use when checking and compiling your code. Without the uses-sdk line in your manifest you've targeted nothing.
Right Click Project -> Properties -> Android -> Select SDK version
Update Manifest, min/target api. (as others have described by others).
Go to your Manifest.xml file and edit the minSdkVersion to 4. That will set it way back to 1.5 or something like that :). You can make that number higher if you want to suit a higher API, but I like compatibility.
in my app i have two set of designs. One design is for the android devices version of 2.1 and 2.2, the other design is for devices of 2.3 and above.
Now the problem is i take a build setting as follows in my manifest file
<uses-sdk android:minSdkVersion="7" />
<uses-sdk android:maxSdkVersion="8" />
My android project properties in been set to 2.2. When i run this build in 2.3.4 devices it gets run properly. How does it happens?
I am planning to submit the app with multiple apk files in market. How to block my apps
one build to be run in 2.1 and 2.2 and
the other build to get run in 2.3 and above
I just tried setting only <uses-sdk android:minSdkVersion="7" /> or <uses-sdk android:maxSdkVersion="7" /> or <uses-sdk android:maxSdkVersion="8" /> or
<uses-sdk android:targetSdkVersion="8" /> then also it gets run in all devices of 2.3.4 devices
Please help me friends....
Hey as per the android documentation :
Introduced in: API Level 4
Future versions of Android (beyond Android 2.0.1) will no longer check or enforce the maxSdkVersion attribute during installation or re-validation. Google Play will continue to use the attribute as a filter, however, when presenting users with applications available for download.
You might want to have a look at last few lines of this link
EDIT1:
Also have a look at the Warning
Warning: Declaring this attribute is not recommended. First, there is no need to set the attribute as means of blocking deployment of your application onto new versions of the Android platform as they are released. By design, new versions of the platform are fully backward-compatible. Your application should work properly on new versions, provided it uses only standard APIs and follows development best practices. Second, note that in some cases, declaring the attribute can result in your application being removed from users' devices after a system update to a higher API Level. Most devices on which your application is likely to be installed will receive periodic system updates over the air, so you should consider their effect on your application before setting this attribute.
According to documentation:
Future versions of Android (beyond Android 2.0.1) will no longer check or enforce the maxSdkVersion attribute during installation or re-validation
http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#max
Alternatively, you can check API version at runtime and block the use of your app.
http://developer.android.com/reference/android/os/Build.VERSION.html
You can install it using the adb or directly downloading the apk through a website.
The minSdk and maxSdkVersion is checked only when its installed from Android market. Devices with versions out of this range will not see your app in the market.
You need to use PackageManager Class for Version Specific Application. There is a method called getPackageInfo() which returns an object of PackageInfo. From this PackageInfo, you can fetch values of Version Name & Code.
Now you have values, so use logic and implement it
I want to make application that support 2.1 or higher platforms. Does anyone have solution for it?
Can I use somekind of cross-platform for it or cross-platefroms are only for porting applications from differnt OS? Or there is any library i can use for this purpose?
Any application built with Android 2.1 API will work later versions of Android (theoretically). In the AndroidManifest.xml file, set the target SDK version to 2.1, and the 2.1 API will be loaded by Eclipse for the application. Done. It's still recommended to test it on later versions in case there's some slight variations that aren't documented, but most if not all things should work.
Just code your application and in your AndroidManifest put this somewhere <uses-sdk android:minSdkVersion="7" />.
That corresponds to Android 2.1, more details here http://developer.android.com/guide/appendix/api-levels.html
I'm building an 2.2 and up version application.
This gives me some problems using a webView,
mainly because Flash won't work on a 3.1 device.
I have looked into this and the solution states that i should add :
android:hardwareAccelerated
in the Manifest.
or
getWindow().setFlags( WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED,
WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED);
in the code
however, since I am using android 2.2 to create the App, this is not possible.
Would the only way to get this working be to create in 3.0 ?
I think you should be able to do something like this in your manifest file:
<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="11" />
That'll set the application target to Android 3.0, so you can use the hardware acceleration tag in the manifest file, but allow the application to be installed on Android 2.2+.
Just make sure that you're only using API's available in Android 2.2.