The goal of this example is to demonstrate the tradeoffs found in the mobile + cloud architecture, where one has a choice between doing work locally (on the mobile device) versus remotely (in the cloud) with different performance considerations in each case.
This is a very rough initial attempt and still needs significant work.
- Show how CPU-intensive computation can be off-loaded from a mobile app to the cloud, by comparison to a mobile device, an unlimited resource for computation and storage.
- synchronous local foreground tasks in Android (running directly in an event listener)
- asynchronous local background tasks in Android using AsyncTask
- asynchronous access of remote resources (usually RESTful web services) in Android using AsyncHttpClient
See also the corresponding web service.
Check out the project using Android Studio. This creates the local.properties
file
with the required line
sdk.dir=<root folder of Android Studio's Android SDK installation>
In Android Studio: Run > Run app
The underlying links invoke the corresponding web service on the number.
Do not use this AsyncHttpClient in Android.
It will throw the infamous android.os.NetworkOnMainThreadException
without explicit configuration
and has an unnecessary dependency on non-Android logging (slf4j).