Boil an egg app - step by step (step 3 – code)
After reviewing part 2 of the tutorial, it’s time for coding. let’s get started. In the main activity class we’ll have the following things to do: 1. set some private variables to be accessed from different places in the class. 2. bind some variables to views from the xml reviewed in part 2 3. set listeners for the different buttons on the screen 4. handle timer changing and displaying time remained let’s elaborate on this : 1. initialize some variables in the main class, place those prior to the onCreate() method: private Button btnSmallEgg,btnMediumEgg,btnLargeEgg; private Button btnCookAnEggTimer,btnResetTimer; private TextView btnSoftEgg,btnHardEgg; private TextView tvTimer,tvTimerLabel; private TextView tvChooseEggSize,tvChooseEggType,tvIntro ; long minutes; long seconds; long maxTimer=600...