Interacting with Users via Keyboard and Buttons
Margaret Kozak Polk · 2024
This chapter begins the discussion of user interaction with an app. The basic traditional means of user interaction with programs is treated in this chapter, with other means to follow in later chapters. Clickable buttons are covered in detail in terms of their styling and function. This is the first chapter where coding activity in the Java language is introduced. The folder organization of an app in terms of the Java file corresponding to a screen layout is addressed in detail. A demonstration is provided for adding buttons to a screen and then coding the actions to take place when a button is clicked. The Java code necessary to implement such action is treated in a stepwise fashion. A detailed explanation as to how to reference screen widgets and components in Java code is provided as well. The “Button” widget and the variety of “ EditText ” input widgets are revealed. A discussion regarding the footprint of an app&s;s execution package is also conducted. The chapter concludes with a set of exercises that build upon a previous chapter&s;s exercises to provide practice with the topics covered in this chapter.