[This place is by Reto Meier AKA @retomeier, who wrote the book on Android App development. Tim Bray]
Two questions I regularly intend asked are Why isn’t my app circumpolar on the Market on the (insert figure study here)? and How crapper I prepare for GoogleTV and Android tablets? If you care most how broadly your app is available, pay tending now. Seriously. I don’t want to hear anyone telling me they weren’t told. [Seems a little combative? -Ed. Take it up a notch! -RM]
By today you’ve belike heard of Google TV, the Samsung Galaxy Tab, and the Dell Streak. These are exclusive the vanguard — Android is apace agitated to element that is increasingly different from the smartphone devices we’re utilised to. The variations in hardware — including lack of features like GPS, accelerometers, and recording cameras — means it’s time for you to conceive most what element your app needs, and what it crapper function without.
To attain chronicle easier every API includes a FEATURE_* constant. To control your app’s availability on the Android Market, you take the features required for your app to work. I’d like to encourage you to add manifest Feature nodes for every API you use, specifying them as optional, or not, as appropriate using a manifest uses-feature nodes as shown below:
<uses-feature android:name="android.hardware.microphone" android:required="true"/>Market won’t be inferring any forthcoming API features
My earlier place on forthcoming proofing your apps describes a process of feature inferring that utilised your app’s permissions to help us ensure apps were exclusive circumpolar on the appropriate hardware.
This process has evolved over time. From today on Market won’t be inferring forthcoming API features and we hit no way to infer some previously acquirable APIs (eg. sensors). As a termination you’ll need to take your mandatory and nonmandatory feature requirements — or risk your app either breaking or not being acquirable for some users.
The 5 steps to forthcoming element happiness
Specify a uses-feature convexity for every API feature utilised by your app. This forces you to conceive most what your app uses, allowing you to:
Decide which features are necessary for your app to be multipurpose and evaluation those featured with the attribute required=true. This lets Market conceal your app from any figure that doesn’t support the element features your app requires.
<uses-feature android:name="android.hardware.telephony" android:required="true"/>
For features that aren’t strictly required, ordered required=false.
<uses-feature android:name="android.hardware.bluetooth" android:required="false"/>
Then go in to your cipher and encounter where you hit utilised the nonmandatory features. Use the hasSystemFeature method from the PackageManager to watch if the element is acquirable and provide alternative paths for your cipher as appropriate.
PackageManager pm = getPackageManager();boolean hasCompass = pm.hasSystemFeature(PackageManager.FEATURE_SENSOR_COMPASS);
Now you crapper sleep good in the noesis that no concern what alteration in Android harmonious element comes to market, your app will always (and only) be acquirable on those it supports.
You crapper encounter more info on how the Android Market uses filters to watch whether to exhibit your application to a individual who is feeding or intelligent for applications on a given figure at the Market Filters page on the Android Developer Site.
Thanks
basyar.com
Tidak ada komentar:
Posting Komentar