Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/byCedric/office-marathon
Example app for background location tracking in Expo
https://github.com/byCedric/office-marathon
Last synced: 3 months ago
JSON representation
Example app for background location tracking in Expo
- Host: GitHub
- URL: https://github.com/byCedric/office-marathon
- Owner: byCedric
- License: mit
- Created: 2020-12-22T16:39:28.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-01-17T20:36:50.000Z (10 months ago)
- Last Synced: 2024-06-30T16:51:38.065Z (5 months ago)
- Language: TypeScript
- Size: 1.03 MB
- Stars: 59
- Watchers: 2
- Forks: 14
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
Office Marathon
An example app for background location tracking in Expo
Structure
βββ
How to use it
This demo app is a simple example of how to use background location tracking on Android. With this app, you can measure your total distance traveled within the office or your home.
## π Structure
- [`app`](./src/app.tsx) - is our entrypoint for the app, combining all providers.
### Providers
- [`providers/asset`](./src/providers/asset.tsx) - loads the custom font, using [Expo Google Fonts](https://github.com/expo/google-fonts).
- [`providers/navigation`](./src/providers/navigation.tsx) - sets up our app screens and navigational strucutre, using [React Navigation](https://reactnavigation.org/).
- [`providers/theme`](./src/providers/theme.tsx) - handles some slightly styled components for us, using [Dripsy](https://github.com/nandorojo/dripsy).### Screens
- [`screens/onboarding`](./src/screens/onboarding.tsx) - this is where the app asks the user for background location permissions.
- [`screens/distance`](./src/screens/distance.tsx) - after the permissions are granted, the user can start/stop/reset location tracking and see their distance.### Services
- [`services/location`](./src/services/location/index.ts) - calculates distance between points and wraps the functionality in hooks for easy access.
- [`services/location/storage`](./src/services/location/storage.ts) - simple helpers to store location data in local storage, using [Async Storage](https://github.com/react-native-async-storage/async-storage).
- [`services/location/track`](./src/services/location/track.ts) - simple helpers to manage background location tracking, and the background task itself.## π How to use it
- Clone the repository
- `$ yarn install`
- `$ yarn expo start`
withΒ :heart:Β Β byCedric