About sensors and location
Stay organized with collections
Save and categorize content based on your preferences.
Android-powered devices have sensors that let you provide users with contextual
information about their surroundings, including location awareness, motion,
position, and qualities of the physical environment.
To provide a much richer, more more context-specific experience for users, use
Android APIs that take advantage of the following types of sensors:
Use GPS to add location awareness to your app with automated location
tracking, wrong-side-of-the-street detection, geofencing, activity
recognition, and more.
Use motion sensors to measure acceleration forces and rotational forces
along three axes. This category includes accelerometers, gravity sensors,
gyroscopes, and rotational vector sensors.
Use position sensors to measure the physical position of a device. This
category includes orientation sensors and magnetometers.
Use environmental sensors to measure various environmental parameters,
such as ambient air temperature and pressure, illumination, and humidity.
This category includes barometers, photometers, and thermometers.
Videos
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2023-11-01 UTC.
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"Missing the information I need"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"Too complicated / too many steps"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"Out of date"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"Samples / code issue"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Other"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Easy to understand"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Solved my problem"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Other"
}]
{"lastModified": "Last updated 2023-11-01 UTC."}
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2023-11-01 UTC."]]