https://github.com/root-app/root-drive-science-rn-demo
React Native Demo for the Root Drive Science SDK
https://github.com/root-app/root-drive-science-rn-demo
Last synced: 9 months ago
JSON representation
React Native Demo for the Root Drive Science SDK
- Host: GitHub
- URL: https://github.com/root-app/root-drive-science-rn-demo
- Owner: Root-App
- Created: 2019-11-06T21:25:00.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-07-19T01:18:53.000Z (almost 3 years ago)
- Last Synced: 2024-04-15T01:12:04.032Z (about 2 years ago)
- Language: Java
- Homepage:
- Size: 1.87 MB
- Stars: 0
- Watchers: 47
- Forks: 0
- Open Issues: 20
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Root Drive Science React Native Demo
This application is a demonstration of how to integrate a React Native
application with Root's Drive Science SDK for iOS and Android.
For full information on how to integrate your system please see the
integration docs at
## Requirements
* This version of the Root SDK requires React Native 0.61.
* On iOS, we expect that you are using Xcode 11.4.x and building for
iOS 10.0 and up.
* On Android we expect that you are building for Android 5.0
(Lollipop) and up.
## Running the App
Install the following (assuming macOS)
* node (`brew install node`)
* yarn (`brew install yarn`)
* watchman (`brew install watchman`)
### iOS
#### Prerequisites
Ensure that the following are installed on your macOS system:
* Xcode 11.4.x
(Install via the Mac App Store or using )
* Cocoapods
(`sudo gem install cocoapods` if you are using the Apple system Ruby,
if you have installed your own Ruby version, probably just
`gem install coocapods`)
Within Xcode:
* Ensure the Xcode command line tools are installed by opening Xcode, heading
to "Preferences", going to the "Locations" panel and selecting the most
recent version of the command line tools.
* In the same "Preferences" panel, go to "Components", and select a simulator.
#### Running
From the command line of the project directory
* `$ cd DriveScienceDemo`
* `$ yarn install`
* `$ cd ios && pod install && cd ..`
* `$ react-native run-ios`
The app should load in a simulator (the first build will take a few minutes).
You can specify a different simulator device with the `--simulator` flag, as
in `react-native run-ios --simulator="iPhone X"`.
You can open the app in Xcode by opening the file
`DriveScienceDemo/ios/DriveScienceDemo.xcworkspace`
If you want to run the app on a physical device, check out the instructions at
.
### Android
#### Prerequisites
Ensure that the following are installed on your system
This assumes macOS, for other operating systems, see
.
* Android Studio 3.5.x
* Android 5.0 SDK (version 21, accessible from Android Studio via Tools -> SDK Manager)
* Install a JDK 8 or newer. The react native docs recommend
`brew tap AdoptOpenJDK/openjdk && brew cask install adoptopenjdk8`
Instructions on setting up Android Studio can be found at
You will need to install Android SDK 5.0 in the Android studio SDK manager
to run the Android app.
* `$ cd DriveScienceDemo`
* `$ yarn install`
* `$ react-native run-android`
## Using the App
Pressing the "Start Tracking" button will contact a (non-production) Root
server and start tracking keyed to this device. Pressing "Stop Tracking" will
end the tracking. A few events will be logged to the screen. The "copy log"
button copies those logs to the system clipboard for diagnostic purposes.
## Develop the iOS App with local RootTripTracker pod changes
```
cd DriveScienceDemo && yarn run ios-local
```