[mono-android] API version compilation benefits

Goncalo Oliveira goncalo at minkan.net
Wed Apr 4 16:26:16 UTC 2012


That's what I thought... I am currently targeting API 10 (2.3.3) and using
the compatibility libraries (to be able to use fragments and a few more
goodies). The ugly issue I'm already resolving by specifying different
layouts for different screens. Seems like the right choice taking in
account the version fragmentation share in the market.

Thank you for clarifying this to me Jon

Cheers

On 4 April 2012 17:06, Jonathan Pryor <jonp at xamarin.com> wrote:

> On Apr 4, 2012, at 6:41 AM, Goncalo Oliveira wrote:
> > Can anyone tell me if and what are the advantages of compiling an app
> for a higher version?
>
> The advantage to targeting a higher version is that you can access and use
> types and members added in that API version, e.g. to use Fragments you need
> to target API level 11+ (Android v3.0+). If you're not using those types
> and members, there is no advantage to targeting a higher API level.
>
> Furthermore, your 2.3.3 build will run w/o issue [0] on higher API level
> devices (tablets, Android v4 devices). The reverse -- running a 3.1 build
> on a 2.3 device -- will very probably fail in obscure ways [3].
>
> If you want to support both existing API10 phones and tablets and the
> forthcoming ICS phones, you'll need to think about what you want in terms
> of "support":
>
> - Run? Targeting API 10 will run on all API10+ devices.
>
> - Run + Look good? You'll need some flavor of target-specific UI. This can
> be done either via separate layout files [0, 1, 2], through multi-APK
> support [4] (build one .apk for API10, build another for API 12, etc.), or
> through use of the compatibility libraries. Unfortunately, easy use of the
> compatibility libraries will need to wait for the forthcoming 4.1.0 alpha
> release.
>
>  - Jon
>
> [0] One "issue" is that running a phone UI on a tablet results in a fugly
> UI. This can be rectified by providing tablet-specific UI .axml files [1,
> 2], e.g. via Resources\layout-xlarge\MyLayout.axml
>
> [1]
> http://developer.android.com/guide/topics/resources/providing-resources.html
>
> [2] http://developer.android.com/guide/practices/screens_support.html
>
> [3] http://lists.ximian.com/pipermail/monodroid/2011-November/007350.html
>
> [4]
> http://android-developers.blogspot.com/2011/07/multiple-apk-support-in-android-market.html
>
> _______________________________________________
> Monodroid mailing list
> Monodroid at lists.ximian.com
>
> UNSUBSCRIBE INFORMATION:
> http://lists.ximian.com/mailman/listinfo/monodroid
>



-- 
Gonçalo Oliveira
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/monodroid/attachments/20120404/4c554f15/attachment.html>


More information about the Monodroid mailing list