ลิขสิทธิ์ © 2010, Google Inc. สงวนลิขสิทธิ์
Compatibility@android.com
1. บทนำ
เอกสารนี้ระบุข้อกำหนดที่ต้องปฏิบัติตามเพื่อให้โทรศัพท์มือถือเข้ากันได้กับ Android 2.1
การใช้ "ต้อง" "ต้องไม่" "จำเป็น" "ควร" "ไม่ควร" "ควร" "ไม่ควร" "แนะนำ" "อาจ" และ "ทางเลือก" เป็นไปตามมาตรฐาน IETF ที่กำหนดไว้ใน RFC2119 [ ทรัพยากร 1 ]
ตามที่ใช้ในเอกสารนี้ "ตัวดำเนินการอุปกรณ์" หรือ "ตัวดำเนินการ" คือบุคคลหรือองค์กรที่พัฒนาโซลูชันฮาร์ดแวร์/ซอฟต์แวร์ที่ใช้ Android 2.1 "การใช้งานอุปกรณ์" หรือ "การใช้งาน" คือโซลูชันฮาร์ดแวร์/ซอฟต์แวร์ที่พัฒนาขึ้น
ในการพิจารณาว่าเข้ากันได้กับ Android 2.1 การใช้งานอุปกรณ์:
- ต้องเป็นไปตามข้อกำหนดที่แสดงในข้อกำหนดความเข้ากันได้นี้ รวมถึงเอกสารใดๆ ที่รวมอยู่ในการอ้างอิง
- ต้องผ่าน Android Compatibility Test Suite (CTS) เวอร์ชันล่าสุดที่มี ณ เวลาที่ซอฟต์แวร์ของอุปกรณ์ติดตั้งเสร็จสมบูรณ์ (มีให้ใช้งาน CTS โดยเป็นส่วนหนึ่งของ Android Open Source Project [ Resources, 2 ]) CTS ทดสอบองค์ประกอบต่างๆ มากมาย แต่ไม่ใช่ทั้งหมด ของส่วนประกอบที่ระบุไว้ในเอกสารนี้
ในกรณีที่คำจำกัดความนี้หรือ CTS เงียบ คลุมเครือ หรือไม่สมบูรณ์ เป็นความรับผิดชอบของผู้ติดตั้งอุปกรณ์เพื่อให้แน่ใจว่าเข้ากันได้กับการใช้งานที่มีอยู่ ด้วยเหตุนี้ โครงการ Android Open Source [ Resources, 3 ] จึงเป็นทั้งข้อมูลอ้างอิงและการใช้งานที่ต้องการของ Android ขอแนะนำให้ผู้ติดตั้งอุปกรณ์ใช้งานตามซอร์สโค้ด "อัปสตรีม" ที่มีให้จาก Android Open Source Project ในขณะที่ส่วนประกอบบางอย่างสามารถถูกแทนที่ด้วยการใช้งานอื่นตามสมมุติฐานได้ แนวทางปฏิบัตินี้ไม่สนับสนุนอย่างยิ่ง เนื่องจากการผ่านการทดสอบ CTS จะยากขึ้นอย่างมาก เป็นความรับผิดชอบของผู้ดำเนินการเพื่อให้แน่ใจว่ามีความเข้ากันได้ทางพฤติกรรมอย่างสมบูรณ์กับการใช้งาน Android มาตรฐาน รวมถึงและนอกเหนือจากชุดทดสอบความเข้ากันได้ สุดท้าย โปรดทราบว่าเอกสารนี้ห้ามการทดแทนและแก้ไขส่วนประกอบบางอย่างอย่างชัดเจน
2. ทรัพยากร
- ระดับความต้องการ IETF RFC2119: http://www.ietf.org/rfc/rfc2119.txt
- ภาพรวมโปรแกรมความเข้ากันได้ของ Android: http://source.android.com/compatibility/index.html
- โครงการโอเพ่นซอร์ส Android: http://source.android.com/
- ข้อกำหนด API และเอกสารประกอบ: http://developer.android.com/reference/packages.html
- การอ้างอิงสิทธิ์ Android: http://developer.android.com/reference/android/Manifest.permission.html
- การอ้างอิง android.os.Build: http://developer.android.com/reference/android/os/Build.html
- สตริงเวอร์ชันที่อนุญาตสำหรับ Android 2.1: http://source.android.com/compatibility/2.1/versions.html
- คลาส android.webkit.WebView: http://developer.android.com/reference/android/webkit/WebView.html
- HTML5: http://www.whatwg.org/specs/web-apps/current-work/multipage/
- ข้อมูลจำเพาะของเครื่องเสมือน Dalvik: มีอยู่ในซอร์สโค้ดของ Android ที่ dalvik/docs
- AppWidgets: http://developer.android.com/guide/practices/ui_guidelines/widget_design.html
- การแจ้งเตือน: http://developer.android.com/guide/topics/ui/notifiers/notifications.html
- แหล่งข้อมูลแอปพลิเคชัน: http://code.google.com/android/reference/available-resources.html
- คู่มือรูปแบบไอคอนแถบสถานะ: http://developer.android.com/guide/practices/ui_guideline /icon_design.html#statusbarstructure
- ตัวจัดการการค้นหา: http://developer.android.com/reference/android/app/SearchManager.html
- ขนมปังปิ้ง: http://developer.android.com/reference/android/widget/Toast.html
- วอลเปเปอร์สด: https://android-developers.googleblog.com/2010/02/live-wallpapers.html
- แอปสำหรับ Android: http://code.google.com/p/apps-for-android
- เอกสารเครื่องมืออ้างอิง (สำหรับ adb, aapt, ddms): http://developer.android.com/guide/developing/tools/index.html
- คำอธิบายไฟล์ APK ของ Android: http://developer.android.com/guide/topics/fundamentals.html
- ไฟล์รายการ: http://developer.android.com/guide/topics/manifest/manifest-intro.html
- เครื่องมือทดสอบลิง: https://developer.android.com/studio/test/other-testing-tools/monkey
- รองรับหลายหน้าจอ: http://developer.android.com/guide/practices/screens_support.html
- android.content.res.การกำหนดค่า: http://developer.android.com/reference/android/content/res/Configuration.html
- android.util.DisplayMetrics: http://developer.android.com/reference/android/util/DisplayMetrics.html
- android.hardware.Camera: http://developer.android.com/reference/android/hardware/Camera.html
- พื้นที่พิกัดเซนเซอร์: http://developer.android.com/reference/android/hardware/SensorEvent.html
- ข้อมูลอ้างอิงเกี่ยวกับความปลอดภัยและการอนุญาตของ Android: http://developer.android.com/guide/topics/security/security.html
- บลูทูธ API: http://developer.android.com/reference/android/bluetooth/package-summary.html
ทรัพยากรจำนวนมากเหล่านี้ได้รับโดยตรงหรือโดยอ้อมจาก SDK ของ Android 2.1 และจะมีลักษณะการทำงานเหมือนกับข้อมูลในเอกสารประกอบของ SDK นั้น ในกรณีที่คำนิยามความเข้ากันได้นี้หรือชุดทดสอบความเข้ากันได้ไม่เห็นด้วยกับเอกสารประกอบ SDK จะถือว่าเอกสารประกอบ SDK นั้นเชื่อถือได้ รายละเอียดทางเทคนิคใดๆ ที่ระบุในข้อมูลอ้างอิงที่รวมไว้ด้านบนจะถือว่ารวมเป็นส่วนหนึ่งของข้อกำหนดความเข้ากันได้นี้
3. ซอฟต์แวร์
แพลตฟอร์ม Android ประกอบด้วยชุดของ API ที่มีการจัดการ ชุดของ Native API และเนื้อหาของ API ที่เรียกว่า "ซอฟต์" เช่น Intent System และ Web-Application API ส่วนนี้ให้รายละเอียดเกี่ยวกับ API แบบฮาร์ดและซอฟต์ที่เป็นส่วนประกอบสำคัญของความเข้ากันได้ ตลอดจนลักษณะทางเทคนิคและอินเทอร์เฟซผู้ใช้ที่เกี่ยวข้องอื่นๆ การใช้งานอุปกรณ์ต้องเป็นไปตามข้อกำหนดทั้งหมดในส่วนนี้
3.1. ความเข้ากันได้ของ API ที่มีการจัดการ
สภาพแวดล้อมการดำเนินการที่ได้รับการจัดการ (อิงตาม Dalvik) เป็นยานพาหนะหลักสำหรับแอปพลิเคชัน Android อินเทอร์เฟซการเขียนโปรแกรมแอปพลิเคชัน Android (API) คือชุดอินเทอร์เฟซแพลตฟอร์ม Android ที่เปิดเผยต่อแอปพลิเคชันที่ทำงานในสภาพแวดล้อม VM ที่มีการจัดการ การใช้งานอุปกรณ์จะต้องมีการใช้งานที่สมบูรณ์ รวมถึงลักษณะการทำงานที่บันทึกไว้ทั้งหมดของ API ที่มีเอกสารที่เปิดเผยโดย Android 2.1 SDK [ ทรัพยากร, 4 ]
การนำอุปกรณ์ไปใช้ต้องไม่ละเว้น API ที่มีการจัดการ เปลี่ยนแปลงอินเทอร์เฟซหรือลายเซ็น API เบี่ยงเบนไปจากลักษณะการทำงานที่จัดทำเป็นเอกสาร หรือรวมการไม่ดำเนินการ เว้นแต่จะอนุญาตโดยข้อกำหนดความเข้ากันได้นี้เป็นการเฉพาะ
3.2. ความเข้ากันได้ของ Soft API
นอกเหนือจาก API ที่มีการจัดการจากหัวข้อ 3.1 แล้ว Android ยังมี API "ซอฟต์" เฉพาะรันไทม์ที่สำคัญ ในรูปแบบของสิ่งต่างๆ เช่น Intents การอนุญาต และลักษณะที่คล้ายกันของแอปพลิเคชัน Android ที่ไม่สามารถบังคับใช้ได้ในขณะรวบรวมแอปพลิเคชัน ส่วนนี้ให้รายละเอียดเกี่ยวกับ API "ซอฟต์" และลักษณะการทำงานของระบบที่จำเป็นสำหรับความเข้ากันได้กับ Android 2.1 การใช้งานอุปกรณ์ต้องเป็นไปตามข้อกำหนดทั้งหมดที่แสดงไว้ในส่วนนี้
3.2.1. สิทธิ์
ผู้ดำเนินการอุปกรณ์ต้องสนับสนุนและบังคับใช้ค่าคงที่สิทธิ์ทั้งหมดตามเอกสารในหน้าอ้างอิงสิทธิ์ [ ทรัพยากร 5 ] โปรดทราบว่าส่วนที่ 10 แสดงข้อกำหนดเพิ่มเติมที่เกี่ยวข้องกับโมเดลความปลอดภัยของ Android
3.2.2. สร้างพารามิเตอร์
Android API มีค่าคงที่จำนวนหนึ่งในคลาส android.os.Build
[ Resources, 6 ] ซึ่งมีไว้เพื่ออธิบายอุปกรณ์ปัจจุบัน เพื่อให้มีค่าที่มีความหมายและสอดคล้องกันในการใช้งานอุปกรณ์ ตารางด้านล่างมีข้อจำกัดเพิ่มเติมเกี่ยวกับรูปแบบของค่าเหล่านี้ซึ่งการใช้งานอุปกรณ์ต้องสอดคล้อง
พารามิเตอร์ | ความคิดเห็น |
android.os.Build.VERSION.RELEASE | เวอร์ชันของระบบ Android ที่กำลังดำเนินการอยู่ในรูปแบบที่มนุษย์อ่านได้ ช่องนี้ต้องมีหนึ่งในค่าสตริงที่กำหนดไว้ใน [ Resources, 7 ] |
android.os.Build.VERSION.SDK | เวอร์ชันของระบบ Android ที่ใช้งานอยู่ในปัจจุบัน ในรูปแบบที่รหัสแอปพลิเคชันของบุคคลที่สามสามารถเข้าถึงได้ สำหรับ Android 2.1 ช่องนี้ต้องมีค่าจำนวนเต็ม 7 |
android.os.Build.VERSION.INCREMENTAL | ค่าที่เลือกโดยผู้ดำเนินการอุปกรณ์ซึ่งกำหนดรุ่นเฉพาะของระบบ Android ที่ใช้งานอยู่ในปัจจุบัน ในรูปแบบที่มนุษย์อ่านได้ ต้องไม่ใช้ค่านี้ซ้ำสำหรับรุ่นต่างๆ ที่จัดส่งไปยังผู้ใช้ปลายทาง การใช้ฟิลด์นี้โดยทั่วไปคือการระบุว่าหมายเลขบิลด์หรือตัวระบุการเปลี่ยนแปลงการควบคุมแหล่งที่มาใดถูกใช้เพื่อสร้างบิลด์ ไม่มีข้อกำหนดเกี่ยวกับรูปแบบเฉพาะของฟิลด์นี้ ยกเว้นว่าต้องไม่เป็นค่าว่างหรือสตริงว่าง ("") |
android.os.Build.BOARD | ค่าที่เลือกโดยผู้ติดตั้งอุปกรณ์ซึ่งระบุฮาร์ดแวร์ภายในเฉพาะที่ใช้โดยอุปกรณ์ ในรูปแบบที่มนุษย์อ่านได้ การใช้ฟิลด์นี้ที่เป็นไปได้คือเพื่อระบุการแก้ไขเฉพาะของบอร์ดที่ให้พลังงานแก่อุปกรณ์ ไม่มีข้อกำหนดเกี่ยวกับรูปแบบเฉพาะของฟิลด์นี้ ยกเว้นว่าต้องไม่เป็นค่าว่างหรือสตริงว่าง ("") |
android.os.Build.BRAND | ค่าที่เลือกโดยผู้ติดตั้งอุปกรณ์ซึ่งระบุชื่อของบริษัท องค์กร บุคคล ฯลฯ ที่ผลิตอุปกรณ์ในรูปแบบที่มนุษย์อ่านได้ การใช้ฟิลด์นี้ที่เป็นไปได้คือการระบุ OEM และ/หรือผู้ให้บริการที่ขายอุปกรณ์ ไม่มีข้อกำหนดเกี่ยวกับรูปแบบเฉพาะของฟิลด์นี้ ยกเว้นว่าต้องไม่เป็นค่าว่างหรือสตริงว่าง ("") |
android.os.Build.DEVICE | ค่าที่เลือกโดยผู้ติดตั้งอุปกรณ์ซึ่งระบุการกำหนดค่าเฉพาะหรือการแก้ไขเนื้อหา (บางครั้งเรียกว่า "การออกแบบอุตสาหกรรม") ของอุปกรณ์ ไม่มีข้อกำหนดเกี่ยวกับรูปแบบเฉพาะของฟิลด์นี้ ยกเว้นว่าต้องไม่เป็นค่าว่างหรือสตริงว่าง ("") |
android.os.Build.ลายนิ้วมือ | สตริงที่ระบุงานสร้างนี้โดยเฉพาะ มันควรจะเป็นเหตุผลที่มนุษย์สามารถอ่านได้ ต้องเป็นไปตามเทมเพลตนี้:$(BRAND)/$(PRODUCT)/$(DEVICE)/$(BOARD):$(VERSION.RELEASE)/$(ID)/$(VERSION.INCREMENTAL):$(TYPE)/$(TAGS) ตัวอย่างเช่น: acme/mydevice/generic/generic:2.1-update1/ERC77/3359:userdebug/test-keys ลายนิ้วมือต้องไม่มีช่องว่าง หากช่องอื่นๆ ที่รวมอยู่ในเทมเพลตด้านบนมีช่องว่าง ควรแทนที่ด้วยอักขระ ASCII ขีดล่าง ("_") ในลายนิ้วมือ |
android.os.Build.HOST | สตริงที่ระบุเฉพาะโฮสต์ที่บิลด์สร้างขึ้นในรูปแบบที่มนุษย์อ่านได้ ไม่มีข้อกำหนดเกี่ยวกับรูปแบบเฉพาะของฟิลด์นี้ ยกเว้นว่าต้องไม่เป็นค่าว่างหรือสตริงว่าง ("") |
android.os.Build.ID | ตัวระบุที่เลือกโดยผู้ดำเนินการอุปกรณ์เพื่ออ้างอิงถึงรุ่นที่เจาะจง ในรูปแบบที่มนุษย์อ่านได้ ฟิลด์นี้สามารถเหมือนกับ android.os.Build.VERSION.INCREMENTAL แต่ควรเป็นค่าที่มีความหมายเพียงพอสำหรับผู้ใช้ปลายทางในการแยกความแตกต่างระหว่างรุ่นซอฟต์แวร์ ไม่มีข้อกำหนดเกี่ยวกับรูปแบบเฉพาะของฟิลด์นี้ ยกเว้นว่าต้องไม่เป็นค่าว่างหรือสตริงว่าง ("") |
android.os.Build.MODEL | ค่าที่เลือกโดยผู้ดำเนินการอุปกรณ์ที่มีชื่อของอุปกรณ์ที่ผู้ใช้ปลายทางรู้จัก ชื่อนี้ควรเป็นชื่อเดียวกับอุปกรณ์ที่ทำการตลาดและขายให้กับผู้ใช้ปลายทาง ไม่มีข้อกำหนดเกี่ยวกับรูปแบบเฉพาะของฟิลด์นี้ ยกเว้นว่าต้องไม่เป็นค่าว่างหรือสตริงว่าง ("") |
android.os.Build.PRODUCT | ค่าที่เลือกโดยผู้ดำเนินการอุปกรณ์ที่มีชื่อการพัฒนาหรือชื่อรหัสของอุปกรณ์ ต้องสามารถอ่านได้โดยมนุษย์ แต่ไม่จำเป็นต้องให้ผู้ใช้ปลายทางดู ไม่มีข้อกำหนดเกี่ยวกับรูปแบบเฉพาะของฟิลด์นี้ ยกเว้นว่าต้องไม่เป็นค่าว่างหรือสตริงว่าง ("") |
android.os.Build.TAGS | รายการแท็กที่คั่นด้วยเครื่องหมายจุลภาคที่ผู้ติดตั้งอุปกรณ์เลือกซึ่งแยกความแตกต่างของบิลด์เพิ่มเติม ตัวอย่างเช่น "unsigned,debug" ช่องนี้ต้องไม่เป็นค่าว่างหรือสตริงว่าง ("") แต่แท็กเดียว (เช่น "release") ก็ใช้ได้ |
android.os.Build.TIME | ค่าที่แสดงการประทับเวลาของเวลาที่บิลด์เกิดขึ้น |
android.os.Build.TYPE | ค่าที่เลือกโดยผู้ดำเนินการอุปกรณ์ซึ่งระบุการกำหนดค่ารันไทม์ของบิลด์ ช่องนี้ควรมีค่าใดค่าหนึ่งที่สอดคล้องกับการกำหนดค่ารันไทม์ Android ทั่วไปสามค่า ได้แก่ "user", "userdebug" หรือ "eng" |
android.os.Build.USER | ชื่อหรือ ID ผู้ใช้ของผู้ใช้ (หรือผู้ใช้อัตโนมัติ) ที่สร้างบิลด์ ไม่มีข้อกำหนดเกี่ยวกับรูปแบบเฉพาะของฟิลด์นี้ ยกเว้นว่าต้องไม่เป็นค่าว่างหรือสตริงว่าง ("") |
3.2.3. ความเข้ากันได้ของเจตนา
Android ใช้ Intents เพื่อให้เกิดการผสมผสานอย่างหลวมๆ ระหว่างแอปพลิเคชันต่างๆ ส่วนนี้อธิบายข้อกำหนดที่เกี่ยวข้องกับรูปแบบความตั้งใจที่ต้องได้รับเกียรติจากการใช้งานอุปกรณ์ ตาม "เกียรติ" หมายความว่าผู้ติดตั้งอุปกรณ์ต้องจัดให้มีกิจกรรมหรือบริการของ Android ที่ระบุตัวกรองเจตนาที่ตรงกันและเชื่อมโยงและใช้พฤติกรรมที่ถูกต้องสำหรับรูปแบบความตั้งใจที่ระบุแต่ละรูปแบบ
3.2.3.1. ความตั้งใจของแอปพลิเคชันหลัก
โครงการอัปสตรีมของ Android กำหนดแอปพลิเคชันหลักจำนวนหนึ่ง เช่น โปรแกรมโทรออก ปฏิทิน สมุดรายชื่อ เครื่องเล่นเพลง และอื่นๆ ผู้ดำเนินการอุปกรณ์อาจแทนที่แอปพลิเคชันเหล่านี้ด้วยเวอร์ชันอื่น
อย่างไรก็ตาม เวอร์ชันทางเลือกใดๆ ดังกล่าวต้องเป็นไปตามรูปแบบความตั้งใจเดียวกันที่จัดทำโดยโครงการอัปสตรีม ตัวอย่างเช่น หากอุปกรณ์มีเครื่องเล่นเพลงทางเลือก อุปกรณ์ยังคงต้องปฏิบัติตามรูปแบบ Intent ที่ออกโดยแอปพลิเคชันของบุคคลที่สามเพื่อเลือกเพลง
แอปพลิเคชันต่อไปนี้ถือเป็นแอปพลิเคชันหลักของระบบ Android:
- นาฬิกาตั้งโต๊ะ
- เบราว์เซอร์
- ปฏิทิน
- เครื่องคิดเลข
- กล้อง
- ติดต่อ
- อีเมล
- แกลลอรี่
- GlobalSearch
- ตัวเรียกใช้งาน
- LivePicker (นั่นคือแอปพลิเคชันตัวเลือกวอลเปเปอร์สด อาจละเว้นได้หากอุปกรณ์ไม่รองรับวอลเปเปอร์สด ตามข้อ 3.8.5)
- ข้อความ (หรือที่เรียกว่า "Mms")
- ดนตรี
- โทรศัพท์
- การตั้งค่า
- บันทึกเสียง
แอปพลิเคชันระบบ Android หลักประกอบด้วยกิจกรรมหรือองค์ประกอบบริการต่างๆ ที่ถือว่าเป็น "สาธารณะ" นั่นคือ คุณลักษณะ "android:exported" อาจขาดหายไป หรืออาจมีค่าเป็น "จริง"
สำหรับทุกกิจกรรมหรือบริการที่กำหนดไว้ในหนึ่งในแอปหลักของระบบ Android ที่ไม่ได้ทำเครื่องหมายว่าไม่เป็นสาธารณะผ่านแอตทริบิวต์ android:exported ที่มีค่าเป็น "เท็จ" การใช้งานอุปกรณ์ต้องมีส่วนประกอบประเภทเดียวกันซึ่งใช้ตัวกรอง Intent เดียวกัน รูปแบบเป็นแอประบบ Android หลัก
กล่าวอีกนัยหนึ่ง การใช้งานอุปกรณ์อาจแทนที่แอปหลักของระบบ Android; อย่างไรก็ตาม หากเป็นเช่นนั้น การใช้งานอุปกรณ์จะต้องรองรับรูปแบบความตั้งใจทั้งหมดที่กำหนดโดยแอประบบ Android หลักแต่ละแอปที่ถูกแทนที่
3.2.3.2. การแทนที่เจตนา
เนื่องจาก Android เป็นแพลตฟอร์มที่ขยายได้ ผู้ติดตั้งอุปกรณ์จึงต้องยอมให้รูปแบบ Intent แต่ละรูปแบบที่กำหนดไว้ในแอประบบหลักถูกแทนที่โดยแอปพลิเคชันของบุคคลที่สาม โครงการโอเพ่นซอร์สอัปสตรีม Android อนุญาตสิ่งนี้ตามค่าเริ่มต้น ผู้ติดตั้งอุปกรณ์ต้องไม่ติดสิทธิพิเศษในการใช้รูปแบบ Intent เหล่านี้ของแอปพลิเคชันระบบ หรือป้องกันไม่ให้แอปพลิเคชันของบุคคลที่สามผูกมัดและเข้าควบคุมรูปแบบเหล่านี้ ข้อห้ามนี้รวมถึงแต่ไม่จำกัดเพียงการปิดใช้งานอินเทอร์เฟซผู้ใช้ "ตัวเลือก" ซึ่งอนุญาตให้ผู้ใช้เลือกระหว่างแอปพลิเคชันหลายตัวที่จัดการรูปแบบความตั้งใจเดียวกันทั้งหมด
3.2.3.3. เนมสเปซเจตนา
ผู้ดำเนินการอุปกรณ์ต้องไม่มีคอมโพเนนต์ Android ที่ให้เกียรติรูปแบบความตั้งใจหรือความตั้งใจในการออกอากาศใหม่ใดๆ โดยใช้ ACTION, CATEGORY หรือสตริงคีย์อื่นๆ ใน android.* เนมสเปซ ผู้ติดตั้งอุปกรณ์ต้องไม่มีส่วนประกอบของ Android ที่ให้เกียรติรูปแบบความตั้งใจหรือความตั้งใจในการแพร่ภาพใหม่ใดๆ โดยใช้ ACTION, CATEGORY หรือสตริงคีย์อื่นๆ ในพื้นที่แพ็คเกจที่เป็นขององค์กรอื่น ผู้ติดตั้งอุปกรณ์ต้องไม่แก้ไขหรือขยายรูปแบบความตั้งใจใดๆ ที่ใช้โดยแอปหลักที่ระบุไว้ในส่วน 3.2.3.1
ข้อห้ามนี้คล้ายคลึงกับที่ระบุไว้สำหรับคลาสภาษา Java ในข้อ 3.6
3.2.3.4. ความตั้งใจในการออกอากาศ
แอปพลิเคชันของบุคคลที่สามพึ่งพาแพลตฟอร์มเพื่อเผยแพร่ความตั้งใจบางอย่างเพื่อแจ้งให้ทราบถึงการเปลี่ยนแปลงในสภาพแวดล้อมของฮาร์ดแวร์หรือซอฟต์แวร์ อุปกรณ์ที่ใช้งานร่วมกันได้กับ Android ต้องเผยแพร่เจตนาการแพร่ภาพสาธารณะเพื่อตอบสนองต่อเหตุการณ์ของระบบที่เหมาะสม Broadcast Intent อธิบายไว้ในเอกสารประกอบ SDK
3.3. ความเข้ากันได้ของ Native API
โค้ดที่ได้รับการจัดการที่ทำงานใน Dalvik สามารถเรียกใช้โค้ดเนทีฟที่ให้ไว้ในไฟล์ .apk ของแอปพลิเคชันเป็นไฟล์ ELF .so ที่คอมไพล์สำหรับสถาปัตยกรรมฮาร์ดแวร์ของอุปกรณ์ที่เหมาะสม การใช้งานอุปกรณ์ต้องมีการสนับสนุนโค้ดที่ทำงานในสภาพแวดล้อมที่มีการจัดการเพื่อเรียกใช้โค้ดเนทีฟ โดยใช้ความหมายของ Java Native Interface (JNI) มาตรฐาน API ต่อไปนี้ต้องพร้อมใช้งานสำหรับโค้ดเนทีฟ:
- libc (ไลบรารี C)
- libm (ห้องสมุดคณิตศาสตร์)
- อินเทอร์เฟซ JNI
- libz (การบีบอัด Zlib)
- liblog (การบันทึก Android)
- การสนับสนุนขั้นต่ำสำหรับ C ++
- รองรับ OpenGL ตามที่อธิบายไว้ด้านล่าง
การใช้งานอุปกรณ์ต้องรองรับ OpenGL ES 1.0 อุปกรณ์ที่ขาดการเร่งด้วยฮาร์ดแวร์ต้องใช้ OpenGL ES 1.0 โดยใช้ซอฟต์แวร์เรนเดอร์ การใช้งานอุปกรณ์ควรใช้ OpenGL ES 1.1 มากเท่าที่ฮาร์ดแวร์อุปกรณ์รองรับ การใช้งานอุปกรณ์ควรจัดให้มีการใช้งานสำหรับ OpenGL ES 2.0 หากฮาร์ดแวร์มีความสามารถในการทำงานที่สมเหตุสมผลบน API เหล่านั้น
ไลบรารีเหล่านี้ต้องเข้ากันได้กับซอร์ส (เช่น เข้ากันได้กับส่วนหัว) และเข้ากันได้กับไบนารี (สำหรับสถาปัตยกรรมโปรเซสเซอร์ที่กำหนด) ด้วยเวอร์ชันที่มีให้ใน Bionic โดยโครงการ Android Open Source เนื่องจากการใช้งาน Bionic ไม่สามารถทำงานร่วมกับการใช้งานอื่นๆ ได้อย่างสมบูรณ์ เช่น ไลบรารี GNU C ผู้ติดตั้งอุปกรณ์จึงควรใช้งาน Android หากผู้ดำเนินการอุปกรณ์ใช้การใช้งานที่แตกต่างกันของไลบรารีเหล่านี้ พวกเขาต้องตรวจสอบความเข้ากันได้ของส่วนหัว ไบนารี และพฤติกรรม
การใช้งานอุปกรณ์ต้องรายงาน Application Binary Interface (ABI) ดั้งเดิมที่อุปกรณ์รองรับอย่างถูกต้อง ผ่านทาง android.os.Build.CPU_ABI
API ABI ต้องเป็นหนึ่งในรายการที่บันทึกไว้ใน Android NDK เวอร์ชันล่าสุดในไฟล์ docs/CPU-ARCH-ABIS.txt
โปรดทราบว่า Android NDK รุ่นเพิ่มเติมอาจแนะนำการรองรับ ABI เพิ่มเติม
ความเข้ากันได้ของรหัสเนทีฟเป็นสิ่งที่ท้าทาย ด้วยเหตุผลนี้ ควรกล่าวย้ำอีกครั้งว่าผู้ติดตั้งอุปกรณ์ควรได้รับการสนับสนุนให้ใช้งานแบบต้นน้ำของไลบรารีที่แสดงรายการด้านบน เพื่อช่วยให้มั่นใจในความเข้ากันได้
3.4. ความเข้ากันได้ของ Web API
นักพัฒนาซอฟต์แวร์และแอปพลิเคชันจำนวนมากอาศัยลักษณะการทำงานของคลาส android.webkit.WebView
[ ทรัพยากร, 8 ] สำหรับส่วนต่อประสานผู้ใช้ ดังนั้นการติดตั้งใช้งาน WebView จะต้องเข้ากันได้กับการใช้งาน Android ทั้งหมด การใช้งาน Android Open Source ใช้เครื่องมือแสดงผล WebKit เพื่อใช้งาน WebView
เนื่องจากเป็นไปไม่ได้ที่จะพัฒนาชุดทดสอบที่ครอบคลุมสำหรับเว็บเบราว์เซอร์ ผู้ติดตั้งอุปกรณ์จึงต้องใช้ WebKit รุ่นอัพสตรีมเฉพาะในการใช้งาน WebView โดยเฉพาะ:
- WebView ต้องใช้บิลด์ WebKit 530.17 จากต้นทาง Android Open Source tree สำหรับ Android 2.1 รุ่นนี้มีชุดฟังก์ชันการทำงานและการแก้ไขด้านความปลอดภัยเฉพาะสำหรับ WebView
- สตริงตัวแทนผู้ใช้ที่รายงานโดย WebView ต้องอยู่ในรูปแบบนี้:
Mozilla/5.0 (Linux; U; Android $(VERSION); $(LOCALE); $(MODEL) Build/$(BUILD)) AppleWebKit/530.17 (KHTML, like Gecko) Version/4.0 Mobile Safari/530.17
- ค่าของสตริง $(VERSION) จะต้องเหมือนกับค่าของ
android.os.Build.VERSION.RELEASE
- ค่าของสตริง $(LOCALE) ควรเป็นไปตามมาตรฐาน ISO สำหรับรหัสประเทศและภาษา และควรอ้างอิงถึงโลแคลที่กำหนดค่าปัจจุบันของอุปกรณ์
- ค่าของสตริง $(MODEL) จะต้องเหมือนกับค่าของ
android.os.Build.MODEL
- ค่าของสตริง $(BUILD) จะต้องเหมือนกับค่าของ
android.os.Build.ID
- ค่าของสตริง $(VERSION) จะต้องเหมือนกับค่าของ
การนำไปใช้อาจจัดส่งสตริงตัวแทนผู้ใช้ที่กำหนดเองในแอปพลิเคชันเบราว์เซอร์แบบสแตนด์อโลน ยิ่งไปกว่านั้น เบราว์เซอร์แบบสแตนด์อโลนอาจใช้เทคโนโลยีเบราว์เซอร์สำรอง (เช่น Firefox, Opera เป็นต้น) อย่างไรก็ตาม แม้ว่าจะมีการจัดส่งแอปพลิเคชันเบราว์เซอร์สำรอง คอมโพเนนต์ WebView ที่จัดเตรียมให้กับแอปพลิเคชันของบริษัทอื่นจะต้องอิงตาม WebKit ดังกล่าวข้างต้น
การกำหนดค่า WebView ต้องรองรับฐานข้อมูล HTML5, แคชของแอปพลิเคชัน และ API ตำแหน่งทางภูมิศาสตร์ [ ทรัพยากร, 9 ] WebView ต้องรองรับแท็ก HTML5 <video>
ในบางรูปแบบ แอปพลิเคชันเบราว์เซอร์แบบสแตนด์อโลน (ไม่ว่าจะใช้แอปพลิเคชันเบราว์เซอร์ WebKit อัปสตรีมหรือใช้แทนโดยบริษัทอื่น) ต้องมีการสนับสนุนสำหรับคุณลักษณะ HTML5 เดียวกันกับที่แสดงรายการไว้สำหรับ WebView
3.5. ความเข้ากันได้ของพฤติกรรม API
ลักษณะการทำงานของ API แต่ละประเภท (แบบจัดการ แบบซอฟต์ แบบเนทีฟ และแบบเว็บ) ต้องสอดคล้องกับการใช้งานที่ต้องการของโครงการโอเพนซอร์สอัปสตรีม Android [ ทรัพยากร 3 ] ความเข้ากันได้เฉพาะบางพื้นที่ ได้แก่ :
- อุปกรณ์ต้องไม่เปลี่ยนลักษณะการทำงานหรือความหมายของเจตนามาตรฐาน
- อุปกรณ์ต้องไม่เปลี่ยนแปลงวงจรชีวิตหรือความหมายวงจรชีวิตของส่วนประกอบระบบประเภทใดประเภทหนึ่ง (เช่น บริการ กิจกรรม ผู้ให้บริการเนื้อหา ฯลฯ)
- อุปกรณ์ต้องไม่เปลี่ยนความหมายของการอนุญาตเฉพาะ
รายการด้านบนไม่ครอบคลุมทั้งหมด และความรับผิดชอบอยู่ที่ผู้ดำเนินการอุปกรณ์เพื่อให้แน่ใจว่ามีความเข้ากันได้ทางพฤติกรรม ด้วยเหตุผลนี้ ผู้ติดตั้งอุปกรณ์ควรใช้ซอร์สโค้ดที่มีให้ผ่านทาง Android Open Source Project หากเป็นไปได้ แทนที่จะนำส่วนสำคัญของระบบกลับมาใช้ใหม่
ชุดทดสอบความเข้ากันได้ (CTS) ทดสอบส่วนสำคัญของแพลตฟอร์มสำหรับความเข้ากันได้ทางพฤติกรรม แต่ไม่ใช่ทั้งหมด เป็นความรับผิดชอบของผู้ดำเนินการเพื่อให้แน่ใจว่าความเข้ากันได้ทางพฤติกรรมกับ Android Open Source Project
3.6. API เนมสเปซ
Android ทำตามข้อตกลงเนมสเปซแพ็คเกจและคลาสที่กำหนดโดยภาษาโปรแกรม Java เพื่อให้แน่ใจว่าเข้ากันได้กับแอปพลิเคชันของบุคคลที่สาม ผู้ติดตั้งอุปกรณ์ต้องไม่ทำการแก้ไขใดๆ ที่ต้องห้าม (ดูด้านล่าง) กับเนมสเปซของแพ็คเกจเหล่านี้:
- การใช้งานอุปกรณ์ต้องไม่แก้ไข API ที่เปิดเผยต่อสาธารณะบนแพลตฟอร์ม Android โดยการเปลี่ยนเมธอดหรือลายเซ็นคลาสใดๆ หรือโดยการลบคลาสหรือฟิลด์คลาส
- ผู้ดำเนินการอุปกรณ์อาจแก้ไขการใช้งานพื้นฐานของ API แต่การแก้ไขดังกล่าวต้องไม่ส่งผลกระทบต่อลักษณะการทำงานที่ระบุและลายเซ็นภาษา Java ของ API ใด ๆ ที่เปิดเผยต่อสาธารณะ
- ผู้ดำเนินการอุปกรณ์ต้องไม่เพิ่มองค์ประกอบใดๆ ที่เปิดเผยต่อสาธารณะ (เช่น คลาสหรืออินเทอร์เฟซ หรือฟิลด์หรือเมธอดในคลาสหรืออินเทอร์เฟซที่มีอยู่) ให้กับ API ข้างต้น
"องค์ประกอบที่เปิดเผยต่อสาธารณะ" คือโครงสร้างใดๆ ที่ไม่ได้ตกแต่งด้วยเครื่องหมาย "@hide" ในซอร์สโค้ดอัปสตรีมของ Android กล่าวอีกนัยหนึ่ง ผู้ติดตั้งอุปกรณ์ต้องไม่เปิดเผย API ใหม่หรือแก้ไข API ที่มีอยู่ในเนมสเปซที่ระบุไว้ข้างต้น ผู้ดำเนินการอุปกรณ์อาจทำการแก้ไขภายในเท่านั้น แต่การแก้ไขเหล่านั้นจะต้องไม่ถูกโฆษณาหรือเปิดเผยต่อนักพัฒนา
ผู้ดำเนินการอุปกรณ์อาจเพิ่ม API ที่กำหนดเองได้ แต่ API ดังกล่าวจะต้องไม่อยู่ในเนมสเปซที่เป็นขององค์กรอื่นหรืออ้างอิงถึงองค์กรอื่น ตัวอย่างเช่น ผู้ติดตั้งอุปกรณ์ต้องไม่เพิ่ม API ให้กับ com.google.* หรือเนมสเปซที่คล้ายกัน Google เท่านั้นที่สามารถทำได้ ในทำนองเดียวกัน Google จะต้องไม่เพิ่ม API ในเนมสเปซของบริษัทอื่น
หากผู้ติดตั้งอุปกรณ์เสนอที่จะปรับปรุงหนึ่งในแพ็คเกจเนมสเปซด้านบน (เช่น โดยการเพิ่มฟังก์ชันใหม่ที่มีประโยชน์ให้กับ API ที่มีอยู่ หรือเพิ่ม API ใหม่) ผู้ติดตั้งควรไปที่ source.android.com และเริ่มกระบวนการเพื่อร่วมเปลี่ยนแปลงและ รหัสตามข้อมูลในเว็บไซต์นั้น
โปรดทราบว่าข้อจำกัดข้างต้นสอดคล้องกับแบบแผนมาตรฐานสำหรับการตั้งชื่อ API ในภาษาการเขียนโปรแกรมจาวา ส่วนนี้มีจุดมุ่งหมายเพื่อเสริมอนุสัญญาเหล่านั้นและทำให้มีผลผูกพันโดยรวมอยู่ในข้อกำหนดความเข้ากันได้นี้
3.7. ความเข้ากันได้ของเครื่องเสมือน
การใช้งานอุปกรณ์ต้องรองรับข้อมูลจำเพาะ bytecode ของ Dalvik Executable (DEX) และความหมายของ Dalvik Virtual Machine [ ทรัพยากร, 10 ]
การใช้งานอุปกรณ์ต้องกำหนดค่า Dalvik ให้จัดสรรหน่วยความจำอย่างน้อย 16MB ให้กับแต่ละแอปพลิเคชันบนอุปกรณ์ที่มีหน้าจอที่จัดประเภทเป็นความหนาแน่นปานกลางหรือต่ำ การใช้งานอุปกรณ์ต้องกำหนดค่า Dalvik ให้จัดสรรหน่วยความจำอย่างน้อย 24MB ให้กับแต่ละแอปพลิเคชันบนอุปกรณ์ที่มีหน้าจอจัดประเภทความหนาแน่นสูง โปรดทราบว่าการใช้งานอุปกรณ์อาจจัดสรรหน่วยความจำมากกว่าตัวเลขเหล่านี้ แต่ไม่จำเป็น
3.8. ความเข้ากันได้ของอินเทอร์เฟซผู้ใช้
แพลตฟอร์ม Android มี API สำหรับนักพัฒนาบางตัวที่อนุญาตให้นักพัฒนาเชื่อมต่อเข้ากับส่วนต่อประสานผู้ใช้ของระบบ การใช้งานอุปกรณ์ต้องรวม UI API มาตรฐานเหล่านี้เข้ากับส่วนต่อประสานผู้ใช้แบบกำหนดเองที่พัฒนาขึ้นตามที่อธิบายไว้ด้านล่าง
3.8.1. วิดเจ็ต
Android กำหนดประเภทคอมโพเนนต์และ API ที่สอดคล้องกันและวงจรชีวิตที่อนุญาตให้แอปพลิเคชันเปิดเผย "AppWidget" ต่อผู้ใช้ปลายทาง [ ทรัพยากร, 11 ] รุ่นอ้างอิง Android Open Source มีแอปพลิเคชัน Launcher ที่มีองค์ประกอบส่วนติดต่อผู้ใช้ที่ช่วยให้ผู้ใช้เพิ่ม ดู และลบ AppWidgets ออกจากหน้าจอหลักได้
ผู้ดำเนินการอุปกรณ์อาจใช้แทนตัวเรียกใช้งานอ้างอิง (เช่น หน้าจอหลัก) Launcher ทางเลือกควรมีการสนับสนุนในตัวสำหรับ AppWidgets และเปิดเผยองค์ประกอบอินเทอร์เฟซผู้ใช้เพื่อเพิ่ม กำหนดค่า ดู และลบ AppWidgets โดยตรงภายใน Launcher ตัวเรียกใช้งานทางเลือกอาจละเว้นองค์ประกอบอินเทอร์เฟซผู้ใช้เหล่านี้ อย่างไรก็ตาม หากละเว้น ผู้ดำเนินการอุปกรณ์ต้องจัดเตรียมแอปพลิเคชันแยกต่างหากที่เข้าถึงได้จาก Launcher ซึ่งอนุญาตให้ผู้ใช้เพิ่ม กำหนดค่า ดู และลบ AppWidgets
3.8.2. การแจ้งเตือน
Android มี API ที่ช่วยให้นักพัฒนาสามารถแจ้งผู้ใช้เกี่ยวกับเหตุการณ์สำคัญ [ แหล่งข้อมูล, 12 ] ผู้ดำเนินการอุปกรณ์ต้องให้การสนับสนุนสำหรับการแจ้งเตือนแต่ละประเภทตามที่กำหนดไว้ โดยเฉพาะ: เสียง การสั่น แสง และแถบสถานะ
นอกจากนี้ การดำเนินการต้องแสดงทรัพยากรทั้งหมด (ไอคอน ไฟล์เสียง ฯลฯ) อย่างถูกต้องใน API [ ทรัพยากร 13 ] หรือในคู่มือรูปแบบไอคอนแถบสถานะ [ ทรัพยากร 14 ] ผู้ดำเนินการอุปกรณ์อาจให้ประสบการณ์ผู้ใช้ทางเลือกสำหรับการแจ้งเตือนมากกว่าที่ได้รับจากการใช้ Android Open Source อ้างอิง อย่างไรก็ตาม ระบบการแจ้งเตือนทางเลือกดังกล่าวต้องรองรับทรัพยากรการแจ้งเตือนที่มีอยู่ดังข้างต้น
3.8.3. ค้นหา
Android มี API [ ทรัพยากร, 15 ] ที่ช่วยให้นักพัฒนาสามารถรวมการค้นหาไว้ในแอปพลิเคชันของตน และเปิดเผยข้อมูลของแอปพลิเคชันของตนในการค้นหาระบบทั่วโลก โดยทั่วไปแล้ว ฟังก์ชันนี้ประกอบด้วยส่วนติดต่อผู้ใช้เดียวทั่วทั้งระบบที่อนุญาตให้ผู้ใช้ป้อนข้อความค้นหา แสดงคำแนะนำเมื่อผู้ใช้พิมพ์ และแสดงผลลัพธ์ Android APIs ช่วยให้นักพัฒนาสามารถใช้อินเทอร์เฟซนี้ซ้ำเพื่อให้การค้นหาภายในแอปของตนเอง และช่วยให้นักพัฒนาสามารถจัดหาผลลัพธ์ให้กับอินเทอร์เฟซผู้ใช้การค้นหาส่วนกลางทั่วไป
การใช้งานอุปกรณ์ต้องมีส่วนต่อประสานผู้ใช้การค้นหาเดียวที่ใช้ร่วมกันทั้งระบบที่สามารถให้คำแนะนำแบบเรียลไทม์เพื่อตอบสนองต่ออินพุตของผู้ใช้ การใช้งานอุปกรณ์ต้องใช้ API ที่อนุญาตให้นักพัฒนานำส่วนต่อประสานผู้ใช้นี้กลับมาใช้ใหม่เพื่อทำการค้นหาภายในแอปพลิเคชันของตนเอง การใช้งานอุปกรณ์ต้องใช้ API ที่อนุญาตให้แอปพลิเคชันบุคคลที่สามเพิ่มคำแนะนำลงในช่องค้นหาเมื่อเรียกใช้ในโหมดการค้นหาส่วนกลาง หากไม่มีการติดตั้งแอปพลิเคชันของบุคคลที่สามที่ใช้ฟังก์ชันนี้ ลักษณะการทำงานเริ่มต้นควรเป็นเพื่อแสดงผลลัพธ์ของเครื่องมือค้นหาเว็บและคำแนะนำ
การใช้งานอุปกรณ์อาจจัดส่งส่วนติดต่อผู้ใช้การค้นหาสำรอง แต่ควรมีปุ่มค้นหาเฉพาะแบบฮาร์ดหรือซอฟต์ ซึ่งสามารถใช้ได้ทุกเวลาภายในแอปใดๆ เพื่อเรียกใช้เฟรมเวิร์กการค้นหา โดยมีลักษณะการทำงานที่ระบุไว้ในเอกสารประกอบ API
3.8.4. ขนมปังปิ้ง
แอปพลิเคชันสามารถใช้ "Toast" API (กำหนดใน [ ทรัพยากร, 16 ]) เพื่อแสดงสตริงที่ไม่ใช่โมดอลสั้นๆ แก่ผู้ใช้ ซึ่งจะหายไปหลังจากช่วงเวลาสั้นๆ การใช้งานอุปกรณ์ต้องแสดง Toasts จากแอปพลิเคชันแก่ผู้ใช้ในลักษณะที่มองเห็นได้ชัดเจน
3.8.5. วอลเปเปอร์สด
Android กำหนดประเภทคอมโพเนนต์และ API ที่สอดคล้องกันและวงจรชีวิตที่อนุญาตให้แอปพลิเคชันเปิดเผย "วอลเปเปอร์สด" อย่างน้อยหนึ่งรายการต่อผู้ใช้ปลายทาง [ แหล่งข้อมูล, 17 ] วอลเปเปอร์สดคือภาพเคลื่อนไหว ลวดลาย หรือรูปภาพที่คล้ายกันซึ่งมีความสามารถในการป้อนข้อมูลที่จำกัดซึ่งแสดงเป็นวอลเปเปอร์อยู่เบื้องหลังแอปพลิเคชันอื่นๆ
ฮาร์ดแวร์ถือว่าสามารถเรียกใช้วอลเปเปอร์เคลื่อนไหวได้อย่างน่าเชื่อถือ หากสามารถเรียกใช้วอลเปเปอร์เคลื่อนไหวทั้งหมด โดยไม่มีข้อจำกัดในการทำงาน ด้วยอัตราเฟรมที่เหมาะสมโดยไม่มีผลเสียต่อแอปพลิเคชันอื่นๆ หากข้อจำกัดในฮาร์ดแวร์ทำให้วอลเปเปอร์และ/หรือแอปพลิเคชันขัดข้อง ทำงานผิดปกติ ใช้พลังงาน CPU หรือแบตเตอรี่มากเกินไป หรือทำงานที่อัตราเฟรมต่ำจนไม่สามารถยอมรับได้ จะถือว่าฮาร์ดแวร์ไม่สามารถเรียกใช้วอลเปเปอร์สดได้ ตัวอย่างเช่น วอลล์เปเปอร์เคลื่อนไหวบางภาพอาจใช้บริบท Open GL 1.0 หรือ 2.0 เพื่อแสดงเนื้อหา วอลล์เปเปอร์สดจะไม่ทำงานอย่างน่าเชื่อถือบนฮาร์ดแวร์ที่ไม่รองรับบริบท OpenGL หลายรายการ เนื่องจากการใช้วอลล์เปเปอร์สดของบริบท OpenGL อาจขัดแย้งกับแอปพลิเคชันอื่นที่ใช้บริบท OpenGL เช่นกัน
การใช้งานอุปกรณ์ที่สามารถเรียกใช้วอลเปเปอร์เคลื่อนไหวได้อย่างน่าเชื่อถือตามที่อธิบายไว้ข้างต้น ควรใช้วอลเปเปอร์เคลื่อนไหว การใช้งานอุปกรณ์ที่พิจารณาว่าจะไม่เรียกใช้วอลเปเปอร์เคลื่อนไหวได้อย่างน่าเชื่อถือตามที่อธิบายไว้ข้างต้น จะต้องไม่ใช้วอลเปเปอร์เคลื่อนไหว
4. อ้างอิงความเข้ากันได้ของซอฟต์แวร์
ผู้ดำเนินการอุปกรณ์ต้องทดสอบความเข้ากันได้ของการใช้งานโดยใช้แอปพลิเคชันโอเพ่นซอร์สต่อไปนี้:
- เครื่องคิดเลข (รวมอยู่ใน SDK)
- Lunar Lander (รวมอยู่ใน SDK)
- แอปพลิเคชัน "แอปสำหรับ Android" [ แหล่งข้อมูล, 18 ]
แอปแต่ละแอปข้างต้นต้องเปิดใช้งานและทำงานอย่างถูกต้องในการนำไปใช้ เพื่อให้ถือว่าการนำไปใช้งานเข้ากันได้
นอกจากนี้ การใช้งานอุปกรณ์ต้องทดสอบแต่ละรายการเมนู (รวมถึงเมนูย่อยทั้งหมด) ของแอปพลิเคชันทดสอบควันเหล่านี้:
แต่ละกรณีทดสอบในแอปพลิเคชันด้านบนต้องทำงานอย่างถูกต้องในการติดตั้งอุปกรณ์
5. ความเข้ากันได้ของบรรจุภัณฑ์ของแอปพลิเคชัน
การใช้งานอุปกรณ์ต้องติดตั้งและเรียกใช้ไฟล์ ".apk" ของ Android ซึ่งสร้างโดยเครื่องมือ "aapt" ที่รวมอยู่ใน Android SDK อย่างเป็นทางการ [ ทรัพยากร, 19 ]
การใช้งานอุปกรณ์ต้องไม่ขยายรูปแบบ .apk [ Resources, 20 ], Android Manifest [ Resources, 21 ] หรือ Dalvik bytecode [ Resources, 10 ] ในลักษณะที่จะป้องกันไม่ให้ไฟล์เหล่านั้นติดตั้งและทำงานอย่างถูกต้องบนอุปกรณ์ที่เข้ากันได้อื่นๆ . ผู้ติดตั้งอุปกรณ์ควรใช้ Dalvik อัพสตรีมอ้างอิง และระบบจัดการแพ็คเกจของการใช้งานอ้างอิง
6. ความเข้ากันได้ของมัลติมีเดีย
การใช้งานอุปกรณ์ต้องรองรับตัวแปลงสัญญาณมัลติมีเดียต่อไปนี้ ตัวแปลงสัญญาณทั้งหมดนี้มีไว้เป็นซอฟต์แวร์ในการใช้งาน Android ที่ต้องการจาก Android Open Source Project
โปรดทราบว่าทั้ง Google และ Open Handset Alliance ไม่ได้รับรองใดๆ ว่าตัวแปลงสัญญาณเหล่านี้ไม่มีภาระผูกพันจากสิทธิบัตรของบุคคลที่สาม ผู้ที่ต้องการใช้ซอร์สโค้ดนี้ในผลิตภัณฑ์ฮาร์ดแวร์หรือซอฟต์แวร์ควรทราบว่าการนำโค้ดนี้ไปใช้ รวมถึงในซอฟต์แวร์โอเพ่นซอร์สหรือแชร์แวร์ อาจต้องมีการอนุญาตสิทธิบัตรจากผู้ถือสิทธิบัตรที่เกี่ยวข้อง
Note that the table above does not list specific bitrate requirements for most video codecs. The reason for this is that in practice, current device hardware does not necessarily support bitrates that map exactly to the required bitrates specified by the relevant standards. Instead, device implementations SHOULD support the highest bitrate practical on the hardware, up to the limits defined by the specifications.
7. Developer Tool Compatibility
Device implementations MUST support the Android Developer Tools provided in the Android SDK. Specifically, Android-compatible devices MUST be compatible with:
- Android Debug Bridge (known as adb) [ Resources, 19 ]
Device implementations MUST support alladb
functions as documented in the Android SDK. The device-sideadb
daemon SHOULD be inactive by default, but there MUST be a user-accessible mechanism to turn on the Android Debug Bridge. - Dalvik Debug Monitor Service (known as ddms) [ Resources, 19 ]
Device implementations MUST support allddms
features as documented in the Android SDK. Asddms
usesadb
, support forddms
SHOULD be inactive by default, but MUST be supported whenever the user has activated the Android Debug Bridge, as above. - Monkey [ Resources, 22 ]
Device implementations MUST include the Monkey framework, and make it available for applications to use.
8. Hardware Compatibility
Android is intended to support device implementers creating innovative form factors and configurations. At the same time Android developers expect certain hardware, sensors and APIs across all Android device. This section lists the hardware features that all Android 2.1 compatible devices must support.
If a device includes a particular hardware component that has a corresponding API for third-party developers, the device implementation MUST implement that API as defined in the Android SDK documentation. If an API in the SDK interacts with a hardware component that is stated to be optional and the device implementation does not possess that component:
- class definitions for the component's APIs MUST be present
- the API's behaviors MUST be implemented as no-ops in some reasonable fashion
- API methods MUST return null values where permitted by the SDK documentation
- API methods MUST return no-op implementations of classes where null values are not permitted by the SDK documentation
A typical example of a scenario where these requirements apply is the telephony API: even on non-phone devices, these APIs must be implemented as reasonable no-ops.
Device implementations MUST accurate report accurate hardware configuration information via the getSystemAvailableFeatures()
and hasSystemFeature(String)
methods on the android.content.pm.PackageManager
class.
8.1. Display
Android 2.1 includes facilities that perform certain automatic scaling and transformation operations under some circumstances, to ensure that third-party applications run reasonably well on a variety of hardware configurations [ Resources, 23 ]. Devices MUST properly implement these behaviors, as detailed in this section.
For Android 2.1, this are the most common display configurations:
Device implementations corresponding to one of the standard configurations above MUST be configured to report the indicated screen size to applications via the android.content.res.Configuration
[ Resources, 24 ] class.
Some .apk packages have manifests that do not identify them as supporting a specific density range. When running such applications, the following constraints apply:
- Device implementations MUST interpret resources in a .apk that lack a density qualifier as defaulting to "medium" (known as "mdpi" in the SDK documentation.)
- When operating on a "low" density screen, device implementations MUST scale down medium/mdpi assets by a factor of 0.75.
- When operating on a "high" density screen, device implementations MUST scale up medium/mdpi assets by a factor of 1.5.
- Device implementations MUST NOT scale assets within a density range, and MUST scale assets by exactly these factors between density ranges.
8.1.2. Non-Standard Display Configurations
Display configurations that do not match one of the standard configurations listed in Section 8.1.1 require additional consideration and work to be compatible. Device implementers MUST contact Android Compatibility Team as provided for in Section 12 to obtain classifications for screen-size bucket, density, and scaling factor. When provided with this information, device implementations MUST implement them as specified.
Note that some display configurations (such as very large or very small screens, and some aspect ratios) are fundamentally incompatible with Android 2.1; therefore device implementers are encouraged to contact Android Compatibility Team as early as possible in the development process.
8.1.3. Display Metrics
Device implementations MUST report correct valuesfor all display metrics defined in android.util.DisplayMetrics
[ Resources, 25 ].
8.2. Keyboard
- MUST include support for the Input Management Framework (which allows third party developers to create Input Management Engines -- ie soft keyboard) as detailed at developer.android.com
- MUST provide at least one soft keyboard implementation (regardless of whether a hard keyboard is present)
- MAY include additional soft keyboard implementations
- MAY include a hardware keyboard
- MUST NOT include a hardware keyboard that does not match one of the formats specified in
android.content.res.Configuration.keyboard
[ Resources, 24 ] (that is, QWERTY, or 12-key)
8.3. Non-touch Navigation
- MAY omit a non-touch navigation options (that is, may omit a trackball, d-pad, or wheel)
- MUST report the correct value for
android.content.res.Configuration.navigation
[ Resources, 24 ]
8.4. Screen Orientation
Compatible devices MUST support dynamic orientation by applications to either portrait or landscape screen orientation. That is, the device must respect the application's request for a specific screen orientation. Device implementations MAY select either portrait or landscape orientation as the default.
Devices MUST report the correct value for the device's current orientation, whenever queried via the android.content.res.Configuration.orientation, android.view.Display.getOrientation(), or other APIs.
8.5. Touchscreen input
- MUST have a touchscreen
- MAY have either capacative or resistive touchscreen
- MUST report the value of
android.content.res.Configuration
[ Resources, 24 ] reflecting corresponding to the type of the specific touchscreen on the device
8.6. USB
- MUST implement a USB client, connectable to a USB host with a standard USB-A port
- MUST implement the Android Debug Bridge over USB (as described in Section 7)
- MUST implement the USB mass storage specification, to allow a host connected to the device to access the contents of the /sdcard volume
- SHOULD use the micro USB form factor on the device side
- MAY include a non-standard port on the device side, but if so MUST ship with a cable capable of connecting the custom pinout to standard USB-A port
8.7. Navigation keys
The Home, Menu and Back functions are essential to the Android navigation paradigm. Device implementations MUST make these functions available to the user at all times, regardless of application state. These functions SHOULD be implemented via dedicated buttons. They MAY be implemented using software, gestures, touch panel, etc., but if so they MUST be always accessible and not obscure or interfere with the available application display area.
Device implementers SHOULD also provide a dedicated search key. Device implementers MAY also provide send and end keys for phone calls.
8.8. Wireless Data Networking
Device implementations MUST include support for wireless high-speed data networking. Specifically, device implementations MUST include support for at least one wireless data standard capable of 200Kbit/sec or greater. Examples of technologies that satisfy this requirement include EDGE, HSPA, EV-DO, 802.11g, etc.
If a device implementation includes a particular modality for which the Android SDK includes an API (that is, WiFi, GSM, or CDMA), the implementation MUST support the API.
Devices MAY implement more than one form of wireless data connectivity. Devices MAY implement wired data connectivity (such as Ethernet), but MUST nonetheless include at least one form of wireless connectivity, as above.
8.9. Camera
Device implementations MUST include a camera. The included camera:
- MUST have a resolution of at least 2 megapixels
- SHOULD have either hardware auto-focus, or software auto-focus implemented in the camera driver (transparent to application software)
- MAY have fixed-focus or EDOF (extended depth of field) hardware
- MAY include a flash. If the Camera includes a flash, the flash lamp MUST NOT be lit while an android.hardware.Camera.PreviewCallback instance has been registered on a Camera preview surface, unless the application has explicitly enabled the flash by enabling the
FLASH_MODE_AUTO
orFLASH_MODE_ON
attributes of aCamera.Parameters
object. Note that this constraint does not apply to the device's built-in system camera application, but only to third-party applications usingCamera.PreviewCallback
.
Device implementations MUST implement the following behaviors for the camera-related APIs:
- If an application has never called android.hardware.Camera.Parameters.setPreviewFormat(int), then the device MUST use android.hardware.PixelFormat.YCbCr_420_SP for preview data provided to application callbacks.
- If an application registers an android.hardware.Camera.PreviewCallback instance and the system calls the onPreviewFrame() method when the preview format is YCbCr_420_SP, the data in the byte[] passed into onPreviewFrame() must further be in the NV21 encoding format. (This is the format used natively by the 7k hardware family.) That is, NV21 MUST be the default.
Device implementations MUST implement the full Camera API included in the Android 2.1 SDK documentation [ Resources, 26 ]), regardless of whether the device includes hardware autofocus or other capabilities. For instance, cameras that lack autofocus MUST still call any registered android.hardware.Camera.AutoFocusCallback
instances (even though this has no relevance to a non-autofocus camera.)
Device implementations MUST recognize and honor each parameter name defined as a constant on the android.hardware.Camera.Parameters
class, if the underlying hardware supports the feature. If the device hardware does not support a feature, the API must behave as documented. Conversely, Device implementations MUST NOT honor or recognize string constants passed to the android.hardware.Camera.setParameters()
method other than those documented as constants on the android.hardware.Camera.Parameters
, unless the constants are prefixed with a string indicating the name of the device implementer. That is, device implementations MUST support all standard Camera parameters if the hardware allows, and MUST NOT support custom Camera parameter types unless the parameter names are clearly indicated via a string prefix to be non-standard.
8.10. Accelerometer
Device implementations MUST include a 3-axis accelerometer and MUST be able to deliver events at 50 Hz or greater. The coordinate system used by the accelerometer MUST comply with the Android sensor coordinate system as detailed in the Android APIs (see [ Resources, 27 ]).
8.11. Compass
Device implementations MUST include a 3-axis compass and MUST be able to deliver events 10 Hz or greater. The coordinate system used by the compass MUST comply with the Android sensor coordinate system as defined in the Android API (see [ Resources, 27 ]).
8.12. GPS
Device implementations MUST include a GPS, and SHOULD include some form of "assisted GPS" technique to minimize GPS lock-on time.
8.13. Telephony
Android 2.1 MAY be used on devices that do not include telephony hardware. That is, Android 2.1 is compatible with devices that are not phones. However, if a device implementation does include GSM or CDMA telephony, it MUST implement the full support for the API for that technology. Device implementations that do not include telephony hardware MUST implement the full APIs as no-ops.
See also Section 8.8, Wireless Data Networking.
8.14. Memory and Storage
Device implementations MUST have at least 92MB of memory available to the kernel and userspace. The 92MB MUST be in addition to any memory dedicated to hardware components such as radio, memory, and so on that is not under the kernel's control.
Device implementations MUST have at least 150MB of non-volatile storage available for user data. That is, the /data
partition must be at least 150MB.
8.15. Application Shared Storage
Device implementations MUST offer shared storage for applications. The shared storage provided MUST be at least 2GB in size.
Device implementations MUST be configured with shared storage mounted by default, "out of the box". If the shared storage is not mounted on the Linux path /sdcard
, then the device MUST include a Linux symbolic link from /sdcard
to the actual mount point.
Device implementations MUST enforce as documented the android.permission.WRITE_EXTERNAL_STORAGE
permission on this shared storage. Shared storage MUST otherwise be writable by any application that obtains that permission.
Device implementations MAY have hardware for user-accessible removable storage, such as a Secure Digital card. Alternatively, device implementations MAY allocate internal (non-removable) storage as shared storage for apps.
Regardless of the form of shared storage used, the shared storage MUST implement USB mass storage, as described in Section 8.6. As shipped out of the box, the shared storage MUST be mounted with the FAT filesystem.
It is illustrative to consider two common examples. If a device implementation includes an SD card slot to satisfy the shared storage requirement, a FAT-formatted SD card 2GB in size or larger MUST be included with the device as sold to users, and MUST be mounted by default. Alternatively, if a device implementation uses internal fixed storage to satisfy this requirement, that storage MUST be 2GB in size or larger and mounted on /sdcard
(or /sdcard
MUST be a symbolic link to the physical location if it is mounted elsewhere.)
8.16. Bluetooth
Device implementations MUST include a Bluetooth transceiver. Device implementations MUST enable the RFCOMM-based Bluetooth API as described in the SDK documentation [ Resources, 29 ]. Device implementations SHOULD implement relevant Bluetooth profiles, such as A2DP, AVRCP, OBEX, etc. as appropriate for the device.
9. Performance Compatibility
One of the goals of the Android Compatibility Program is to enable consistent application experience to consumers. Compatible implementations must ensure not only that applications simply run correctly on the device, but that they do so with reasonable performance and overall good user experience. Device implementations MUST meet the key performance metrics of an Android 2.1 compatible device defined in the table below:
10. Security Model Compatibility
Device implementations MUST implement a security model consistent with the Android platform security model as defined in Security and Permissions reference document in the APIs [ Resources, 28 ] in the Android developer documentation. Device implementations MUST support installation of self-signed applications without requiring any additional permissions/certificates from any third parties/authorities. Specifically, compatible devices MUST support the security mechanisms described in the follow sub-sections.
10.1. Permissions
Device implementations MUST support the Android permissions model as defined in the Android developer documentation [ Resources, 28 ]. Specifically, implementations MUST enforce each permission defined as described in the SDK documentation; no permissions may be omitted, altered, or ignored. Implementations MAY add additional permissions, provided the new permission ID strings are not in the android.* namespace.
10.2. UID and Process Isolation
Device implementations MUST support the Android application sandbox model, in which each application runs as a unique Unix-style UID and in a separate process. Device implementations MUST support running multiple applications as the same Linux user ID, provided that the applications are properly signed and constructed, as defined in the Security and Permissions reference [ Resources, 28 ].
10.3. Filesystem Permissions
Device implementations MUST support the Android file access permissions model as defined in as defined in the Security and Permissions reference [ Resources, 28 ].
11. Compatibility Test Suite
Device implementations MUST pass the Android Compatibility Test Suite (CTS) [ Resources, 2 ] available from the Android Open Source Project, using the final shipping software on the device. Additionally, device implementers SHOULD use the reference implementation in the Android Open Source tree as much as possible, and MUST ensure compatibility in cases of ambiguity in CTS and for any reimplementations of parts of the reference source code.
The CTS is designed to be run on an actual device. Like any software, the CTS may itself contain bugs. The CTS will be versioned independently of this Compatibility Definition, and multiple revisions of the CTS may be released for Android 2.1. Device implementations MUST pass the latest CTS version available at the time the device software is completed.
12. Updatable Software
Device implementations MUST include a mechanism to replace the entirety of the system software. The mechanism need not perform "live" upgrades -- that is, a device restart MAY be required.
Any method can be used, provided that it can replace the entirety of the software preinstalled on the device. For instance, any of the following approaches will satisfy this requirement:
- Over-the-air (OTA) downloads with offline update via reboot
- "Tethered" updates over USB from a host PC
- "Offline" updates via a reboot and update from a file on removable storage
The update mechanism used MUST support updates without wiping user data. Note that the upstream Android software includes an update mechanism that satisfies this requirement.
If an error is found in a device implementation after it has been released but within its reasonable product lifetime that is determined in consultation with the Android Compatibility Team to affect the compatibility of thid-party applications, the device implementer MUST correct the error via a software update available that can be applied per the mechanism just described.
13. Contact Us
You can contact the document authors at compatibility@android.com for clarifications and to bring up any issues that you think the document does not cover.