How to make a Flashlight App in Sketchware App
![Image](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEidoKadnZ7pciReGkfDE1rOJc6pbg5SGlHNwh6wMqBi7YQr3riD84BZOp0WNDhuyaqP3NtHK9_zZHKdadiyp6LSFKWfYkink12gOPA-7tLIL4D5Afp_mjqZMiYENaR5OEaNazaxOUgo8Ig/s320/Screenshot_20181021-145503.png)
1) Create a New project in Sketchware. 2) In view area add a LinearLayout as linear1 and set it's layout to center horizontal and center vertical. Then add Imageview as imageview1 . Set it's width and height to 100dp and scale type to FIT_XY. Then on image manager add two images ic_flash_on_black and ic_flash_off_black . Set imageview1 to ic_flash_off_black . 3) In library manager switch on AppCompat and Design. 4) Add a Camera component. 5) Add two Boolean Variables as flashLightStatus and hasCameraFlash . 6) Add two more blocks as flashLightOn and flashLightOff . 7) In OnCreate event add an add source directly block with code: hasCameraFlash = getPackageManager(). hasSystemFeature(PackageManager.FEATURE_CAMERA_FLASH); 8) In More block flashLightOn add a add source directly block with code: android.hardware.camera2.CameraManager cameraManager = (android.hardware.camera2.CameraManager) getSystemService(Context.CAMERA_SERVICE); try { ...