{"id":19317601,"url":"https://github.com/queeniecplusplus/react_batteryapp","last_synced_at":"2026-04-30T12:32:50.250Z","repository":{"id":38862398,"uuid":"281091762","full_name":"QueenieCplusplus/React_batteryApp","owner":"QueenieCplusplus","description":null,"archived":false,"fork":false,"pushed_at":"2023-01-26T22:04:28.000Z","size":1668,"stargazers_count":0,"open_issues_count":13,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-24T04:44:29.412Z","etag":null,"topics":["expo","react-native"],"latest_commit_sha":null,"homepage":"https://github.com/QueenieCplusplus/QuickGoThru#react--react-native","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/QueenieCplusplus.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-07-20T10:57:15.000Z","updated_at":"2020-07-20T11:00:32.000Z","dependencies_parsed_at":"2023-02-15T01:31:48.401Z","dependency_job_id":null,"html_url":"https://github.com/QueenieCplusplus/React_batteryApp","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/QueenieCplusplus/React_batteryApp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QueenieCplusplus%2FReact_batteryApp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QueenieCplusplus%2FReact_batteryApp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QueenieCplusplus%2FReact_batteryApp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QueenieCplusplus%2FReact_batteryApp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/QueenieCplusplus","download_url":"https://codeload.github.com/QueenieCplusplus/React_batteryApp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QueenieCplusplus%2FReact_batteryApp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32465009,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T22:27:22.272Z","status":"online","status_checked_at":"2026-04-30T02:00:05.929Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["expo","react-native"],"created_at":"2024-11-10T01:15:38.867Z","updated_at":"2026-04-30T12:32:50.235Z","avatar_url":"https://github.com/QueenieCplusplus.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# React_batteryApp\n\n# CodeFile\n\n    import * as React from 'react';\n    // expo install expo-battery\n    import * as Battery from 'expo-battery';\n    import {Text, View } from 'react-native';\n\n    export default class App extends React.Component {\n      state = {\n        batteryLevel: null,\n      };\n\n      componentDidMount() {\n        this.subscribe();\n      }\n\n      componentWillUnmount() {\n        this.unsubscribe();\n      }\n\n      async subscribe() {\n\n        const batteryLevel = await Battery.getBatteryLevelAsync();\n        this.setState({ batteryLevel });\n\n        this.subscription = Battery.addBatteryLevelListener(({ batteryLevel }) =\u003e {\n        \n          this.setState({ batteryLevel });\n          \n          //console.log('batteryLevel changed!', batteryLevel);\n          \n        });\n\n      }\n\n      unsubscribe() {\n\n        this.subscription \u0026\u0026 this.subscription.remove();\n        this.subscription = null;\n\n      }\n\n      render() {\n        return (\n          \u003cView\u003e\n            \u003cText\u003eCurrent Battery Level: {this.state.batteryLevel}\u003c/Text\u003e\n          \u003c/View\u003e\n        );\n      }\n    }\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqueeniecplusplus%2Freact_batteryapp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqueeniecplusplus%2Freact_batteryapp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqueeniecplusplus%2Freact_batteryapp/lists"}