{"id":4507,"url":"https://github.com/garysye/react-native-android-geolocation","last_synced_at":"2025-08-04T01:32:34.708Z","repository":{"id":57335216,"uuid":"46293779","full_name":"garysye/react-native-android-geolocation","owner":"garysye","description":"React Native Module to use Android Geolocation via Google Play API","archived":false,"fork":false,"pushed_at":"2015-11-23T17:41:50.000Z","size":122,"stargazers_count":18,"open_issues_count":1,"forks_count":8,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-07-18T21:23:25.063Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","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/garysye.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":"2015-11-16T18:28:24.000Z","updated_at":"2021-08-09T11:50:18.000Z","dependencies_parsed_at":"2022-08-24T20:21:30.617Z","dependency_job_id":null,"html_url":"https://github.com/garysye/react-native-android-geolocation","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/garysye/react-native-android-geolocation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/garysye%2Freact-native-android-geolocation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/garysye%2Freact-native-android-geolocation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/garysye%2Freact-native-android-geolocation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/garysye%2Freact-native-android-geolocation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/garysye","download_url":"https://codeload.github.com/garysye/react-native-android-geolocation/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/garysye%2Freact-native-android-geolocation/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268636403,"owners_count":24282084,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-03T02:00:12.545Z","response_time":2577,"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":[],"created_at":"2024-01-05T20:17:14.687Z","updated_at":"2025-08-04T01:32:34.349Z","avatar_url":"https://github.com/garysye.png","language":"Java","readme":"# react-native-android-geolocation\nReact Native Module to use Android Geolocation via Google Play API\n\n### Installation\n\n```bash\nnpm install --save react-native-android-geolocation\n```\n\n### Add it to your React Native android project\n\n* In `android/setting.gradle`\n\n```gradle\n...\ninclude ':RNAndroidGeolocation', ':app'\nproject(':RNAndroidGeolocation').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-android-geolocation')\n```\n\n* In `android/app/build.gradle`\n\n```gradle\n...\ndependencies {\n    ...\n    compile project(':RNAndroidGeolocation')\n}\n```\n\n* In `MainActivity.java`\n\n```java\nimport com.rnandroidgeolocation.AndroidGeolocationPackage;  // \u003c--- Add import here\n\npublic class MainActivity extends Activity implements DefaultHardwareBackBtnHandler {\n\n    private ReactInstanceManager mReactInstanceManager;\n    private ReactRootView mReactRootView;\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        mReactRootView = new ReactRootView(this);\n\n        mReactInstanceManager = ReactInstanceManager.builder()\n                .setApplication(getApplication())\n                .setBundleAssetName(\"index.android.bundle\")\n                .setJSMainModuleName(\"index.android\")\n                .addPackage(new MainReactPackage())\n                .addPackage(new AndroidGeolocationPackage())  // \u003c--- Add package command here\n                .setUseDeveloperSupport(BuildConfig.DEBUG)\n                .setInitialLifecycleState(LifecycleState.RESUMED)\n                .build();\n\n        mReactRootView.startReactApplication(mReactInstanceManager, \"ChewApp\", null);\n\n        setContentView(mReactRootView);\n    }\n\n  ......\n\n}\n```\n\n### Google Play API Installation\n\nIn case you haven't done it already, you will also need to install the corresponding Google Play SDK. To do this run\n\n```bash\n$ cd /path/to/your/android-sdk/tools\n$ android sdk\n```\n\nand select the Google Play SDK extras as pictured below:\n\n![Google Play SDK Installation](./google-play-installation.png)\n\n\n## Example\n```javascript\nvar AndroidGeolocation = require('react-native-android-geolocation');\n\nAndroidGeolocation.getCurrentLocation(\n  (position) =\u003e this.setState({position: position}),\n  (error) =\u003e this.setState({error: error})\n);\n```\n## License\n\nISC\n","funding_links":[],"categories":["Components","\u003ca name=\"Network:-Native-Modules\"\u003eNetwork: Native Modules\u003c/a\u003e"],"sub_categories":["Geolocation","System"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgarysye%2Freact-native-android-geolocation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgarysye%2Freact-native-android-geolocation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgarysye%2Freact-native-android-geolocation/lists"}