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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T02:26:15+00:00 2026-06-11T02:26:15+00:00

Many times in Android , you see that a method is deprecated as of

  • 0

Many times in Android , you see that a method is deprecated as of version 3.0 and a different method should be used.

How do you handle such things when programming your app if you are targeting most of the devices (say from Version 2.1). Do you code the same app multiple times each one for different version? and then create different profiles in Google Play for each APK? I find it this a bit excessive and does not make sense. Please let me know what is the correct way of handling such situations

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-06-11T02:26:17+00:00Added an answer on June 11, 2026 at 2:26 am

    the easiest approach would be to simply check what version your app is running on act accordingly. I.e.

    if( Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB ) {
       [code for HC and up]
    } else {
       [code for older versions]
    }
    

    You can find all version codes here. Remember you need to build your app with targetSdk set to latest possible. This is however risky as you can easily use method not available on older platforms and your application would crash as compiler won’t warn you. To mitigate this it usually helps to pay attention what are you using 🙂 but also to wrap such “risky” code into library or utility class so you can be sure no other code of yours does that trickery by itself. It also helps to set API filter on documentation at http://d.android.com/ (these small up/down arrows on left titlebar, next to “Android APIs
    ) to LOWEST version you plan to support. In case it is something not used often, there’s a chance you peek there catch the risk “visually”

    There’s also plugin for Eclipse that does such checks, but I do not use it myself and cannot remember its name at the moment.

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

Sidebar

Related Questions

I'd like to use the method profiler to see how many times particular methods
I'm totally new to android programming. I can see that this problem has been
Many times I needed a set of pointers. Every time that happens, I end
Many times I see statements like following Y.CustomApp.superclass.render.apply(this, arguments); I know how apply works.
Many times i run time consuming PHP scripts that echo status updates like 'batch
I have used NSSets many times in my apps, but I have never created
I have heard it many times that garbage collection in PyS60 is not up
I have a very strange problem with Android animations, I tried many different approaches
possible duplicate Hello friends, I have seen many style files and see that some
I am working on an android app that among other things also posts a

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.