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 8753555
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T13:26:58+00:00 2026-06-13T13:26:58+00:00

Even though I have done some app on android, I am still confused. Is

  • 0

Even though I have done some app on android, I am still confused. Is it possible to use functions in SDK 4.0, and run the app on android 2.1 or lower?

I tried methods you guys mentioned but got an error –

Field requires API level 11 (current min is 7): android.os.AsyncTask#THREAD_POOL_EXECUTOR, if I change min to 11, the app can’t install on android 2.1, so even I can use higher API, but it still can’t run on android lower version…how to fix that?

From Kzinch’s advice, set TargetApi to 11, then it’s working!

  • 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-13T13:26:59+00:00Added an answer on June 13, 2026 at 1:26 pm

    Yes, you can use functions from the higher API in your code, but you must make sure they are never called on the lower API in runtime.

    You should make checks for API level in runtime and provide alternative implementation that exists for that API level.

    Let me provide some simple example:

        SharedPreferences.Editor edit = PreferenceManager
                .getDefaultSharedPreferences(getActivity()).edit();
        edit.putInt(KEY, VALUE);
        if (Build.VERSION.SDK_INT >= 9) {
            edit.apply();
        } else {
            edit.commit();
        }
    

    apply() method is a faster (asynchronous) implementation of commit() method, but it not supported on the API level less than 9. With the help of API version check it all works perfect for all devices.

    Update @TargetApi annotaion may be used to suppress Lint warnings/errors for API checks.

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

Sidebar

Related Questions

I can't send email to my app users, even though I have the permissions.
Even though I have a fermi card(gtx 560) I get this error on VS2010:
Why two object's hash code is not same even though they have similar values.
I have a problem of web pages being cached even though I specify that
I have searched this site and Google and even though the idea is pretty
I have this error appearing in my web service and even though I'v had
I've heard of GAE and even though it doesn't support PHP, people have gotten
I have just installed Java JDK 6u33 in Windows XP. Even though I didn't
I have two radio buttons next to each other, and even though each one
I'm very new to Java and the Android SDK but I'm almost done with

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.