2012年5月2日 星期三

[Publish] Filters on Google Play

  • Google Play 會 filter app 是否相容於 device 來決定是否顯示於 user,filter 主要條件是:
    • 以宣告在 AndroidManifest.xml 中的 設定來和 device's configuration 做比對。
    • User's country and carrier, the presence or absence of a SIM card, and other factors. 
    • Filter 是以版本為根本,假設 user 已安裝 v1,但 v2 不適用於他的 device 那麼 user 便不會收到此 app 的更新通知。

Based
  • <supports-screens>
    • Smaller layout can be used on Larger screens; but Larger screen cannot be used on Smaller screens.
    • ex: Only declares: normalScreen
      • Available to both normal- and large-screen devices.
      • Not available to small-screen devices.
  • <uses-configuration>
    • Device Configuration: keyboard, navigation, touch screen
  • <uses-feature>
    • This functionality was introduced in Android 2.0 (API Level 5).
    • Device Features from name, ex:
      • <uses-feature android:name="android.hardware.sensor.light" />
    • OpenGL-ES Version(openGlEsVersion), ex:
      • <uses-feature android:openGlEsVersion="int">
    • 即使有些 device features 開發者並沒有宣告在此,Google Play 也會藉由<uses-permission>推出些 app 中應該會用到的 features 來做為 filter 條件。
  • <uses-library>
    • Device 中應該要有的 shared library。
  • <uses-permission>
    • 事實上並沒有直接使用宣告於此的做為 filter 條件,但會從此推論出應該使用到的 device feaures。
  • <uses-sdk> 
    • Minimum Framework Version (minSdkVersion) 
      • <uses-sdk android:minSdkVersion="3">
    • Maximum Framework Version (maxSdkVersion)
      • <uses-sdk android:maxSdkVersion ="10"> 
      • Deprecated. Android 2.1 以上(含)已不會再檢查此 attribute
      • The SDK will not compile ifmaxSdkVersion is set in an app's manifest. For devices already compiled with maxSdkVersion, Google Play will respect it and use it for filtering.
      • 不建議宣告此 attribute。


Advanced manifest filters
以下 attributes 通常使用於 high-performance games and similar applications that require strict controls on application distribution. Most applications should never use these filters.
  • <compatible-screens>
    • Google Play filters the application if the device screen size and density does not match any of the screen configurations (declared by a <screen> element) in the <compatible-screens>element.
    • Normally, you should not use this manifest element. Using this element can dramatically reduce the potential user base for your application, by excluding all combinations of screen size and density that you have not listed. 
  • <supports-gl-texture>


Other Filters
  • Application and publishing characteristics that affect filtering on Google Play.
  • Publishing Status
    • Only published applications will appear in searches and browsing within Google Play.
  • Priced Status
    • Not all users can see paid apps. 
    • To show paid apps, a device must have a SIM card and be running Android 1.1 or later, and it must be in a country (as determined by SIM carrier) in which paid apps are available.
  • Country / Carrier Targeting
  • Native Platform
  • Copy-Protected Applications

How Google Play filters by features

Google Play compares:
  • Features required by the application
    • An application declares features in <uses-feature> elements in its manifest 
  • Features available on the device, in hardware or software
    • A device reports the features it supports as read-only system properties.
    • 當 user 開啟 Google Play 會呼叫 PackagManager.getSystemAvailableFeatures() 取得 device features. 


How Google Play handles app
每次 developer 上傳 app 時,會列出 AndroidManfest.xml 中會用來做為條件的內容。
這些所得的 list 會做為 apk 的 metadata 與 the application .apk and the application version 儲存一起.
  • Filtering based on explicitly declared features
    • <uses-feature> 中  anandroid:required=["true" | "false"] attribute (API level 5 or higher),預設為 true,表示一定要符合。
    • 所以若不想因為此 feature 而被 filter 掉,可宣告此 feature 並將此參數設為 false。 
  • Filtering based on implicit features
    • 有可能因為下列因素 app 中有使用到某些 features 但並未被宣告
    • Compiled Android Library
      • Android 1.5  前並未有 <uses-feature> element.
      • The developer 誤以為所有裝置都會有此 feature 因此沒有宣告。
      • The developer 忘了.
      • The developer declared the feature explicitly, but the declaration was not valid. 
        • For example, 拼錯 feature 名稱。
    • 所以..
      • Google Play 會利用 <uses-permission> 去推論會使用到的 features 並自行做為 filter 條件。
      • 但如果不想要這樣則必須明確宣告在 <uses-feature> element 並且設 android:required="false"。


Special handling for Bluetooth feature
  • Google Play enables filtering for the Bluetooth feature only if the application declares its lowest or targeted platform as Android 2.0 (API level 5) or higher
  • However, note that Google Play applies the normal rules for filtering when the application explicitly declares the Bluetooth feature in a <uses-feature> element.


執行下列 command 可預知 Google Play 所得的 filter 條件

Android Tools > Export Unsigned/signed Application Package

# aapt dump badging <path_to_exported_.apk>


* Reference
- Filters on Google Play
<uses-feature>

沒有留言:

張貼留言