Skip to main content

Managing Concurrency in Mobile User Interfaces with Examples in Android

  • Chapter
  • First Online:

Abstract

In this chapter, we explore various parallel and distributed computing topics from a user-centric software engineering perspective. Specifically, in the context of mobile application development, we study the basic building blocks of interactive applications in the form of events, timers, and asynchronous activities, along with related software modeling, architecture, and design topics.

This is a preview of subscription content, log in via an institution.

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   44.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   59.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info
Hardcover Book
USD   59.99
Price excludes VAT (USA)
  • Durable hardcover edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Notes

  1. 1.

    This topic goes beyond the scope of this chapter but is included in the corresponding example [19].

  2. 2.

    When analyzing race conditions, we might be tempted to enumerate the different possible interleavings. While it seems reasonable for our example, this quickly becomes impractical because of the combinatorial explosion for larger number of threads with more steps.

  3. 3.

    In some frameworks, including Java AWT/Swing, the UI thread is known as event dispatch thread (EDT).

  4. 4.

    A full introduction to the Unified Modeling Language (UML) [29] would go far beyond the scope of this chapter. Therefore, we aim to introduce the key elements of UML needed here in an informal and pragmatic manner. Various UML resources, including the official specification, are available at http://www.uml.org/. Third-party tutorials are available online and in book form.

  5. 5.

    It is also possible—though less practical—to build an Android GUI programmatically.

  6. 6.

    Readers who have worked with GUI framework that supports multiple listeners, such as Swing, might initially find it restrictive of Android to allow only one. We’ll leave it as an exercise to figure out which well-known software design pattern can be used to work around this restriction.

  7. 7.

    More information on JaCoCo the JaCoCo Gradle plugin is available at http://www.eclemma.org/jacoco/ and https://github.com/arturdm/jacoco-android-gradle-plugin, respectively.

  8. 8.

    There are also various mocking frameworks, such as Mockito and JMockit, which can automatically generate mock objects that represent component dependencies from interfaces and provide APIs or domain-specific languages for specifying test expectations.

References

  1. Kevin Ashton. That ’Internet of Things’ thing. RFID Journal, http://www.rfidjournal.com/articles/view?4986, July 2009. Accessed: 2016-12-09.

  2. Kent Beck. Test Driven Development: By Example. Addison-Wesley Professional, 2002.

    Google Scholar 

  3. Google Webmaster Central Blog. Rolling out the mobile-friendly update. https://webmasters.googleblog.com/2015/04/rolling-out-mobile-friendly-update.html, April 2015. Accessed: 2016-12-12.

  4. Stefano Borini. Understanding model-view-controller. https://www.gitbook.com/book/stefanoborini/modelviewcontroller, 2016. Accessed: 2016-12-09.

  5. Jemma Brackebush. How mobile is overtaking desktop for global media consumption, in 5 charts. Digiday, http://digiday.com/publishers/mobile-overtaking-desktops-around-world-5-charts/, June 2016. Accessed: 2016-12-10.

  6. Jason H. Christensen. Using restful web-services and cloud computing to create next generation mobile applications. In Proceedings of the 24th ACM SIGPLAN Conference Companion on Object Oriented Programming Systems Languages and Applications, OOPSLA ‘09, pages 627–634, New York, NY, USA, 2009. ACM.

    Google Scholar 

  7. Thomas W. Christopher and George K. Thiruvathukal. High Performance Java Platform Computing. Prentice Hall PTR, Upper Saddle Ridge, NJ, 2000.

    Google Scholar 

  8. Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides. Design Patterns: Elements of Reusable Object-oriented Software. Addison-Wesley Longman Publishing Co., Inc., Boston, MA, USA, 1995.

    MATH  Google Scholar 

  9. Google. Android developer reference. http://developer.android.com/develop/, 2009–2018. Accessed: 2016-12-09.

  10. Google. Memory consistency properties. https://developer.android.com/reference/java/util/concurrent/package-summary.html#MemoryVisibility, 2009–2018. Accessed: 2016-12-09.

  11. Google. Processes and threads. http://developer.android.com/guide/components/processes-and-threads.html, 2009–2018. Accessed: 2016-12-09.

  12. Google. SMP primer for Android. http://developer.android.com/training/articles/smp.html, 2009–2018. Accessed: 2016-12-09.

  13. Google. Android Studio: Use Java 8 language features. https://developer.android.com/studio/write/java8-support.html#supported_features, 2017. Accessed: 2018-02-05.

  14. The Guardian. Mobile web browsing overtakes desktop for the first time. https://www.theguardian.com/technology/2016/nov/02/mobile-web-browsing-desktop-smartphones-tablets/, November 2016. Accessed: 2016-12-10.

  15. Graham Hamilton. JavaBeans specification. Technical report, Sun Microsystems, inc, 1997.

    Google Scholar 

  16. Per Brinch Hansen. Operating System Principles. Prentice-Hall, Inc., Upper Saddle River, NJ, USA, 1973.

    Google Scholar 

  17. Konstantin Läufer, George K. Thiruvathukal, and Robert H. Yacobellis. Loyola University Chicago Computer Science COMP 313/413 course examples. https://github.com/lucoodevcourse/, 2012–2018.

  18. Konstantin Läufer, George K. Thiruvathukal, and Robert H. Yacobellis. Loyola University Chicago Computer Science COMP 313/413 course examples: Click counter. https://github.com/lucoodevcourse/clickcounter-android-java, 2012–2018.

  19. Konstantin Läufer, George K. Thiruvathukal, and Robert H. Yacobellis. Loyola University Chicago Computer Science COMP 313/413 course examples: Prime number checker. https://github.com/lucoodevcourse/primenumbers-android-java, 2012–2018.

  20. Konstantin Läufer, George K. Thiruvathukal, and Robert H. Yacobellis. Loyola University Chicago Computer Science COMP 313/413 course examples: Simple threads. https://github.com/lucoodevcourse/simplethreads-java, 2012–2018.

  21. Konstantin Läufer, George K. Thiruvathukal, and Robert H. Yacobellis. Loyola University Chicago Computer Science COMP 313/413 course examples: Stopwatch. https://github.com/lucoodevcourse/stopwatch-android-java, 2012–2018.

  22. Doug Lea. Concurrent Programming in Java. Second Edition: Design Principles and Patterns. Addison-Wesley Longman Publishing Co., Inc., Boston, MA, USA, 2nd edition, 1999.

    Google Scholar 

  23. Jeff Magee and Jeff Kramer. Concurrency: State Models and Java Programs. John Wiley & Sons, Inc., New York, NY, USA, 1999.

    MATH  Google Scholar 

  24. Robert C. Martin and Micah Martin. Agile Principles, Patterns, and Practices in C# (Robert C. Martin). Prentice Hall PTR, Upper Saddle River, NJ, USA, 2006.

    Google Scholar 

  25. Gerard Meszaros. XUnit Test Patterns: Refactoring Test Code. Prentice Hall PTR, Upper Saddle River, NJ, USA, 2006.

    Google Scholar 

  26. Brad A. Myers. A brief history of human-computer interaction technology. interactions, 5(2):44–54, March 1998.

    Article  Google Scholar 

  27. Oracle. Java platform, standard ed. 8 API specification: Class EventQueue. http://docs.oracle.com/javase/8/docs/api/java/awt/EventQueue.html, 1993–2018. Accessed: 2016-12-09.

  28. Tim Peierls, Brian Goetz, Joshua Bloch, Joseph Bowbeer, Doug Lea, and David Holmes. Java Concurrency in Practice. Addison-Wesley Professional, 2005.

    Google Scholar 

  29. James Rumbaugh, Ivar Jacobson, and Grady Booch. Unified Modeling Language Reference Manual, The (2nd Edition). Pearson Higher Education, 2004.

    Google Scholar 

  30. Douglas C. Schmidt, Michael Stal, Hans Rohnert, and Frank Buschmann. Pattern-Oriented Software Architecture: Patterns for Concurrent and Networked Objects. John Wiley & Sons, Inc., New York, NY, USA, 2nd edition, 2000.

    Google Scholar 

  31. Hong Zhu, Patrick A. V. Hall, and John H. R. May. Software unit test coverage and adequacy. ACM Comput. Surv., 29(4):366–427, December 1997.

    Article  Google Scholar 

Download references

Acknowledgements

We are grateful to our former graduate students Michael Dotson and Audrey Redovan for having contributed their countdown timer implementation, and to our colleague Dr. Robert Yacobellis for providing feedback on this chapter and trying these ideas in the classroom.

We are also grateful to the anonymous CDER reviewers for their helpful suggestions.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Konstantin Läufer .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2018 Springer International Publishing AG, part of Springer Nature

About this chapter

Check for updates. Verify currency and authenticity via CrossMark

Cite this chapter

Läufer, K., Thiruvathukal, G.K. (2018). Managing Concurrency in Mobile User Interfaces with Examples in Android. In: Prasad, S., Gupta, A., Rosenberg, A., Sussman, A., Weems, C. (eds) Topics in Parallel and Distributed Computing. Springer, Cham. https://doi.org/10.1007/978-3-319-93109-8_9

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-93109-8_9

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-93108-1

  • Online ISBN: 978-3-319-93109-8

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics