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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T20:12:30+00:00 2026-06-13T20:12:30+00:00

To take a simple example String.isEmpty() was made available in API level 9. If

  • 0

To take a simple example String.isEmpty() was made available in API level 9.

If I wanted to use this method in my application that targets API levels less than 9, how would I go about this?

Is it as simple as locating the source code of this method and importing the class/method? – Perhaps renaming it with my own package name for reference?

Can I compile a separate jar of the new API classes that I wish to use?

Is this what the support library does for selected APIs?

Have I completely misunderstood some fundamental basics of the Android Framework? If I have, please be nice and perhaps offer me some links to reading material!

This post asks a similar question, but the answer doesn’t resolve all of the above for me.

I thank you in advance.

  • 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-13T20:12:31+00:00Added an answer on June 13, 2026 at 8:12 pm

    Is it as simple as locating the source code of this method and importing the class/method? – Perhaps renaming it with my own package name for reference?

    For something as trivial as this, it is as simple as copying and pasting the implementation into some static method of your own somewhere. You have no means of changing the implementation of String on millions of devices, so you have no means of putting isEmpty() on String on API Level 8 or lower. But, you could create a StringCompat class with a static isEmpty() method that borrows from the implementation you see in the source code.

    Can I compile a separate jar of the new API classes that I wish to use?

    That would depend upon what the “new API classes” are.

    Is this what the support library does for selected APIs?

    Sort of. The Android Support package, in some cases, has other modifications to allow the code to work on older devices. For example, in the native API Level 11 implementation of fragments, fragments work with any Activity; in the Android Support package, fragments are tied to FragmentActivity.

    Other pieces of code in the Android Support package might be direct clones of their native counterparts, except for package and/or class name changes.

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

Sidebar

Related Questions

I have this very simple br2nl function that I use to take a string
Take this simple example: class Program { static void Main(string[] args) { var windsorContainer
I made a system that creates a simple string with Function/Response format, example: Check('Value'):ShowImage(@)|Check('Value'):OtherFunction(@)....and
Take this simple, contrived example: UserRepository.GetAllUsers(); UserRepository.GetUserById(); Inevitably, I will have more complex queries,
I am writing a simple parser that will take a string of the format
Take a very simple example, mfrow=c(1,3) ; each figure is a different histogram; how
Take this sample class as an example: [AttributeUsage(AttributeTargets.All, AllowMultiple=true)] public class BugFixAttribute : System.Attribute
Ok, I'm very simply trying to take this example... http://jsfiddle.net/shanabus/HGF59/ and put it on
take this simple code: class A{ public: virtual void foo() = 0; void x(){
Take a simple XML file formatted like this: <Lists> <List> <Note/> ... <Note/> </List>

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.