Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 101 - 2615_KEC
P. 101

    Use the following link to access MIT App Inventor and sign in:
                        MIT App Inventor Platform

                         Email to be used: abc@khaitanpublicschool.com

                     2. Designing the App

                          UI Components to Include:
                         o   Canvas – For drawing.
                         o  Buttons – To change brush colors (Red, Green, Blue).
                         o  Accelerometer Sensor – To enable shake-to-clear functionality.

                         o  Clear Button – To erase the canvas manually.
                          Layout Tips:
                         o  Place the canvas at the top for easy drawing.

                         o  Position color buttons below the canvas.
                         o  Include a large "Clear" button for easy access.

                                                                Sample Layout

                     3. Coding the App
                          Brush Color Customization:
                         o   Program buttons to change the brush color when clicked.

                         o  Example: Red button applies red brush, green button applies green brush, etc.

                          Clear Canvas Feature:
                         o  Code a "Clear" button to erase all drawings on the canvas.
                          Shake to Clear (Accelerometer Integration):

                         o  Use the accelerometer component to detect when the device is shaken.
                         o  Program the app to clear the canvas when shaking is detected.

                          Sample Code Blocks:
                        o  When Red Button Clicked   Set Canvas PaintColor to Red.

                                                                                             UI Design and Touch Events  99

| 96 97 98 99 100 101 102 103 104 105 106 |