Dunnow
Dunnow

Reputation: 414

Developoing for android 2.3 and 4.0.3 in a single prject?

Well, lately i've been coding an app using 2.3 emulator, I was mainly testing the app in 2.3.7 phone, but yesterday I updated my phone to android 4.0.3 and the UI looks like shit, in fact, keeps the "bad" looking 2.3 UI.

Now i'm trying to get a nice looking app in both versions of android, the problem is that i don't want to have 2 separate projects an edit both of them, so i want to use one single project and 2 virtual machines for the different versions.

The problem is that if i create a project destinated to 2.3 i can't call to HOLO Theme resources, and if I create a 4.0.3 project it will not even work in android 2.3 right?

so... what do i need to do?

thanks.

Upvotes: 2

Views: 2899

Answers (1)

MSD
MSD

Reputation: 2647

  1. You need to set the targetSDKVersion as 15, minSDKVersion as 10.
  2. You need to create various resource folders for these two versions. Example, create a folder 'values-v14' inside 'res' folder and define your widget styles for ICS. Have another folder 'values-v10' and keep your styles for 2.3.3
  3. If required, use the version qualifiers to define separate layout for different versions. The below links will give you more clear idea.

http://developer.android.com/training/basics/supporting-devices/platforms.html

http://developer.android.com/training/backward-compatible-ui/index.html

Upvotes: 4

Related Questions