Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting targetSdk based on "Optimization Tips"

Tags:

android

I see Google has added a new section called "Optimization Tips" in the developer console.

In it it mentioned I should set a targetSdk. I currently only have:

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

In their documentation they say:

"You can set the app's range of targeted Android versions in the manifest file, in the <uses-sdk> element. In most cases, you can target Android versions properly by setting the element's targetSdkVersion attribute to the highest API level available."

and

"targetSdkVersion is declared with value 11 or higher (14 or higher is recommended)"

My app works perfectly in all versions of android including tablets. Based on what they are saying, even though my app supports version 7, and uses no features of higher versions - should I really be setting my target to the highest possible value (currently API 17).

At the moment I get a reasonable amount of downloads for my app so I'm not understanding the benefit properly - is it just an indicator to google I've tested it on higher devices (since its a full screen canvas app - colour scheme and menu style, changes are unlikely to have any effect for me)

(Btw, I do understand why someone might want to use a higher targetSdk, I'm just wondering if one should set it higher even if you don't need it)

like image 705
Bruce Lowe Avatar asked Dec 29 '25 09:12

Bruce Lowe


1 Answers

should I really be setting my target to the highest possible value (currently API 17)

Yes. It'll improve the user experience on newer devices in various ways.

An example of this is that devices with virtual soft keys, i.e. the last few generations of Nexus phones, will show the legacy options menu button if you're not targeting at least API level 11.

There are several other things to mention, but I'm a bit short on time at the moment. In short: You should always include a target API and a minimum API level.

I'd highly recommend you read this article: http://android-developers.blogspot.dk/2012/01/say-goodbye-to-menu-button.html

like image 135
Michell Bak Avatar answered Dec 30 '25 22:12

Michell Bak



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!