Skip to main content
Glama
battery.md896 B
--- title: Battery description: A library that provides battery information for the physical device, as well as corresponding event listeners. sourceCodeUrl: https://github.com/expo/expo/tree/sdk-53/packages/expo-battery packageName: expo-battery iconUrl: /static/images/packages/expo-battery.png platforms: ["android", "ios*", "web"] --- `expo-battery` provides battery information for the physical device (such as battery level, whether or not the device is charging, and more) as well as corresponding event listeners. ## Installation ## Usage ```jsx const batteryLevel = useBatteryLevel(); return ( <View style={styles.container}> <Text>Current Battery Level: {batteryLevel}</Text> </View> ); } const styles = StyleSheet.create({ container: { flex: 1, marginTop: 15, alignItems: 'center', justifyContent: 'center', }, }); ``` ## API ```js ```

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/jaksm/expo-docs-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server