เกี่ยวกับเซ็นเซอร์และสถานที่ตั้ง
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
อุปกรณ์ที่ใช้ Android มีเซ็นเซอร์ที่ช่วยให้คุณให้ข้อมูลตามบริบทแก่ผู้ใช้เกี่ยวกับสภาพแวดล้อมรอบตัว รวมถึงการรับรู้ตำแหน่ง การเคลื่อนไหว ตำแหน่ง และคุณภาพของสภาพแวดล้อมทางกายภาพ
หากต้องการมอบประสบการณ์การใช้งานที่สมบูรณ์ยิ่งขึ้นและเจาะจงตามบริบทมากขึ้นแก่ผู้ใช้ ให้ใช้
Android API ที่ใช้ประโยชน์จากเซ็นเซอร์ประเภทต่อไปนี้
ใช้ GPS เพื่อเพิ่มการรับรู้ตำแหน่งลงในแอปด้วยการติดตามตำแหน่งอัตโนมัติ
การตรวจหาการขับรถผิดฝั่งถนน รั้วภูมิศาสตร์ การจดจำกิจกรรม
และอื่นๆ
ใช้เซ็นเซอร์ตรวจจับความเคลื่อนไหวเพื่อวัดแรงเร่งและแรงหมุน
ตามแกนทั้ง 3 หมวดหมู่นี้ประกอบด้วยตัวตรวจวัดความเร่ง เซ็นเซอร์แรงโน้มถ่วง
เครื่องวัดการหมุน และเซ็นเซอร์เวกเตอร์การหมุน
ใช้เซ็นเซอร์ตำแหน่งเพื่อวัดตำแหน่งทางกายภาพของอุปกรณ์ หมวดหมู่นี้รวมถึงเซ็นเซอร์การวางแนวและแมกนีโตมิเตอร์
ใช้เซ็นเซอร์ตรวจจับสภาพแวดล้อมเพื่อวัดพารามิเตอร์ด้านสิ่งแวดล้อมต่างๆ
เช่น อุณหภูมิและความดันอากาศโดยรอบ ความสว่าง และความชื้น
หมวดหมู่นี้รวมถึงบารอมิเตอร์ โฟโตมิเตอร์ และเทอร์โมมิเตอร์
วิดีโอ
ตัวอย่างเนื้อหาและโค้ดในหน้าเว็บนี้ขึ้นอยู่กับใบอนุญาตที่อธิบายไว้ในใบอนุญาตการใช้เนื้อหา Java และ OpenJDK เป็นเครื่องหมายการค้าหรือเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-27 UTC
[[["เข้าใจง่าย","easyToUnderstand","thumb-up"],["แก้ปัญหาของฉันได้","solvedMyProblem","thumb-up"],["อื่นๆ","otherUp","thumb-up"]],[["ไม่มีข้อมูลที่ฉันต้องการ","missingTheInformationINeed","thumb-down"],["ซับซ้อนเกินไป/มีหลายขั้นตอนมากเกินไป","tooComplicatedTooManySteps","thumb-down"],["ล้าสมัย","outOfDate","thumb-down"],["ปัญหาเกี่ยวกับการแปล","translationIssue","thumb-down"],["ตัวอย่าง/ปัญหาเกี่ยวกับโค้ด","samplesCodeIssue","thumb-down"],["อื่นๆ","otherDown","thumb-down"]],["อัปเดตล่าสุด 2025-07-27 UTC"],[],[],null,["# About sensors and location\n\nAndroid-powered devices have sensors that let you provide users with contextual\ninformation about their surroundings, including location awareness, motion,\nposition, and qualities of the physical environment.\n\nTo provide a much richer, more more context-specific experience for users, use\nAndroid APIs that take advantage of the following types of sensors:\n\n- Use [GPS](/develop/sensors-and-location/location) to add location awareness to your app with automated location\n tracking, wrong-side-of-the-street detection, geofencing, activity\n recognition, and more.\n\n- Use [motion sensors](/develop/sensors-and-location/sensors/sensors_motion) to measure acceleration forces and rotational forces\n along three axes. This category includes accelerometers, gravity sensors,\n gyroscopes, and rotational vector sensors.\n\n- Use [position sensors](/develop/sensors-and-location/sensors/sensors_position) to measure the physical position of a device. This\n category includes orientation sensors and magnetometers.\n\n- Use [environmental sensors](/develop/sensors-and-location/sensors/sensors_environment) to measure various environmental parameters,\n such as ambient air temperature and pressure, illumination, and humidity.\n This category includes barometers, photometers, and thermometers.\n\nVideos\n------"]]