Home Assignment 3
In this assignment, your task is to convert an existing simple image processing application so that it can utilize the cloud for processing instead. The original Android application does all of its processing locally. It uses a static image resource as its input.
Your job is to create & deploy a Heroku HTTP webserver app which can handle requests containing images and respond with processed images. Once you have your Heroku app up & running, you should modify your Android application to allow using the Heroku app for the image processing instead of the original local behaviour.
- The app should allow the user to select the image to be processed from their phones storage/galleries using Intents (2.5 pts)
- Sending the image from your Android app to your Heroku app using a HTTP POST request (5 pts)
- The Heroku server should handle the POST request and obtain the image from the request (5 pts)
- Processing the image (you can use blur or another effect from the library) (2.5 pts)
- Replying to the HTTP POST request with the processed image file (5 pts)
- Handling Heroku app's response inside the Android app (5 pts)
The base code for the heroku web app is here.
In your submission, provide the source code for both the Android app and the Heroku app.
Tips
Heroku quickstart guide:
- Install the Heroku Command Line Interface (CLI)
- In your commandline, login by entering the command:
heroku login
- Fetch our web app skeleton code
- Navigate to the root folder of the webapp, and if it's not initialized as a git repository yet, do so:
git init
git add .
git commit -m "My Commit Message"
- Create a new heroku app with
heroku create <appName>
, replace <appName> with your desired name - Build your webapp with
gradlew stage
- This command is run by Heroku whenever you deploy a new version of your app to Heroku
- To run your Heroku webapp locally:
heroku local
(Unix)heroku local -f Procfile.windows
(Windows)
- To deploy your app to the Heroku cloud, use
git push heroku master
- To open your deployed app in the browser, you can use
heroku open
Working with HTTP
To verify the behaviour of your server, you can use a HTTP request client. One simple-to-use example is the RestMan Chrome extension . Other options for this include PostMan or the curl command-line tool.
Image processing
We are relying on the following image filtering library:
http://www.jhlabs.com/ip/filters/ (MavenRepository).
- Don't forget to add this library as a dependency in your Heroku app. The Android app uses an Android port of this library, so there are some slight differences between the original library and the Android port.
Feel free to create additional assumptions, modifications or restrictions for your solution, but make sure to document them! (e.g. by mentioning in submission comment field)