Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

Awesome Lists containing this project

README

        




vscode-expo


Office Marathon


An example app for background location tracking in Expo




license


Android Play store


demo



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