【Using English】41 - Core App Quality of Android

This blog is the Chinese translation of Google doc Core app quality;

Android users expect high-quality apps. App quality directly influences the long-term success of your app—in terms of installs, user rating and reviews, engagement, and user retention.

Android用戶期待高質(zhì)量的應(yīng)用。應(yīng)用的質(zhì)量直接影響到您的應(yīng)用是否能取得長(zhǎng)期成功,包括安裝,用戶評(píng)分和評(píng)價(jià),用戶參與度與用戶留存率。

This page helps you assess the core aspects of quality in your app, through a compact set of quality criteria and associated tests. All Android apps should meet these criteria.

通過(guò)一套簡(jiǎn)明的質(zhì)量標(biāo)準(zhǔn)和相關(guān)測(cè)試,這個(gè)頁(yè)面可以幫助你評(píng)估應(yīng)用質(zhì)量最核心的方面,所有的Android應(yīng)用都應(yīng)該符合這些標(biāo)準(zhǔn)。

Before publishing your apps, test them against these criteria to ensure that they function well on many devices, meets Android standards for navigation and design, and are prepared for promotional opportunities in the Google Play store. Your testing will go well beyond what's described here—the purpose of this document is to specify the essential quality characteristics all apps should display, so that you can cover them in your test plans.

發(fā)布應(yīng)用之前,用過(guò)這些標(biāo)準(zhǔn)來(lái)測(cè)試您的應(yīng)用,以確保應(yīng)用功能可以正常運(yùn)行在多個(gè)設(shè)備上,確保應(yīng)用符合Android導(dǎo)航和設(shè)計(jì)標(biāo)準(zhǔn),同時(shí)為在谷歌Play商店推廣做好準(zhǔn)備。您的測(cè)試范圍大可以超過(guò)這里的內(nèi)容,因?yàn)楸疚臋n的目的是所有應(yīng)用都應(yīng)該具備的基本質(zhì)量特征,因此您可以在測(cè)試計(jì)劃中包括這些內(nèi)容。

If you're creating apps for other Android devices, such as tablets or TV, there are additional quality guidelines you should consider.

如果您在為平板電報(bào)或者電視等其他Android設(shè)備開(kāi)發(fā)應(yīng)用,您需要考慮另外一份質(zhì)量指南。

Visual design and user interaction


視覺(jué)設(shè)計(jì)和用戶交互

These criteria ensure that your app provides standard Android visual design and interaction patterns where appropriate, for a consistent and intuitive user experience.

這些標(biāo)準(zhǔn)可以確保您的應(yīng)用程序提供了標(biāo)準(zhǔn)的Android視覺(jué)設(shè)計(jì)和適當(dāng)?shù)慕换ツJ剑詫?shí)現(xiàn)始終如一的直觀用戶體驗(yàn)。

Area ID Description Tests
Standard design UX-B1 The app follows Android Design guidelines and uses common UI patterns and icons:
1. The app does not redefine the expected function of a system icon (such as the Back button).
2. The app does not replace a system icon with a completely different icon if it triggers the standard UI behavior.
3. If the app provides a customized version of a standard system icon, the icon strongly resembles the system icon and triggers the standard system behavior.
4. The app does not redefine or misuse Android UI patterns, such that icons or behaviors could be misleading or confusing to users.
CR-all
Navigation UX-N1 The app supports standard system Back button navigation and does not make use of any custom, on-screen "Back button" prompts. CR-3
UX-N2 All dialogs are dismissible using the Back button. CR-3
UX-N3 Pressing the Home button at any point navigates to the Home screen of the device. CR-1
Notifications UX-S1 Notifications follow Android Design guidelines. In particular:
1. Multiple notifications are stacked into a single notification object, where possible.
2. Notifications are persistent only if related to ongoing events (such as music playback or a phone call).
3. Notifications do not contain advertising or content unrelated to the core function of the app, unless the user has opted in.
CR-11
UX-S2 The app uses notifications only to:
1. Indicate a change in context relating to the user personally (such as an incoming message), or
2. Expose information/controls relating to an ongoing event (such as music playback or a phone call).
CR-11
領(lǐng)域 ID 描述 測(cè)試
標(biāo)準(zhǔn)設(shè)計(jì) UX-B1 應(yīng)用遵循Android設(shè)計(jì)準(zhǔn)則,并使用常用的用戶界面模式和圖標(biāo)。
1. 應(yīng)用不能重新定義系統(tǒng)圖標(biāo)(比如"返回"按鈕)的預(yù)期功能。
2. 如果系統(tǒng)圖標(biāo)觸發(fā)了標(biāo)準(zhǔn)的界面行為,則不可以使用完全不同的圖標(biāo)代替系統(tǒng)圖標(biāo)。
3. 如果應(yīng)用提供了系統(tǒng)圖標(biāo)的自定義版本,那么圖標(biāo)要與系統(tǒng)圖標(biāo)高度相似,且能夠觸發(fā)標(biāo)準(zhǔn)的系統(tǒng)行為。
4. 應(yīng)用不能重新定義或者漏掉Android界面模式,造成圖標(biāo)或行為造成對(duì)用戶的誤導(dǎo)或困惑。
--
導(dǎo)航 UX-N1 應(yīng)用要支持標(biāo)準(zhǔn)的系統(tǒng)返回導(dǎo)航,且不能做任何屏幕內(nèi)的自定義返回提示。 --
UX-N2 所有對(duì)話框均可使用返回按鈕關(guān)閉 --
UX-N3 任何情況,點(diǎn)擊主頁(yè)按鈕都要回到設(shè)備的主頁(yè)面 --
通知 UX-S1 通知遵循Android設(shè)計(jì)規(guī)則,特別是:
1. 如果可以,多條通知放入同一個(gè)通知對(duì)象中。
2. 只有關(guān)聯(lián)了進(jìn)行中的事件(如后臺(tái)播放音樂(lè)或打電話),通知才能持續(xù)保留。
3. 除非用戶主動(dòng)選擇,通知不能包含廣告或者與應(yīng)用核心功能無(wú)關(guān)的內(nèi)容。
--
UX-S2 應(yīng)用只出于以下目的使用通知:
1. 指出與用戶相關(guān)的上下文更改(例如收到消息)
2. 顯示與進(jìn)行中的活動(dòng)相關(guān)的信息/控件(例如后臺(tái)播放音樂(lè)或打電話)
--

Functionality


These criteria ensure that your app provides the expected functional behavior, with the appropriate level of permissions.

這些標(biāo)準(zhǔn)確保您的應(yīng)用以合適的權(quán)限等級(jí)提供了用戶期待的功能行為。

Area ID Description Tests
Permissions FN-P1 The app requests only the absolute minimum permissions that it needs to support core functionality. SC-4
FN-P2 The app does not request permissions to access sensitive data (such as Contacts or the System Log) or services that can cost the user money (such as the Dialer or SMS), unless related to a core capability of the app. SC-4
Install location FN-L1 The app functions normally when installed on SD card (if supported by app).

Supporting installation to SD card is recommended for most large apps (10MB+). See the App Install Location developer guide for information about which types of apps should support installation to SD card.
SD-1
Audio FN-A1 Audio does not play when the screen is off, unless this is a core feature (for example, the app is a music player). CR-7
FN-A2 Audio does not play behind the lock screen, unless this is a core feature. CR-8
FN-A3 Audio does not play on the home screen or over another app, unless this is a core feature. CR-1, CR-2
FN-A4 Audio resumes when the app returns to the foreground, or indicates to the user that playback is in a paused state. CR-1, CR-8
UI and Graphics FN-U1 The app supports both landscape and portrait orientations (if possible).

Orientations expose largely the same features and actions and preserve functional parity. Minor changes in content or views are acceptable.
CR-5
FN-U2 The app uses the whole screen in both orientations and does not letterbox to account for orientation changes.Minor letterboxing to compensate for small variations in screen geometry is acceptable. CR-5
FN-U3 The app correctly handles rapid transitions between display orientations without rendering problems. CR-5
User/app state FN-S1 The app should not leave any services running when the app is in the background, unless related to a core capability of the app.

For example, the app should not leave services running to maintain a network connection for notifications, to maintain a Bluetooth connection, or to keep the GPS powered-on.
CR-6
FN-S2 The app correctly preserves and restores user or app state.

The app preserves user or app state when leaving the foreground and prevents accidental data loss due to back-navigation and other state changes. When returning to the foreground, the app must restore the preserved state and any significant stateful transaction that was pending, such as changes to editable fields, game progress, menus, videos, and other sections of the app or game.

1. When the app is resumed from the Recents app switcher, the app returns the user to the exact state in which it was last used.

2. When the app is resumed after the device wakes from sleep (locked) state, the app returns the user to the exact state in which it was last used.

3. When the app is relaunched from Home or All Apps, the app restores the app state as closely as possible to the previous state.

4. On Back keypresses, the app gives the user the option of saving any app or user state that would otherwise be lost on back-navigation.
CR-1, CR-3, CR-5
領(lǐng)域 ID 描述 測(cè)試
權(quán)限 FN-P1 應(yīng)用程序只能申請(qǐng)支持核心功能的最低級(jí)別的必要權(quán)限。 --
FN-P2 除非與應(yīng)用的核心能力相關(guān),應(yīng)用不能申請(qǐng)涉及到用戶敏感數(shù)據(jù)的權(quán)限(例如通訊錄或系統(tǒng)日志), 也不能使用產(chǎn)生費(fèi)用的服務(wù)(例如撥號(hào)器或者發(fā)送短信)。 --
安裝位置 FN-L1 如果應(yīng)用支持,那么應(yīng)用需要在安裝在SD卡的時(shí)候正常運(yùn)行:

推薦所有提及較大的應(yīng)用(大于等于10MB)支持安裝到SD卡??梢栽趹?yīng)用安裝位置開(kāi)發(fā)指南中查看哪種應(yīng)用應(yīng)該支持安裝到SD卡
--
音頻 FN-A1 屏幕關(guān)閉后不能播放音樂(lè),除非是應(yīng)用的核心功能(如音樂(lè)播放器) --
FN-A2 屏幕鎖定后不能播放音頻,除非是核心功能 --
FN-A3 在主屏幕或者其他應(yīng)用運(yùn)行時(shí)不能播放音頻,除非是核心功能 --
FN-A4 當(dāng)應(yīng)用回到前臺(tái)時(shí),音頻需要恢復(fù)播放或者提示用戶音頻播放被暫停了 --
界面和圖形 FN-U1 如果可以,應(yīng)用需要支持橫屏和豎屏:

兩個(gè)方向提供大致相同的特性和操作,并保持相同的功能,在內(nèi)容和顯示上小的差別是可以接受的
--
FN-U2 兩個(gè)方向應(yīng)用都需要占滿屏幕,不能因?yàn)榉较蚯袚Q而產(chǎn)生黑邊(我靠,letterbox居然能翻譯成"黑邊"), 可以接受為補(bǔ)償屏幕幾何圖形的細(xì)微差別而產(chǎn)生細(xì)小的黑邊。 --
FN-U3 應(yīng)用正確地處理了方向的快速切換,而不會(huì)產(chǎn)生問(wèn)題 --
用戶/應(yīng)用狀態(tài) FN-S1 如果不是與應(yīng)用的核心能力有關(guān),應(yīng)用不應(yīng)該在處于后臺(tái)時(shí)運(yùn)行服務(wù)。

例如,應(yīng)用不應(yīng)該為了運(yùn)行服務(wù)而進(jìn)行如下行為:為接收通知而保持網(wǎng)絡(luò)連接,保持藍(lán)牙連接或GPS開(kāi)啟
--
FN-S2 應(yīng)用正確地保留和恢復(fù)用戶和應(yīng)用的狀態(tài)。

應(yīng)用離開(kāi)前臺(tái)時(shí)保留用戶或者應(yīng)用狀態(tài),防止由于返回導(dǎo)航或其他狀態(tài)改變導(dǎo)致的意外數(shù)據(jù)丟失。當(dāng)應(yīng)用返回前臺(tái)時(shí),必須回復(fù)保存的狀態(tài)和其他任何待處理的重要狀態(tài)性事務(wù)。例如對(duì)可編輯字段的更改,游戲進(jìn)度,菜單,視頻以及其他應(yīng)用和游戲的其他部分:

1. 當(dāng)應(yīng)用通過(guò)最近應(yīng)用切換器恢復(fù)時(shí),應(yīng)用能精準(zhǔn)地返回用戶上次使用時(shí)的狀態(tài)。

2. 當(dāng)應(yīng)用從休眠(鎖定屏幕)狀態(tài)恢復(fù)時(shí),應(yīng)用能精準(zhǔn)地返回用戶上次使用時(shí)的狀態(tài)。

3. 當(dāng)應(yīng)用在主屏幕或者所有應(yīng)用被重新啟動(dòng)時(shí),應(yīng)用要盡可能地恢復(fù)離之前狀態(tài)最近的狀態(tài)。

4. 當(dāng)點(diǎn)擊返回鍵時(shí),應(yīng)用給用戶提供保存所有狀態(tài)的選項(xiàng),否則這些數(shù)據(jù)會(huì)在返回導(dǎo)航中丟失。
--

Compatibility, performance and stability


兼容性,性能和穩(wěn)定性

These criteria ensure that apps provide the compatibility, performance, stability, and responsiveness expected by users.

這些規(guī)則確保應(yīng)用提供了很好的兼容性,性能和穩(wěn)定性,同時(shí)也有用戶期待的響應(yīng)。

Area ID Description Tests
Stability PS-S1 The app does not crash, force close, freeze, or otherwise function abnormally on any targeted device. CR-all, SD-1, HA-1
Performance PS-P1 The app loads quickly or provides onscreen feedback to the user (a progress indicator or similar cue) if the app takes longer than two seconds to load. CR-all, SD-1
PS-P2 With StrictMode enabled (see StrictMode Testing, below), no red flashes (performance warnings from StrictMode) are visible when exercising the app, including during game play, animations and UI transitions, and any other part of the app. PM-1
SDK PS-T1 The app runs on the latest public version of the Android platform without crashing or loss of core function. CR-0
PS-T2 The app targets the latest SDK by setting the targetSdk value to minimize the use of any platform-provided compatibility fallbacks. SP-1
PS-T3 The app is built with the latest SDK by setting the compileSdk value. SD-1
Battery PS-B1 The app supports power management features in Android 6.0+ (Doze and App Standby) properly. In the case where core functionality is disrupted by power management, only qualified apps may request an exemption. BA-1
Media PS-M1 Music and video playback is smooth, without crackle, stutter, or other artifacts, during normal app use and load. CR-all, SD-1, HA-1
Visual quality PS-V1 The app displays graphics, text, images, and other UI elements without noticeable distortion, blurring, or pixelation.

1. The app provides high-quality graphics for all targeted screen sizes and form factors.
2. No aliasing at the edges of menus, buttons, and other UI elements is visible.
CR-all
PS-V2 The app displays text and text blocks in an acceptable manner.

1. Composition is acceptable in all supported form factors.
2. No cut-off letters or words are visible.
3. No improper word wraps within buttons or icons are visible.
4. Sufficient spacing between text and surrounding elements.
--

Here

領(lǐng)域 ID 描述 測(cè)試
兼容性 PS-S1 應(yīng)用不能在適配的設(shè)備上崩潰,強(qiáng)制關(guān)閉,凍結(jié)或出現(xiàn)其他功能異常。 --
性能 PS-P1 應(yīng)用需要快速加載,當(dāng)加載時(shí)間超過(guò)2秒時(shí),應(yīng)用提供屏幕反饋(如進(jìn)度條顯示器或者類(lèi)似提示) --
PS-P2 當(dāng)開(kāi)啟嚴(yán)格遵守標(biāo)準(zhǔn)模式時(shí), 在玩游戲,動(dòng)畫(huà)、UI過(guò)渡或者應(yīng)用的其他部分時(shí),指示燈不出現(xiàn)紅色的閃爍(嚴(yán)格模式的性能警告)。 --
SDK PS-T1 應(yīng)用運(yùn)行在最新公開(kāi)版本的Android平臺(tái)上運(yùn)行,不會(huì)出現(xiàn)崩潰或功能缺失。 --
PS-T2 應(yīng)用通過(guò)設(shè)置targetSDK來(lái)適配最新的SDK版本,以減少平臺(tái)提供的任何兼容性回退。 --
PS-T3 應(yīng)用通過(guò)設(shè)置compileSdk的值來(lái)用最新的SDK版本打包。 --
電池 PS-B1 在Android6.0及以上的系統(tǒng)版本上,應(yīng)用很好地支持了電池管理功能(低耗電模式和應(yīng)用待機(jī)模式)。當(dāng)應(yīng)用的核心功能被電池管理中斷,只有符合條件的應(yīng)用才能申請(qǐng)豁免。
多媒體 PS-M1 在正常使用或加載應(yīng)用期間,音樂(lè)和視頻的播放應(yīng)該順暢,沒(méi)有中斷,卡殼或其他異常聲音。 --
視覺(jué)質(zhì)量 PS-V1 應(yīng)用顯示的圖形,文字,圖片以及其他界面元素不能出現(xiàn)可感知的變形,模糊或像素顆粒感。

1. 對(duì)于所有適配的屏幕尺寸和機(jī)型(form factors居然翻譯為“機(jī)型”),應(yīng)用要提供高品質(zhì)的圖像。
2. 菜單的邊緣,按鈕以及其他界面元素沒(méi)有明顯的走樣(what does “走樣” means?)。
--
PS-V2 應(yīng)用以可接受的習(xí)慣顯示文字和文字塊:

1. 構(gòu)圖在所有機(jī)型上均可接受。
2. 字母和單詞不可以出現(xiàn)視覺(jué)毛邊(這里官網(wǎng)翻譯成“文字丟失”,我覺(jué)得不對(duì),丟失了還要visible,不合邏輯。)。
3. 按鈕或圖標(biāo)內(nèi)的文字沒(méi)有不當(dāng)?shù)膿Q行。
4. 文字和周?chē)亻g要有足夠的空間。
--

Security


These criteria ensure that apps handle user data and personal information safely.

In addition to this checklist, applications published on the Google Play Store must also follow the User Data policies to protect users' privacy.

這些規(guī)則確保了應(yīng)用安全地處理了用戶的數(shù)據(jù)和個(gè)人信息。

除了這個(gè)檢查清單之外,為了保護(hù)用戶隱私,發(fā)布在Google Play商店的應(yīng)用必須遵守用戶數(shù)據(jù)政策。

Area ID Description Tests
Data SC-D1 All private data is stored in the app's internal storage. SC-1
SC-D2 All data from external storage is verified before being accessed. SC-2
SC-D3 All intents and broadcasts follow secure best practices.

1. Intents are explicit if the destination application is known.
2. Intents enforce and use appropriate permissions.
3. Intents that contain data and payload are verified before use.
SC-D4 No personal or sensitive user data is logged to the system or app-specific log. SC-10
App Components SC-P1 Only application components that share data with other apps, or components that should be invoked by other apps, are exported.

This includes activities, services, broadcast receivers, and especially content providers.

Always set the android:exported attribute explicitly, regardless of whether or not you export any of your application's components.
SC-5
SC-P2 All application components that share content with other apps define (and enforce) appropriate permissions. This includes activities, services, broadcast receivers, and especially content providers. SC-4
SC-P3 All content providers that share content between your apps use android:protectionLevel="signature". SC-3
Networking SC-N1 All network traffic is sent over SSL. SC-9
SC-N2 Application declares a network security configuration.
SC-N3 If the application uses Google Play services, the security provider is initialized at application startup.
Libraries SC-U1 All libraries, SDKs, and dependencies are up to date.
WebViews SC-W1 JavaScript is disabled in all WebViews (unless required). SC-6
SC-W2 WebViews only load whitelisted content if possible. SC-8
SC-W3 WebViews do not use addJavaScriptInterface() with untrusted content.

On Android M and above, HTML message channels can be used instead.
SC-7
Execution SC-E1 The app does not dynamically load code from outside the app's APK.
Cryptography SC-C1 The app uses strong, platform-provided cryptographic algorithms and does not implement custom algorithms.
SC-C2 The app uses a properly secure random number generator, in particular to initialize cryptographic keys.
領(lǐng)域 ID 描述 測(cè)試
數(shù)據(jù) SC-D1 所有的私有信息都要存儲(chǔ)在內(nèi)部存儲(chǔ)空間。 --
SC-D2 所有的外部數(shù)據(jù)在訪問(wèn)前都要驗(yàn)證 --
SC-D3 所有的意圖和廣播的使用要遵循安全性的最佳實(shí)踐:

1. 如果目標(biāo)應(yīng)用已知,則使用顯示意圖。
2. 意圖強(qiáng)制執(zhí)行并使用相應(yīng)權(quán)限
--
SC-D4 在系統(tǒng)日志或應(yīng)用特定的日志中,沒(méi)有個(gè)人或敏感用戶數(shù)據(jù)被記錄。 --
應(yīng)用組件 SC-P1 只有應(yīng)用程序組件需要向其他應(yīng)用分享內(nèi)容或者被其他應(yīng)用調(diào)用時(shí),才可以設(shè)置為導(dǎo)出。

包括活動(dòng),服務(wù),廣播接受器,尤其是內(nèi)容提供者。

必須設(shè)置屬性android:exported,無(wú)論是否導(dǎo)出應(yīng)用組件。
--
SC-P2 所有向其他應(yīng)用分享內(nèi)容的應(yīng)用組件要定義(且強(qiáng)制執(zhí)行)相應(yīng)的權(quán)限。包括活動(dòng),服務(wù),廣播接受器,尤其是內(nèi)容提供者. --
SC-P3 在您的應(yīng)用間分享內(nèi)容的所有內(nèi)容提供者都需要使用屬性:android:protectionLevel="signature"
網(wǎng)絡(luò) SC-N1 所有的網(wǎng)絡(luò)流量均通過(guò)SSL進(jìn)行發(fā)送。 --
SC-N2 應(yīng)用程序聲明網(wǎng)絡(luò)安全的配置文件。 --
SC-N3 如果應(yīng)用程序使用Google Play服務(wù),則安全提供程序在應(yīng)用打開(kāi)時(shí)初始化。 --
庫(kù) SC-U1 所有的庫(kù),SDK,依賴均保持最新?tīng)顟B(tài)
WebView SC-W1 在所有的WebView中,JavaScript停用(除非另外要求)。 --
SC-W2 如果可能的話,WebView只加載白名單中的內(nèi)容。 --
SC-W3 WebView不能在不受信任的內(nèi)容中使用addJavaScriptInterface()方法.

在Android M和更高版本中,可以使用HTML消息通道。
--
執(zhí)行 SC-E1 應(yīng)用不可以動(dòng)態(tài)加載APK之外的代碼
加密 SC-C1 應(yīng)用可使用平臺(tái)提供的強(qiáng)大加密算法,不能實(shí)現(xiàn)之定義算法。
SC-C2 應(yīng)用使用合適的安全隨機(jī)數(shù)生成器,來(lái)初始化密鑰。

Google Play

These criteria ensure that your apps are ready to publish on Google Play.
這些規(guī)則確保您已經(jīng)做好準(zhǔn)備發(fā)布到Google Play商店。

Area ID Description Tests
Policies GP-P1 The app strictly adheres to the terms of the Google Play Developer Content Policyand does not offer inappropriate content, does not use the intellectual property or brand of others, and so on. GP-all
GP-P2 The app maturity level is set appropriately, based on the Content Rating Guidelines. GP-1
GP-P3 The app supports power management features in Android 6.0+ (Doze and App Standby) properly. In the case where core functionality is disrupted by power management, only qualified apps may request an exemption. See Support for other use cases in Doze and App Standby. GP-4
App Details Page GP-D1 The app’s feature graphic follows the guidelines outlined in this blog post. Make sure that:

1. The app listing includes a high-quality feature graphic.
2. The feature graphic does not contain device images, screenshots, or small text that will be illegible when scaled down and displayed on the smallest screen size that your app is targeting.
3. The feature graphic does not resemble an advertisement.
GP-1, GP-2
GP-D2 The app’s screenshots and videos do not show or reference non-Android devices. GP-1
GP-D3 The app’s screenshots or videos do not represent the content and experience of your app in a misleading way.
User Support GP-X1 Common user-reported bugs in the Reviews tab of the Google Play page are addressed if they are reproducible and occur on many different devices. If a bug occurs on only a few devices, you should still address it if those devices are particularly popular or new. GP-1
領(lǐng)域 ID 描述 測(cè)試
政策 GP-P1 應(yīng)用要嚴(yán)格遵守Google Play開(kāi)發(fā)者內(nèi)容政策的條款,且不允許提供不適當(dāng)?shù)膬?nèi)容,不允許使用別人的知識(shí)產(chǎn)權(quán)和商標(biāo),等等。 --
GP-P2 根據(jù)內(nèi)容分級(jí)準(zhǔn)則,合理設(shè)置應(yīng)用的成熟度. --
GP-P3 在Android 6以及上系統(tǒng),應(yīng)用要正確地支持電源管理特性(低電量模式和應(yīng)用待機(jī)模式)。一旦核心功能被電源管理中斷,只有符合條件的應(yīng)用可以得到豁免。請(qǐng)查看其他使用場(chǎng)景的支持的低電量模式與應(yīng)用待機(jī)模式。 --
應(yīng)用詳情頁(yè) GP-D1 應(yīng)用的置頂大圖必須遵守博客中列出的準(zhǔn)則,確保以下幾點(diǎn):

1. 應(yīng)用陳列了包括高質(zhì)量的置頂大圖的圖像。
2. 應(yīng)用的置頂大圖不應(yīng)該包含設(shè)備圖片,屏幕截圖以及在適配的最小屏幕設(shè)備上顯示時(shí)難以辨認(rèn)的文字。
3. 置頂大圖看起來(lái)不能像廣告。
--
GP-D2 應(yīng)用的屏幕截圖和視頻不能展示非Android設(shè)備。 --
GP-D3 應(yīng)用的屏幕截圖和視頻不能以誤導(dǎo)性的方式展示內(nèi)容和經(jīng)驗(yàn)。 --
應(yīng)用支持 GP-X1 在Google Play商店頁(yè)面的“評(píng)價(jià)”標(biāo)簽中常見(jiàn)的用戶反饋bug,如果它是重復(fù)性的且在很多設(shè)備上發(fā)生,這個(gè)問(wèn)題要需要定位和解決。如果一個(gè)bug只是在一小部分設(shè)備上出現(xiàn),但是這些設(shè)備非常流行或者是新設(shè)備,那么問(wèn)題也需要被定位和解決。

Setting up a test environment

To assess the quality of your app, you need to set up a suitable hardware or emulator environment for testing.

為了評(píng)估應(yīng)用的質(zhì)量,您需要搭建一套硬件或者模擬器環(huán)境用來(lái)測(cè)試。

The ideal test environment would include a small number of actual hardware devices that represent key form factors and hardware/software combinations currently available to consumers. It's not necessary to test on every device that's on the market — rather, you should focus on a small number of representative devices, even using one or two devices per form factor.

form factor ==> 機(jī)型
理想的測(cè)試環(huán)境包括少量的真機(jī),這些真機(jī)代表著消費(fèi)者可用的主要機(jī)型和軟硬件組合。您不必測(cè)試市面上的所有設(shè)備,而是關(guān)注在最優(yōu)代表性的少量設(shè)備上,甚至每個(gè)機(jī)型只用一到兩臺(tái)設(shè)備。

If you are not able to obtain actual hardware devices for testing, you should set up emulated devices (AVDs) to represent the most common form factors and hardware/software combinations.

如果您沒(méi)有辦法獲得真機(jī)來(lái)測(cè)試,您需要搭建模擬器的測(cè)試環(huán)境來(lái)代表大多數(shù)的機(jī)型和軟硬件組合。

To go beyond basic testing, you can add more devices, more form factors, or new hardware/software combinations to your test environment. You can also increase the number or complexity of tests and quality criteria.

如果想要比基礎(chǔ)的測(cè)試更加深入一點(diǎn),您需要在測(cè)試環(huán)境中添加更多的設(shè)備、更多的機(jī)型或者新的軟硬件組合。您也可以增加復(fù)雜測(cè)試和高質(zhì)量規(guī)則的數(shù)量。

Test procedures

測(cè)試流程

These test procedures help you discover various types of quality issues in your app. You can combine the tests or integrate groups of tests together in your own test plans. See the sections above for references that associate criteria with these test procedures.

這些測(cè)試流程將幫助您發(fā)現(xiàn)應(yīng)用中的不同類(lèi)型的質(zhì)量問(wèn)題。您可以在您的測(cè)試計(jì)劃中組合各項(xiàng)測(cè)試或綜合運(yùn)用各組測(cè)試。請(qǐng)查看以下部分參考與這些測(cè)試流程相關(guān)的規(guī)則。

Type Test Description
Core Suite CR-0 Navigate to all parts of the app — all screens, dialogs, settings, and all user flows.

If the application allows for editing or content creation, game play, or media playback, make sure to enter those flows to create or modify content.

While exercising the app, introduce transient changes in network connectivity, battery function, GPS or location availability, system load, and so on.
CR-1 From each app screen, press the device's Home key, then re-launch the app from the All Apps screen.
CR-2 From each app screen, switch to another running app and then return to the app under test using the Recents app switcher.
CR-3 From each app screen (and dialogs), press the Back button.
CR-5 From each app screen, rotate the device between landscape and portrait orientation at least three times.
CR-6 Switch to another app to send the test app into the background. Go to Settings and check whether the test app has any services running while in the background. In Android 4.0 and higher, go to the Apps screen and find the app in the "Running" tab.
CR-7 Press the power button to put the device to sleep, then press the power button again to wake the screen.
CR-8 Set the device to lock when the power button is pressed. Press the power button to put the device to sleep, then press the power button again to wake the screen, then unlock the device.
CR-9 For devices that have slide-out keyboards, slide the keyboard in and out at least once. For devices that have keyboard docks, attach the device to the keyboard dock.
CR-10 For devices that have an external display port, plug-in the external display.
CR-11 Trigger and observe in the notifications drawer all types of notifications that the app can display. Expand notifications where applicable (Android 4.1 and higher), and tap all actions offered.
Install on SD Card SD-1 Repeat Core Suite with the app installed to a device’s SD card (if supported by app).To move the app to SD card, you can use Settings > App Info > Move to SD Card.
Hardware acceleration HA-1 Repeat Core Suite with hardware acceleration enabled.

To force-enable hardware acceleration (where supported by device), add hardware-accelerated="true" to the <application> in the app manifest and recompile.
Performance and Stability SP-1 Review the Android manifest file and build configuration to ensure that the application is built against the latest available SDK (targetSdk and compileSdk).
Performance Monitoring PM-1 Repeat Core Suite with StrictMode profiling enabled as described below.Pay close attention to garbage collection and its impact on the user experience.
Battery BA-1 Repeat Core Suite across Doze and App Standby cycles.

Pay close attention to alarms, timers, notifications, syncs, and so on. See Testing with Doze and App Standby for requirements and guidelines.
Security SC-1 Review all data stored in external storage.
SC-2 Review how data loaded from external storage is handled and processed.
SC-3 Review all content providers defined in the Android manifest file for appropriate protectionLevel.
SC-4 Review all permissions that your app requires, in the manifest file, at runtime and in the app settings (Settings > App Info) on the device.
SC-5 Review all application components defined in the Android manifest file for the appropriate export state. The export property must be set explicitly for all components.
SC-6 Review the app's Network Security configuration, ensuring that no lint checks on the configuration fail.
SC-7 For each WebView, navigate to a page that requires JavaScript.
SC-8 For each WebView, attempt to navigate to sites and content that are outside of your control.
SC-9 Declare a Network Security Configuration that disables cleartext traffic then execute the app.
SC-10 Run the application and exercise all core functionality, while observing the device log. No private user information should be logged.
Google Play GP-1 Sign into the Google Play Developer Console to review your developer profile, app description, screenshots, feature graphic, content rating and user feedback.
GP-2 Download your feature graphic and screenshots and scale them down to match the display sizes on the devices and form factors you are targeting.
GP-3 Review all graphical assets, media, text, code libraries, and other content packaged in the app or expansion file download.
GP-4 Review Support for other use cases in Doze and App Standby.
Payments GP-4 Navigate to all screens of your app and enter all in-app purchase flows.
類(lèi)型 測(cè)試 描述
合適套件 CR-0 適用于應(yīng)用的所有部分--所有的屏幕,彈窗,設(shè)置,和所有的用戶流程。

1. 如果應(yīng)用程序允許編輯或者生成內(nèi)容,玩游戲,媒體播放,確保應(yīng)用中添加這些流程來(lái)創(chuàng)造或修改內(nèi)容。

2. 在使用應(yīng)用時(shí),對(duì)于網(wǎng)絡(luò)連接,電池功能,地理位置機(jī)器可用性等到變化,要非常迅速地相應(yīng)和處理。
CR-1 在每個(gè)應(yīng)用界面,點(diǎn)擊設(shè)備的“主屏幕”鍵,然后從所有應(yīng)用中重新啟動(dòng)應(yīng)用
CR-2 在每個(gè)應(yīng)用界面,切換到另一個(gè)運(yùn)行中的應(yīng)用,使用最近應(yīng)用切換器返回本應(yīng)用
CR-3 在每個(gè)應(yīng)用界面(和彈窗),點(diǎn)擊返回鍵
CR-5 在每個(gè)應(yīng)用界面,旋轉(zhuǎn)屏幕,切換屏幕方向至少三次。
CR-6 切換到另一個(gè)應(yīng)用中使測(cè)試應(yīng)用置為后臺(tái)狀態(tài)。到“設(shè)置”中查看測(cè)試一種是否有任何后臺(tái)運(yùn)行的服務(wù)。在Android4.0及以上版本,到多應(yīng)用的屏幕在“運(yùn)行中”標(biāo)簽下查看。
CR-7 點(diǎn)擊電源按鈕使設(shè)備休眠,再次點(diǎn)擊電源按鈕喚醒屏幕。
CR-8 點(diǎn)擊電源按鈕時(shí),設(shè)置設(shè)備為鎖定狀態(tài)。點(diǎn)擊電源按鈕讓設(shè)備處于休眠狀態(tài),然后再次點(diǎn)擊電源按鈕環(huán)境屏幕,然后解鎖設(shè)備。
CR-9 對(duì)于帶有滑動(dòng)鍵盤(pán)的設(shè)備,將鍵盤(pán)滑進(jìn)滑出至少一次;對(duì)于帶有鍵盤(pán)底座的設(shè)備,將設(shè)備連接到鍵盤(pán)底座。
CR-10 對(duì)于帶有外部顯示端口的設(shè)備,請(qǐng)插入外部顯示器。
CR-11 在通知式抽屜式通知欄中,觸發(fā)和觀察應(yīng)用可以展示的所有通知類(lèi)型。如果使用(Android4.1以及更高版本),展開(kāi)通知并點(diǎn)擊提供的所有操作。
安裝到SD卡 SD-1 應(yīng)用安裝到SD中(如果支持),重復(fù)核心套件中的操作。把應(yīng)用轉(zhuǎn)移到SD卡中,你可以這樣操作:設(shè)置>應(yīng)用信息>Move to SD Card.
硬件加速 HA-1 開(kāi)啟硬件加速,重復(fù)核心套件的操作: 為了在支持的設(shè)備中強(qiáng)制開(kāi)啟硬件加速,在清單文件中的<application>節(jié)點(diǎn)中設(shè)置屬性hardware-accelerated=true,然后重新編譯.
性能和穩(wěn)定性 SP-1 瀏覽清單文件,確保打包的配置中使用了可用的最新本SDK(targetSDK和compileSDK)打包應(yīng)用。
性能監(jiān)控 PM-1 按照如下所述的方式開(kāi)啟嚴(yán)格模式,并重復(fù)核心套件的操作:

密切注意垃圾回收機(jī)制,因?yàn)檫@會(huì)影響用戶體驗(yàn)。
電池 BA-1 對(duì)于低耗電模式和應(yīng)用休眠模式下重復(fù)核心套件的操作。

密切關(guān)注鬧鐘,計(jì)時(shí)器,通知,同步等等。查看如何測(cè)試低耗電模式與應(yīng)用休眠模式來(lái)獲得需求和指南。
安全 SC-1 查看外部存儲(chǔ)空間中存儲(chǔ)的所有數(shù)據(jù)。
SC-2 查看加載外部數(shù)據(jù)是如何被處理的。
SC-3 查看所有定義在Android清單文件中的內(nèi)容提供者都被設(shè)置為合適的安全等級(jí)
SC-4 在清單文件中,在運(yùn)行時(shí),以及設(shè)備的設(shè)置中(設(shè)置>應(yīng)用信息),查看應(yīng)用請(qǐng)求的權(quán)限。
SC-5 查看清單文件中所有應(yīng)用組件是否設(shè)置為可導(dǎo)出。所有的組件都要嚴(yán)格地設(shè)置為導(dǎo)出屬性
SC-6 查看應(yīng)用的網(wǎng)絡(luò)安全配置,確保配置失敗時(shí)不執(zhí)行Lint檢查。
SC-7 對(duì)于每一個(gè)WebView,導(dǎo)航到一個(gè)需要JavaScript的頁(yè)面。
SC-8 對(duì)于每一個(gè)WebView,嘗試導(dǎo)航到不受控制的站點(diǎn)和內(nèi)容。
SC-9 聲明禁止明文傳輸?shù)木W(wǎng)絡(luò)安全配置,然后運(yùn)行應(yīng)用。
SC-10 運(yùn)行應(yīng)用程序,執(zhí)行所有的核心功能。同時(shí)觀察設(shè)備的日志,確保用戶的個(gè)人信息不應(yīng)該被記錄。
Google Play GP-1 登陸Google Play開(kāi)發(fā)者控制臺(tái),查看開(kāi)發(fā)者信息,應(yīng)用描述信息,屏幕截圖,置頂大圖以及用戶反饋。
GP-2 下載您的置頂大圖和屏幕截圖,縮放它們來(lái)匹配到您適配的所有設(shè)備和機(jī)型。
GP-3 查看所有的圖像附件,多媒體,文字 代碼庫(kù),和打包在應(yīng)用內(nèi)的其他內(nèi)容,以及額外下載的文件。
GP-4 查看在低電耗模式和應(yīng)用待機(jī)模式下對(duì)其他用例的支持。
支付 GP-4 導(dǎo)航到應(yīng)用的所有屏幕,并進(jìn)入應(yīng)用內(nèi)購(gòu)買(mǎi)流程。

Testing with StrictMode

使用嚴(yán)格模式測(cè)試

For performance testing, we recommend enabling [StrictMode](https://developer.android.com/reference/android/os/StrictMode.html) in your app and using it to catch operations on the main thread and other threads that could affect performance, network accesses, file reads/writes, and so on.

對(duì)于性能測(cè)試,我們推薦應(yīng)用開(kāi)啟嚴(yán)格模式,用戶捕獲主線程和其他線程中產(chǎn)生的影響性能,網(wǎng)絡(luò)訪問(wèn),文件讀寫(xiě)等的操作。

You can set up a monitoring policy per thread using [StrictMode.ThreadPolicy.Builder](https://developer.android.com/reference/android/os/StrictMode.ThreadPolicy.Builder.html) and enable all supported monitoring in the ThreadPolicy using [detectAll()](https://developer.android.com/reference/android/os/StrictMode.ThreadPolicy.Builder.html#detectAll()).

您可以使用StrictMode.ThreadPolicy.Builder在每一個(gè)線程都設(shè)置監(jiān)控政策,也可以使用detactAll()方法在ThreadPolicy中開(kāi)始所有支持的監(jiān)控。

Make sure to enable visual notification of policy violations for the ThreadPolicy using [penaltyFlashScreen()](https://developer.android.com/reference/android/os/StrictMode.ThreadPolicy.Builder.html#penaltyFlashScreen()).

請(qǐng)確保用penaltyFlashScreen ()在開(kāi)啟方法在ThreadPolicy中開(kāi)啟了違反政策的視覺(jué)通知。

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容