How to stay backwards and forwards compatible - targetSDKVersion, hdpi, minSDKVersion?

by Dianne Hackborn » Sat, 17 Apr 2010 06:32:37 GMT


Sponsored Links
 



Yes they will get them.  This specifies the minimum platform version the
resource is for.  (Note prior to 2.0 there was a bug where it was an exact
match, but that was fixed so you can count on -v4 and above working
correctly.)



It turns off the compatibility code for older applications that were not
written with 1.6 and later features in mind.  If you have tested against the
targetSdkVersion you have told the system you support, you will be fine.



You do if you want the system to run your app as well as possible on SDK 4
or later.



You can do that if you want.  It is up to you.  If you aren't using newer
APIs, it is not required.



targetSdkVersion should not impact that.

-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

--



How to stay backwards and forwards compatible - targetSDKVersion, hdpi, minSDKVersion?

by Matt Kanninen » Sat, 17 Apr 2010 09:33:48 GMT


 


The worst bug I've had so far in Android development was an out of
memory that showed up when I used targetSdkVersion="X".  It took quite
awhile to figure out that was the culprit, and when I removed it I
didn't see any out of memory problems at all.  The problems showed up
on the Motorola Droid, late last year.   I spent a lot of time
optimizing my own memory usage to try and fix it, but removing
targetSdkVersion="X" worked best.

My 2 cents,
-MK

--


Sponsored Links


Other Threads

1. Anyone using the new facebook sdk for android?

Hi,

Anyone try using the facebook sdk for android?:

  http://github.com/facebook/facebook-android-sdk

there are a few problems with it, most frustrating is that they're not
managing the login dialog correctly - rotating the device will hide
the dialog and leak it, sigh.

I was going to repackage it with correct management, just wondering if
anyone else has done it before I try. Also wondering if anyone has a
decent way of contacting the fb developers about it so at least the
patch could be reused, if I make it,

Thanks

-- 

2. LinearLayout in ScrollView

Hi all,
I have LinearLayout with four item orientated vertically and with set
LayoutWidth = 1.0 to fill the whole screen. Here is the source i
removed most of the code which is not related to the issue -

<LinearLayout android:layout_width="wrap_content"
                android:layout_height="fill_parent" android:layout_weight="1.0"
                android:orientation="vertical">
               <!-- Item 1 -->
                <RelativeLayout android:layout_width="fill_parent"
                        
xmlns:android="http://schemas.android.com/apk/res/android"
                        android:layout_height="fill_parent" 
android:layout_weight="1.0"/>

               <!-- Item 2 -->
                <RelativeLayout android:layout_width="fill_parent"
                        
xmlns:android="http://schemas.android.com/apk/res/android"
                        android:layout_height="fill_parent" 
android:layout_weight="1.0"/>

               <!-- Item 3 -->
                <RelativeLayout android:layout_width="fill_parent"
                        
xmlns:android="http://schemas.android.com/apk/res/android"
                        android:layout_height="fill_parent" 
android:layout_weight="1.0"/>

               <!-- Item 4 -->
                <RelativeLayout android:layout_width="fill_parent"
                        
xmlns:android="http://schemas.android.com/apk/res/android"
                        android:layout_height="fill_parent" 
android:layout_weight="1.0"/>
        </LinearLayout>

Everything is working fine here. But when i add ScrollView to wrap the
LinearLayout layout_weight seems to stop working and the items are not
fit to display height -
<ScrollView android:layout_width="wrap_content"
                android:layout_height="wrap_content">
                <LinearLayout android:layout_width="wrap_content"
                android:layout_height="fill_parent" android:layout_weight="1.0"
                android:orientation="vertical">
               <!-- Item 1 -->
               <!-- Item 2 -->
               <!-- Item 3 -->
               <!-- Item 4 -->
               </LinearLayout>
</ScrollView>

I want to add the scroll in cases when display is very short and set
minHeight atribute to each item and scroll :)
So any ideas

-- 

3. WebView not loading enough JavaScript that the full Android Browser can.

4. Calculating jitter and dropped packets

5. link froyo n

6. How to listen on socket port 80?

7. Making broadcast receiver post of UI/main thread