Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
What does targetSdkVersion do?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  6 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Matt Kanninen  
View profile  
 More options Jan 5 2010, 9:15 pm
From: Matt Kanninen <mathias...@gmail.com>
Date: Tue, 5 Jan 2010 18:15:59 -0800 (PST)
Local: Tues, Jan 5 2010 9:15 pm
Subject: What does targetSdkVersion do?
What does targetSdkVersion do?

There isn't much detail on what targetSdkVersion actually does.

I've read:

http://developer.android.com/guide/topics/manifest/uses-sdk-element.h...

android:targetSdkVersion
    An integer designating the API Level that the application is
targetting.

    With this attribute set, the application says that it is able to
run on older versions (down to minSdkVersion), but was explicitly
tested to work with the version specified here. Specifying this target
version allows the platform to disable compatibility settings that are
not required for the target version (which may otherwise be turned on
in order to maintain forward-compatibility) or enable newer features
that are not available to older applications. This does not mean that
you can program different features for different versions of the
platform—it simply informs the platform that you have tested against
the target version and the platform should not perform any extra work
to maintain forward-compatibility with the target version.

    Introduced in: API Level 4

  I'm curious because it appears that switching from:

        <uses-sdk android:minSdkVersion="3" android:targetSdkVersion="4"/>

to

        <uses-sdk android:minSdkVersion="3"/>

is the change that started the

android.view.InflateException ... java.lang.OutOfMemoryError: bitmap
size exceeds VM budget

errors I was randomly seeing in setContentView.  When I remove the
targetSdkVersion it runs much better.

Now I'm having trouble remembering what adding targetSdkVersion got me
in the first place.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Lance Nanek  
View profile  
 More options Jan 5 2010, 11:10 pm
From: Lance Nanek <lna...@gmail.com>
Date: Tue, 5 Jan 2010 20:10:37 -0800 (PST)
Local: Tues, Jan 5 2010 11:10 pm
Subject: Re: What does targetSdkVersion do?
Can change defaults for supports-screens. Can also disable
compatibility features, like reporting a smaller size than the actual
display and scaling your app up.

See:
http://developer.android.com/intl/zh-TW/guide/practices/screens_suppo...

On Jan 5, 9:15 pm, Matt Kanninen <mathias...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Matt Kanninen  
View profile  
 More options Jan 6 2010, 6:10 pm
From: Matt Kanninen <mathias...@gmail.com>
Date: Wed, 6 Jan 2010 15:10:36 -0800 (PST)
Local: Wed, Jan 6 2010 6:10 pm
Subject: Re: What does targetSdkVersion do?
Got it.  I don't think I need targetSdkVersion now that I have:

        <supports-screens android:smallScreens="false"
android:normalScreens="true" android:largeScreens="true" />

I want to target HVGA and up.

On Jan 5, 8:10 pm, Lance Nanek <lna...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dianne Hackborn  
View profile  
 More options Jan 6 2010, 7:27 pm
From: Dianne Hackborn <hack...@android.com>
Date: Wed, 6 Jan 2010 16:27:16 -0800
Local: Wed, Jan 6 2010 7:27 pm
Subject: Re: [android-developers] Re: What does targetSdkVersion do?

On Wed, Jan 6, 2010 at 3:10 PM, Matt Kanninen <mathias...@gmail.com> wrote:
>        <supports-screens android:smallScreens="false"
> android:normalScreens="true" android:largeScreens="true" />

If you don't specify anyDensity, then the system will run your app in
density compatibility mode on high and low density devices.  You really want
to avoid this, since it can result in some artifacts in the UI such as some
text being clipped.

If you are designing your app to support different screens/densities, I
highly recommend that you make the target SDk version at least 4, since this
will allow the system to do the correct default configuration to make it
work correctly.  It also allows various other compatibility features to be
turned off, which we try to document under each API version here:

http://developer.android.com/reference/android/os/Build.VERSION_CODES...

As for running out of memory -- it is probably because outside of
compatibility mode the system is being allowed to pre-scale some of your
loaded bitmaps to allow them to be drawn faster.  I would guess this is just
a matter of you being close to the memory limit, and this pushing you over
(the high density or large screen devices should always have a higher memory
limit to account for this...  though I don't think the emulator changes
this, come to think of it, so it could just be an emulator issue).

--
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.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Matt Kanninen  
View profile  
 More options Jan 8 2010, 4:38 pm
From: Matt Kanninen <mathias...@gmail.com>
Date: Fri, 8 Jan 2010 13:38:53 -0800 (PST)
Local: Fri, Jan 8 2010 4:38 pm
Subject: Re: What does targetSdkVersion do?
Diane,

I try hard not test on the emulator, and have access to the Android
phones users are using.  This bug happened only on the Droid, and our
application depends on the Camera and Mic to function.

More details on the bug here:
http://groups.google.com/group/android-developers/browse_frm/thread/1...

and other threads related to:

java.lang.OutOfMemoryError: bitmap size exceeds VM budget

Sometimes out of memory errors, especially DEVICE SPECIFIC MEMORY
ERRORS, are best fixed in the framework, or the specific devices code.

I can't help debug this issue too much longer either, I'll be off the
project, and on to other Android applications soon.

-MK

On Jan 6, 4:27 pm, Dianne Hackborn <hack...@android.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dianne Hackborn  
View profile  
 More options Apr 16 2010, 12:46 pm
From: Dianne Hackborn <hack...@android.com>
Date: Fri, 16 Apr 2010 09:46:30 -0700
Local: Fri, Apr 16 2010 12:46 pm
Subject: Re: [android-developers] Re: What does targetSdkVersion do?

The camera doesn't use memory (for the most part) that would be accounted
against the app and thus cause you to run out of memory.  It is, however, a
higher megapixel camera, and the resulting bitmaps you are making due to
that in combination with the additional memory needed for higher density
resources could easily account for you using too much memory.

--
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.

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »