8. Mobile Application Development with Android

Mobile applications backed by cloud-based RESTful services have emerged as the primary face of computing in terms of massive consumer participation. Jason Christensen described this system architecture in his OOPSLA 2009 presentation. Therefore, not only do we find it important to cover this system architecture in the curriculum, but we also see this architecture as a very effective context for teaching various important computer science topics:

  • (real-world) software architecture
    • dependency inversion principle (DIP)
    • model-view-adapter architectural pattern (MVA)
    • testability
    • etc.
  • concurrent, parallel, and distributed computing topics (PDC/TCPP/EduPar)
    • events
    • timers (one-shot and recurring)
    • background threads
    • offloading tasks to the cloud
  • embedded/resource-conscious computing
    • limitations of the device
    • capabilities of the device (numerous sensors)

Konstantin drew the inspiration to use Android instead of Swing as a context for teaching these topics from the mobile computing session at SIGCSE 2012 in Raleigh.

Furthermore, we have found the cost of switching from, say, Java Swing to Android minimal. Besides, Android matters in the real world: it is a widely used technology, and mobile app development skills are in increasing demand.

While our overall goals are similar to those of the Sofia framework project, we discuss here a language-based approach but are planning to enhance the practice of Android development in Scala through additional support classes.

As mentioned above, current and future focus has been on these courses:

8.1. Tools

There are two sbt plugins for developing Android:

The rapidly evolving topic of developing Android apps in Scala is the subject of this discussion forum:

After some experimentation, we have found pfn’s plugin to be easier to use and have adopted it for our Scala-based Android development.

8.2. Examples

The learning objectives of each example are stated in the example’s readme.

8.3. Lab Assignment

Format
Pair project
Time
10 minutes
Deliverable

An enhancement of this clickcounter app that addresses at least one following additional functional requirements:

Nonfunctional requirements
  • You should update the tests and the rest of the existing code accordingly.
  • You should implement the onSaveInstanceState and onRestoreInstanceState application lifecycle methods (see for details. The system passes this method a Bundle in which you can save state information about the activity as name-value pairs, using methods such as putString() and putInt().