Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lxsameer/react-native-geolocation-android
Geolocation module for android
https://github.com/lxsameer/react-native-geolocation-android
Last synced: about 1 month ago
JSON representation
Geolocation module for android
- Host: GitHub
- URL: https://github.com/lxsameer/react-native-geolocation-android
- Owner: lxsameer
- Created: 2015-11-10T14:57:51.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2015-12-23T07:16:19.000Z (about 9 years ago)
- Last Synced: 2024-11-17T18:10:01.309Z (about 2 months ago)
- Language: Java
- Size: 8.79 KB
- Stars: 4
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-react-native - react-native-geolocation-android ★3 - Geolocation module for react native android (Components / Geolocation)
- awesome-react-native - react-native-geolocation-android ★3 - Geolocation module for react native android (Components / Geolocation)
- awesome-react-native - react-native-geolocation-android ★3 - Geolocation module for react native android (Components / Geolocation)
- awesome-react-native - react-native-geolocation-android ★3 - Geolocation module for react native android (Components / Geolocation)
- awesome-react-native-ui - react-native-geolocation-android ★3 - Geolocation module for react native android (Components / System)
README
# react-native-geolocation-android
Simple React Native Android module to use Android's geo location inside your app.
This module will be useful until the official RN support aren't released.### Installation
```bash
npm install react-native-geolocation-android --save
```### Add it to your android project
* In `android/setting.gradle`
```gradle
...
include ':GeoLocation', ':app'
project(':GeoLocation').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-geolocation-android')
```* In `android/app/build.gradle`
```gradle
...
dependencies {
...
compile project(':GeoLocation')
}
```* Register Module (in MainActivity.java)
```java
import com.lxsameer.geolocation.ReacLocation; // <--- importpublic class MainActivity extends Activity implements DefaultHardwareBackBtnHandler {
......@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mReactRootView = new ReactRootView(this);mReactInstanceManager = ReactInstanceManager.builder()
.setApplication(getApplication())
.setBundleAssetName("index.android.bundle")
.setJSMainModuleName("index.android")
.addPackage(new MainReactPackage())
.addPackage(new ReactLocation()) // <------ add this line to yout MainActivity class
.setUseDeveloperSupport(BuildConfig.DEBUG)
.setInitialLifecycleState(LifecycleState.RESUMED)
.build();mReactRootView.startReactApplication(mReactInstanceManager, "AndroidRNSample", null);
setContentView(mReactRootView);
}......
}
```## License
LGPLv2.1