mstringham (6) [Avatar] Offline
#1
I've been using the latest SDK versions to compile my code (ie 4.0.3), even if the target API is 2.x or 3.x, to use the latest code/enhancements/tweaks. Do you tend to compile against the newest SDK versions?

Also, when using the latest API/SDK, I find that I keep refactoring the use of "fill_parent" - whether in XML or in code. Would you recommend always using the newer "match_parent" - or are there cases where "fill_parent" is still useful?
carlos.sessa (15) [Avatar] Offline
#2
Re: SDK and deprecation thoughts
> I've been using the latest SDK versions to compile my
> code (ie 4.0.3), even if the target API is 2.x or
> 3.x, to use the latest code/enhancements/tweaks. Do
> you tend to compile against the newest SDK versions?

There is a problem with compiling against newer SDKs.
You might end up using a new API which doesn't exist in older SDKs.
You can create the apk without an issue but if you run it in an device with lower SDK it breaks.

I prefer developing with the min sdk so I don't worry about this issue.

Btw, I think that ADT now checks that, but I am not 100% sure.

>
> Also, when using the latest API/SDK, I find that I
> keep refactoring the use of "fill_parent" - whether
> in XML or in code. Would you recommend always using
> the newer "match_parent" - or are there cases where
> "fill_parent" is still useful?

They are the same thing. Check:
http://stackoverflow.com/q/5761960/119895

Most of the examples work in API level 4 (1.6) and match_parent was introduced in API level 8 (2.2)

Honestly, I am used to fill_parent but I am not sure what happens if you use match_parent and run in API level 4 (1.6).