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

  • SEARCH
  • Home
  • 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 6961753
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T15:34:18+00:00 2026-05-27T15:34:18+00:00

I know this kind of question has been asked before, for example here: Android:

  • 0

I know this kind of question has been asked before, for example here: Android: how to code depending on the version of the API?

There it is also mentioned that one has to compile to the newest Android level.
My basic app version should be available with 7 and the more advanced starting with level 12.

So does that mean that the target setting of the project should be 12 as well as the min-sdk in the manifest.

BUT the app in the Android market will then ONLY be available to level 12 devices? Even though the app should run starting with 7 – just with limited features.

Also in level 12 I would need to import certain packages only available starting at 12. So I could not even set a lower Android target, otherwise I get compiler error.

So in summary:

  1. App should be available starting with level 7
  2. If the user has level 12+ then the app should import certain level 12+ packages and make available these features
  3. If the user has only < 12, then the packages should not import

Many thanks!

  • 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-05-27T15:34:18+00:00Added an answer on May 27, 2026 at 3:34 pm

    If I’m reading your question correctly then this would allow you application to be installed on devices with level 7

    <uses-sdk android:minSdkVersion="7" android:targetSdkVersion="12" />
    

    For development you can set it to any target you want i.e. your project target can be SDK 4.0 but you manifest target can be 1.5 (android:targetSdkVersion=”3″) or vice versa. Eclipse will give you a warning but you can develop for any target and set you manifest to any target as long as you take in to account the consequences.

    You are probably aware there is a bit of work to do in you code to make sure the application doesn’t crash if it tries to call methods that don’t exist at level 7. I have written code to handle that if you want some examples.

    EDIT:

    An example that works for me.

    /**
     * Get the current SDK version as an integer. If we are using 1.5 the SDK is
     * returned as a String so using the Build.VERSION.SDK_INT method will cause
     * the application to crash. This method will return 3 if the version is 1.5
     * and will return the proper result for Build.VERSION.SDK_INT if that
     * method is available.
     * 
     * @return
     */
    public static int getSdkInt() {
        if (Build.VERSION.RELEASE.startsWith("1.5"))
            return 3;
    
        try {
            return YourInternalClass.getSdkIntInternal();
        } catch (VerifyError e) {
                Log.e(TAG, e.toString());
            return 3;
        }
    }
    

    You should call any methods that may not exist in an internal class so it wont load up until the method is called.

    private static class YourInternalClass {
        private static int getSdkIntInternal() {
            return Build.VERSION.SDK_INT;
        }
    }
    

    Now you can check the SDK version. If you have any methods that exist only in packages greater than 7, put those methods in an internal class. then you can do

    if(TheClassYouPutThisMethodIn.getSDKInt() >= 12)
    YourInternalClass.yourLevel12Method();
    

    I’m sure there is probably a better way to do this (and I hope someone could post it) but it works great for me. I have applications that use methods from SDK 13 running safely on phone with level 3.

    Hope this helps.

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

Sidebar

Related Questions

I know this question has been asked here before, but I don't think those
I know this kind of question has been asked before, but the general solution
I know this sort of question has been asked before , but I still
I know this kind of question has been asked a few times, but alot
I know this question has been asked and answered before, but none of the
I know this kind of question has been asked many times. Yet I don't
I know this question has been kind of asked and have looked into the
I know this kind of questions have been asked already many times before. The
I know questions of this kind have been asked before, but my situation differs
This question has been asked before and no definite answer has been given. I'm

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.