oh, cool, thanks. I see this sample -- http://android-developers.blogspot.com/2009_04_01_archive.html but it is doing it for a method, as opposed to a static final constant like i want.
also, could I just put a try/catch around it and return "unknown" if an exception was thrown? -phil On Nov 11, 11:43 am, Mark Murphy <mmur...@commonsware.com> wrote: > sdphil wrote: > > i want to use -- > > android.os.Build.MANUFACTURER > > > but it is not available in 1.5. i went to do this then -- > > public static String getMfg() { > > if (compareVersion(android.os.Build.VERSION.RELEASE, "1.6") >= 0) { > > return android.os.Build.MANUFACTURER; > > } > > return "unknown"; > > } > > > but that does not work. as soon as I try to run the app, it crashes > > because it's trying to get at that before checking he conditional. so > > what's the best strategy for dealing with this? > > Reflection. If you are on 1.6+, use reflection to get at the value. If > you are on 1.5, return "unknown". > > -- > Mark Murphy (a Commons > Guy)http://commonsware.com|http://twitter.com/commonsguy > > Android App Developer Training:http://commonsware.com/training -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en