[mono-android] Using the New Compatibility Packages and TabActivity Deprication
Jonathan Pryor
jonp at xamarin.com
Wed Dec 7 13:54:15 EST 2011
On Dec 7, 2011, at 12:12 PM, Olaf Kammerman wrote:
> The thing is that I want to develop a generic app that I can deploy to both
> phone (Android 2.x) and tablet (Honeycomb) and that by making use of the
> Fragments API the UI changes depending on the used device (phone/tablet).
IIRC the fragments API is ~identical between the compatibility library and Android proper (same type names, same method names), so what _may_ work is to build your app against TargetFrameworkVersion Android v4.0 (or v3.1, both of which have Fragments), and then set the minimum Android target to e.g. v2.2.
You'll likely also need to include the compatibility .jar file with Build action AndroidJavaSource.
Note "may" above. There are some known "forward incompatibilities" in Android (e.g. methods moving from MotionEvent to InputEvent), and if you use those types/members, things will break on downlevel platforms. If it works, though, it should work. :-)
- Jon
More information about the Monodroid
mailing list