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 [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