LoyolaChicagoCode / primenumbers-android-java

0 stars 2 forks source link

1# Background

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.

Learning Objectives

See also the corresponding web service.

Setting up the Environment

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>

Running the Application

In Android Studio: Run > Run app

Sample prime numbers to try

The underlying links invoke the corresponding web service on the number.

A Tale of Two AsyncHttpClients

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).

References