Thanks Dmitri --

Is this test correct?

            int sdkVersion = Integer.parseInt
(Build.VERSION.SDK);       // Cupcake style
            if (sdkVersion >= Build.VERSION_CODES.ECLAIR) {
                className = "...ContactAccessorSdk3_4";
            } else {
                className = "...ContactAccessorSdk5";
            }
It looks backward?

Peace,
Scott

On Nov 3, 3:44 pm, Dmitri Plotnikov <[email protected]> wrote:
> I just published some sample code illustrating this use of both legacy and
> new Contacts APIs in the same app.  
> Seehttp://code.google.com/p/android-business-card
>
> Cheers,
> - Dmitri
>
> On Mon, Nov 2, 2009 at 9:31 AM, Mark Murphy <[email protected]> wrote:
> > jarkman wrote:
> > > int sdkVersion = Integer.parseInt(Build.VERSION.SDK);
>
> > Note that if you are using API version 4 (1.6 and newer), there is
> > Build.VERSION.SDK_INT, which already converts this to an integer.
>
> > If you are still using API version 3, you'll need to parse the String as
> > shown above.
>
> > --
> > Mark Murphy (a Commons Guy)
> >http://commonsware.com|http://twitter.com/commonsguy
>
> > Android 1.6 Programming Books:http://commonsware.com/books
>
> > --
> > 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]<android-developers%[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

Reply via email to