tags:

views:

67

answers:

2

Hi All,

I have seen the BusinessCard example provide in Android examples.

I am using ContactAccessor abstract class to seperate out the SDK versions.

My code is running fine for 2.0 onwards, but when I am trying to build the code in Adnroid 1.6 I am getting the following errors:

  1. Build.VERSION_CODES.ECLAIR is not resolved.
  2. Getting errors in the whole class in which I have used Contacts APIs from 2.0 (say in class ContactAccessorSdk5.java).

How to resolve these issues?

I want to run my App on both the versions.

Please help me.

Regards,

Dhaiwat Bhavsar.

A: 

I'm sure this has been asked on the site before, but it boils down to a few points:

  • Compile against the later version of the SDK (2.0.1 or later)
  • Read the Backward Compatibility article on the Android Developers' site
  • Implement your calls to the contacts APIs by means of a wrapper class
Christopher
A: 

In your Eclipse environment, open Project Properties of your project, in Android section, select Android 2.0 as Project Build Target, then click Apply/OK. If you want to test on Android 1.6, just run the app on Android 1.6 emulator/device (always build with Android 2.0)

Bao Le