Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8145829
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T13:47:18+00:00 2026-06-06T13:47:18+00:00

I am developing an Android app in Eclipse. I would like to target a

  • 0

I am developing an Android app in Eclipse. I would like to target a wide variety of devices and SDK versions (for example, I can optionally support multi-touch). I understand the recommended approach of isolating all the new functionality to a separate class and leveraging lazy loading to only load that class at run-time if the host device actually supports the feature.

The downside of this approach is that I have to compile all of my code with the SDK of the newest feature I want to use. Which means if some new feature leaks into my "version neutral" code, the compiler can no longer catch it.

I would like the ability, within Eclipse, to compile my project against an older Android SDK to make sure my "version neutral" code is fine. I’d like to avoid moving my build system out of Eclipse, if possible. I’m okay with this old-SDK build being a bit awkward to run.

I think this boils down to doing some conditional compliation (or conditional "linking") inside Eclipse? For example, in my project when building against SDK-1.6 I’d like to leave the "MultiTouchHandler.java" source out of the build. I’m not sure if its possible to express "build types" like this in Eclipse, though.

The hacky solution seem to be just manually changing the project’s SDK version, rebuilding, and looking through the errors, and ignore ‘expected’ errors. The overkill solution seems to be writing my own ant/maven/make build scripts.

Related Questions

This question:
Versioning and common code-bases with Eclipse
covers similar ground, but would involve moving all of the version-specific classes into separate "libraries". (And I would still have the problem of multiple build types in Eclipse, I think.)

This question:
Build multiple project configurations with eclipse implies that I should move to an external build system (like ant or maven), but that’s a lot more work than just trying a build with an old SDK from time to time.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T13:47:20+00:00Added an answer on June 6, 2026 at 1:47 pm

    The February 2012 (v17) updates to the Lint Tool in the ADT should help address this without requiring multiple builds. When an app targets an old minimum SDK, but is compiled against the newest SDK (as is the recommended practice), the lint tool will notice if calls to the newer SDK are invoked. If you’re confident the call is okay (Because you’ve hidden it behind a run-time SDK_INT check, or whatever), you can Quick-Fix an annotation to prevent the warning.

    For example, in my code I have a call to View.setSystemUiVisibility, which was introduced in API 11, but I’m targetting API 8. Running Lint shows:

    Call requires API level 11 (current min is 8): android.view.View#setSystemuiVisibility

    The QuickFix suggests two kinds of fixes, either adding an annotation that suppresses the warning or adding an annotation that declares a chunk of code as working at API 11.

    More details here: http://tools.android.com/recent/lintapicheck

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing an Android app on windows, using eclipse. I would like to
I'm developing an Android app and in Eclipse, java.text.Normalizer can't be imported. It's like
I'm developing an app for Android in Eclipse. Currently I target API level 3,
I am developing Android app in eclipse with Android SDK 2.3, but i am
I like to start developing android app in Eclipse, but feeling it's not much
I'm developing an Android app in eclipse with ADT. How can I insert commands
I am developing an Android app using Eclipse 3.7.2 with the Android SDK installed.
I've been developing an Android app in Eclipse (java) using openGL ES 1.0 on
I am currently developing an Android-App in Eclipse and trying to use a Library
I am developing an android app and on devices pre 4.0 (ics) the app

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.