Add Features Supported by New SDKs

Common bugs/problems with the Android SDK the Emulator and the ADT-Plugin.

Add Features Supported by New SDKs

Postby A.G. » Thu Nov 18, 2010 11:16 pm

Hello,

So I have an app that runs on 1.5/6. There are a few features that I'd like to add, but those require newer SDKs (both 2.1 and 2.2 actually).
Is there any way to have a single app but detect the OS version and only make certain features available. This would require Eclipse build tweaking, that's why I'd like to clarify. Or is the only option to basically have 2 or 3 different versions of the app.
For example Bluetooth, I think I have no choice but to create a different app. But what if certain classes/functions have been added to existing packages - would reflection or something along those lines work? Unfortunately my Android/Java knowledge is limited as far as that.

Thanks!
A.G.
Freshman
Freshman
 
Posts: 3
Joined: Thu Nov 18, 2010 11:08 pm

Top

Re: Add Features Supported by New SDKs

Postby blundell » Mon Nov 22, 2010 2:17 pm

Yes this is completely possible, reflection is what your looking for. It is explained perfectly in this video by Justin Mattson at Google IO 2010

http://www.youtube.com/watch?v=zNmohaZYvPw#t=35m24s

Also if you want these video's on your phone check out this app: Google Dev Helper
Image

:-)
User avatar
blundell
Master Developer
Master Developer
 
Posts: 1610
Joined: Tue Nov 18, 2008 12:58 pm
Location: UK

Top

Return to SDK/ADT/Emulator Problems

Who is online

Users browsing this forum: No registered users and 8 guests