This is a mobile cordova app. This app communicates with a small api, and uses some components of the phone.
The project uses an api available publicaly http://karmajobs.servehttp.com/api
.
- Node >= 7
- npm
- JDK >= 1.8
- Android platform tools
- adb
- gradle
# Clone repo
git clone https://github.com/Grisou13/KarmaJobsCordovaApp.git && cd KarmaJobsCordovaApp
# install global cli utils. *MIGHT REQUIRE SUDO*
npm i -g webpack cordova yarn
# install dependencies
yarn
# Install plateforms
cordova platform add android
# Restore configs
cordova prepare
# build assets
npm run build
# run the cordova app
npm run start
# build app for production
npm run build
# build android apk
cordova build android
an apk should be available in platforms/android/build/outputs/apk/android-debug.apk
Sources can be found in the src directory.
The app is a react-redux app, routed with react-router v4.
To validate storage of the phone, you have 1 easy option.
- Start the app.
- Goto settings
- Change the api url, and click save
- Close the app, (completly, even destroy the activity)
- Reload the app
- Go back to settings
- The setting should have changed and be stored
You can also use the chrome devtools to access local storage. Please refer to the [Api communication (steps 1-5)](#Api communication).
Now in the devtools you can do
localStorage.getItem("api-url")
To check the usage of GPS, you're gonna need to visit the jobs page.
- Start the app
- login in the app
- email: [email protected]
- password: password
- Now all the jobs should say "The job .... IS AT -- km"
Nota: if the map doesn't load, refresh by clicking in menu the jobs
link
That's the weirdest, please make sure you have chrome installed first.
- Start the app
- Start chrome
- Connect your phone to your laptop (usb debugging should be enabled)
- goto
chrome://inspect
and you should see remote devices For more help, visit the chrome remote debugging guide - Now on chrome, open the devtools
f12
and goto thenetwork
tab - Back in the app, goto login (maybe you need to logout first).
- Fill out the form and hit send. This should trigger a network request (visible in chrome devtools)