How to run Higher version application in lower version? - android

I have developed one application which is running properly in android 4.0(icecream Sandwhich) but not working in 2.3.3(ginger Bread).
It is showing the error like process example.app_name is stopped unexpectedly in 2.3.3 but its
working fine in 4.0.3.
Is any one know that app has to be run on version 2.3.3 ?
Thanks in Advance...

try this it may work
add this line to your code in AndroidManifest.xml
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="15" />
add this as child of <manifest> tag and change values according to your needs

First of all, you need Support Library
The Support Package includes static "support libraries" that you can add to your Android application in order to use APIs that are either not available for older platform versions or that offer "utility" APIs that aren't a part of the framework APIs. The goal is to simplify your development by offering more APIs that you can bundle with your application so you can worry less about platform versions.
Go thrue the step Setting Up a Project to Use a Library
And also set the min. SDK version in Manifest, otherwise you won't be able to install your application to device

Related

Added Android TV to existing app, now can only support back to Android SDK 17

I added Android TV support to an existing app. I then had to increase the min SDK version to 17 from 14. Indication was the leanback library could not support below SDK 21, however, I seem to be able to use 17 as the minimum. I did have to add the following to my Android Manifest:
<uses-sdk
xmlns:tools="http://schemas.android.com/tools"
tools:overrideLibrary="android.support.v14.preference" />
This has to be a configuration issue in the manifest. Is there any further configuration required? The app does work on phones, tablets, and Nexus Player. It just doesn't support back to Android SDK 14, which has been requested by some users.
Code is here:
https://github.com/MythTV-Clients/MythtvPlayerForAndroid
The Leanback library has a minimum SDK version of 17. If you want to add Android TV support, you will need to add another module.
Looking at your project, it seems like "domain" and "presentation" are separate modules for the project. You can add one for "TV" and put TV specific code there. When the user installs the APK the correct version will be downloaded.
You can put phone specific code in a "phone" module. Shared code can be a "shared" module which can be compiled for both platforms.
Let me know if you have any questions with using modules.

How to downgrade from android 5.0 to android 4.1 on eclipse

My application can only be used on android 5.0 or higher. How would I go about downgrading to version 4.1 in eclipse so older phones can use it.
The answer to your question is in the documentation: http://developer.android.com/guide/topics/manifest/uses-sdk-element.html
And this is useful fragment from that page:
<manifest>
<uses-sdk android:minSdkVersion="5" />
...
</manifest>
In case you donĀ“t get a better answer:
You can create a new project for android 4.1, configure the build path and copy src folder.
Not the best method though. Just the one I normally use (the only one I know) and works.

Problems editing target in project properties

I have a library project whose target in project.properties is android-11. I wanted to create an app which uses that library, but compatible with android 4.1.2, so i edited also the library target with android-16.
But when i've done this change, the application gave me some problems and didn't work as before: for example in devices with software menu buttons, the buttons did not appear.
Can you tell me why? Thanks
first of all pls goto the SDK manager and check if you have SDK for Android 16 or above installed. If not please install it, if you have already installed then don't change anything in then project.properties, goto AndroidManifest.xml and make sure that "maxSdkVersion" is equal to above 16, if not it means that the library is depreciated and you cannnot use it for latest version. But generally most of the old libraries would support new SDK builds, so I suggest you to leave it as android-11 as it makes no harm
<uses-sdk
android:minSdkVersion="3"
android:maxSdkVersion="16"/>

Android importing project of different API level

I am already having one small project in android that is build in API-10.
And i am using the latest version of the API-17 and having the same SDK manager.
Now when i import this project it shows error like Unable to resolve target 'android-10' and some more lines.
So, when i Googled about this problem i found that i think i need to download API-10 and the SDK.
So i wanted to know why its needed?
Because my existing code is built in API-10 then i think it should be compatible with API-17.
I am new to Android i just understood some concepts like Activity, Services and many more but when i came around this issue i really shocked?
I just wanted to understand why its needed while i am already having SDK for API-17?
try by adding targetSdkVersion to the manifest file
<uses-sdk
android:minSdkVersion="10"
android:targetSdkVersion="17" />
and clean your project, that might also help
What that means is you need to start your Android SDK Manager and download and install API Level 10. Why do you need API Level 10 ? Well, the project you are importing needs that API level.

Do I need to uses always the last targetSdkVersion?

Simple question: In Eclipse "New Android project" command always tries to uses last available sdk. Is it always a good idea?
UPDATE:
I try to explain. Now in Eclipse, "New project" produces a manifest with:
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
So, target to the last Android (Jelly Bean, 4.2.x) but it can run also on Froyo (2.2). It's ok for me. What could I do very wrong with this choice?
UPDATE
Is it ok if I set android:minSdkVersion="8" + android:targetSdkVersion="17" and the build target to 2.2 to be sure my app will run on older devices (no NoSuchMethodError exception)?
What could I do very wrong with this choice?
There is nothing wrong with this choice, which is why the build tools default to it.
Setting the targetSdkVersion opts you into specific behaviors that you might not get with an older targetSdkVersion. You can see some of what you get by reading the documentation for Build.VERSION_CODES.
If you want to develop applications for an older version, it is not a good idea. You can always check what the most used version is and make your application against that version. In some cases it is needed to use the latest version because some functionality is not yet implemented in an older version.
You can read more about it here: http://developer.android.com/guide/topics/manifest/uses-sdk-element.html
But you should almost always have target as the latest and then change minimum to the oldest you want.

Categories

Resources