AguaClara / post.visualize-DEPRECATED-IN-FAVOR-OF-POST.VISUALIZE.ANGULAR

Visualization Application for the Plant Operations Smartphone Tracker (POST) team of AguaClara
MIT License
0 stars 0 forks source link

post.visualizations

Visualization app for the Plant Operations Smartphone Tracker (POST) team of AguaClara. This app is used by AguaClara plant operators to visualize their plant performance data submitted with the post.collect application.

Developing

We use both Jekyll and Cordova to build a web app that we can send to the Playstore here. To start developing the applications, you will need to:

To verify all the tools are working, after you git clone the repo and cd into the first directory, you should be able to serve the website locally as mentioned below and run the app on the emulator or a connected phone.

Serving the app locally using Jekyll

Jekyll enables us to reduce code duplication by using include statements and layouts, and organizes our website/app structure. Jekyll reads the _config.yml document located in the root of the repo to determine which folder jekyll uses as source to build the website. Jekyll builds the resulting website in the specified destination folder (the www folder). Therefore only files in the "source" folder should be edited, whereas editing a file in the "www" folder will just get overwritten the next time Jekyll is ran to build the static site. Once you are done editing a source file, you can test the code by running $jekyll serve to start a server on your localhost (you must have Jekyll installed locally for this to work). Once satisfied, you can build the apk using the cordova command line tool with the following command: cordova build android. That will generate a development apk.

Running in the Android emulator

You can run the app in the Android emulator with this comand: cordova run android. By default, your emulator will run extremely slowly. We recommend installing the Intel x_86 system image to get 10x better performance using this guide.

Generating a signed APK

You should just need to run cordova build android --release and Cordova will build an unsigned APK and put it in platforms\android\build\outputs\apk. The path to the un-signed apk will show up in the terminal (may be different). If you're recieving an error, you can add the -d flag to see why. Now you need to sign your app. You should follow this guide (step 5) for signing. Long story short: jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore $KEYSTORENAME $UNSIGNED_APK_PATH $KEYSTORE_ALIAS Find the keystore and keystore password and alias in the drive Passwords/Certs folder.

Upload apk

Adding plugins or platforms

We don't save the platforms and plugins file to github, and therefore we need to save a state of supported platforms and plugins to the config file of Cordova. This can be done by running $cordova platform save and $cordova plugin save. Now the updated state is saved in the config.xml file.