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
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsNotes
- 1.
This topic goes beyond the scope of this chapter but is included in the corresponding example [19].
- 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.
In some frameworks, including Java AWT/Swing, the UI thread is known as event dispatch thread (EDT).
- 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.
It is also possible—though less practical—to build an Android GUI programmatically.
- 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.
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.
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
Kevin Ashton. That ’Internet of Things’ thing. RFID Journal, http://www.rfidjournal.com/articles/view?4986, July 2009. Accessed: 2016-12-09.
Kent Beck. Test Driven Development: By Example. Addison-Wesley Professional, 2002.
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.
Stefano Borini. Understanding model-view-controller. https://www.gitbook.com/book/stefanoborini/modelviewcontroller, 2016. Accessed: 2016-12-09.
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.
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.
Thomas W. Christopher and George K. Thiruvathukal. High Performance Java Platform Computing. Prentice Hall PTR, Upper Saddle Ridge, NJ, 2000.
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.
Google. Android developer reference. http://developer.android.com/develop/, 2009–2018. Accessed: 2016-12-09.
Google. Memory consistency properties. https://developer.android.com/reference/java/util/concurrent/package-summary.html#MemoryVisibility, 2009–2018. Accessed: 2016-12-09.
Google. Processes and threads. http://developer.android.com/guide/components/processes-and-threads.html, 2009–2018. Accessed: 2016-12-09.
Google. SMP primer for Android. http://developer.android.com/training/articles/smp.html, 2009–2018. Accessed: 2016-12-09.
Google. Android Studio: Use Java 8 language features. https://developer.android.com/studio/write/java8-support.html#supported_features, 2017. Accessed: 2018-02-05.
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.
Graham Hamilton. JavaBeans specification. Technical report, Sun Microsystems, inc, 1997.
Per Brinch Hansen. Operating System Principles. Prentice-Hall, Inc., Upper Saddle River, NJ, USA, 1973.
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.
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.
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.
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.
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.
Doug Lea. Concurrent Programming in Java. Second Edition: Design Principles and Patterns. Addison-Wesley Longman Publishing Co., Inc., Boston, MA, USA, 2nd edition, 1999.
Jeff Magee and Jeff Kramer. Concurrency: State Models and Java Programs. John Wiley & Sons, Inc., New York, NY, USA, 1999.
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.
Gerard Meszaros. XUnit Test Patterns: Refactoring Test Code. Prentice Hall PTR, Upper Saddle River, NJ, USA, 2006.
Brad A. Myers. A brief history of human-computer interaction technology. interactions, 5(2):44–54, March 1998.
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.
Tim Peierls, Brian Goetz, Joshua Bloch, Joseph Bowbeer, Doug Lea, and David Holmes. Java Concurrency in Practice. Addison-Wesley Professional, 2005.
James Rumbaugh, Ivar Jacobson, and Grady Booch. Unified Modeling Language Reference Manual, The (2nd Edition). Pearson Higher Education, 2004.
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.
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.
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
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2018 Springer International Publishing AG, part of Springer Nature
About this chapter
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)