Just build your app against the latest APIs you want to use, and make sure you don't use them when running on older versions of the platform.
This is what the support lib does, for example. For constants like this, it is even easier, because a "static final int" doesn't get put in your app as a reference to the symbol, but the actual value is compiled in. So you can use that symbol and still run on older versions of the platform without checking and not get a symbol exception when the code is executed. On Sun, May 6, 2012 at 2:41 PM, Andreas Bratfisch <[email protected]>wrote: > Hi Dianne, > > thank you for answering my question. > > maybe i have written my problem in a wrong way^^ > > what i want to do is as i wrote to be compatible to Froyo – that means, i > have some parts in my code > that checks for XHDPI devices (i know, its up to Gingerbread) but i cant > remove that code ... but, these > functions arent supported in Froyo – so, what can i do to support both > Froyo and xlarge devices? > I dont want to create a second app to be compatible :( > > Btw: > can i use code such as > boolean isScreenLarge = mDisplayMetrics.densityDpi >= > DisplayMetrics.DENSITY_HIGH > ... maybe this can solve my problem because DENSITY_HIGH is supported. > this are constant hex values that cant be compared to greater or less as i > think, or does that works ??? > > Thanks for help ;) > > > *From:* Dianne Hackborn <[email protected]> > *Sent:* Sunday, May 06, 2012 10:21 PM > *To:* [email protected] > *Subject:* Re: [android-developers] How to detect XHDPI on Froyo? > > xhdpi wasn't added until GB. It doesn't exist on Froyo, so there is no > need to check for it. > > Also saying that you are checking density to solve problems on large > devices is... wrong. Density is screen pixel density; it has nothing to > do with device/screen *size*. > > On Sat, May 5, 2012 at 2:01 AM, phoenix-launcher.com < > [email protected]> wrote: > >> Hi, >> >> i want to make my app compatible to Froyo, i can downgrade most of my >> code but have >> no idea on how to detect XHDPI screens. Currently i have things in my >> code like >> "if( mDisplayDensity == DisplayMetrics.DENSITY_XHIGH)" to solve some >> problems on large >> devices - in the Froyo version this isnt possible because its not >> supported. >> >> Thanks for a tipp to solve that :) >> >> Greets from Munich >> Andy >> >> -- >> You received this message because you are subscribed to the Google >> Groups "Android Developers" group. >> To post to this group, send email to [email protected] >> To unsubscribe from this group, send email to >> mailto:android-developers%[email protected]<android-developers%[email protected]> >> >> For more options, visit this group at >> http://groups.google.com/group/android-developers?hl=en >> > > > > -- > Dianne Hackborn > Android framework engineer > [email protected] > > Note: please don't send private questions to me, as I don't have time to > provide private support, and so won't reply to such e-mails. All such > questions should be posted on public forums, where I and others can see and > answer them. > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en > -- Dianne Hackborn Android framework engineer [email protected] Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

