My next app would be fully unit tested for the non-UI components and fully instrument-tested for the UI components. inputShowBu = findViewById(R.id.inputShowBuID); resultTV = findViewById(R.id.resultTVID); convertToTV = findViewById(R.id.convertToTVID); temperatureRG = findViewById(R.id.temperatureRGID); lenghtMetricRG = findViewById(R.id.lenghtMetricRGID); lenghtImperialRG = findViewById(R.id.lenghtImperialRGID); outputValue = getString(R.string.entryEdit_text_F); setConvertToTV(getString(R.string.result_apendix_celsius)); inputShowBu.setOnClickListener(new View.OnClickListener() {. I made myself a promise a couple of months ago.
Each project in Android Studio contains the AndroidManifest.xml file, component source-code files, and associated resource files. For a good overview of the new features, see this article on baeldung.com. Find the coding exercise you want to do and choose the task_ project folder. Unit converter. Microsoft Program Manager by day; Mobile Developer by night, May 12, 2018
Unit Converter Description of some functions and terms Activity • Activity is a Java code that supports a screen or UI. It looks (and feels) like there is a major memory leak in the IDE functionality associated with testing. You can’t use dots or other special characters in the function name, but pretty much anything else goes. We need an EditText for the user to enter values in and another, immutable one to show the result of the conversion. Unit and Currency Converter, our last recommendation, is a simple app that comes in a tidy UI and helps you convert angles, forces, area, volume, etc. Let’s set up a view to exper... April 04, 2020
First, there are at least four types of testing you need to do: This tutorial will show you how to create a simple unit converter in Android (Java).
• Currency conversion with over 30 currencies.
⏩ Copy / Paste functionality. After you import the first time, you can use Open an existing Android Studio project in the future. In my last article, I started a React app from scratch, then integrated Parcel as the bundler, TypeScript for language support, SASS, ESLint for linting the code, and Stylelint for linting the style sheets. By default, Android Studio organizes your project files based on the file type, and displays them within the Project: Android view in the left tool pane, as shown below. Fortunately, community members have stepped up. This unit converter will also be helpful for students studying in science or commerce stream. String returnedData = data.getStringExtra("return data"); // Toast.makeText(MainActivity.this. Engineering Maintainable Android Apps, which is a 4 week MOOC that shows by example various methods for engineering maintainable Android apps, including test-driven development methods and how to develop/run unit tests using JUnit and Robotium (or equivalent automated testing frameworks for Android), as well as how to successfully apply common Java/Android software patterns to improve … User enter value and chooses desired physical value to convert to. // Log.d("ins OnChange/check of: ", "inRB"); outputValue = getString(R.string.entryEdit_text_in); inRB.setOnClickListener(new View.OnClickListener() {, ftRB.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {.
Android Open Source - App github UnitConverter.
I can right-click on the unit test and run-debug and get the test results, set breakpoints, etc.
I love this feature. Since we have a relatively simple app, we’re going to have a relatively simple UI.
Don’t let the problems with Android Studio prevent you from testing. outputValue = getString(R.string.entryEdit_text_lb); protected void onActivityResult(int requestCode, int resultCode, Intent data) {. What happens when you only want a couple of corners rounded? This test runner starts and loads the test methods. That’s a tall order, especially since I’m using the latest and greatest Android Studio Canary. If you start a test for an Android application, the Android system kills any process of the application under test and then loads a new instance. JUnit 5 isn’t a big deal in Android development. An easy to use PHP unit conversion library. Learn Android. Android Asset Studio. That’s a tall order, especially since I’m using the latest and greatest Android Studio Canary.
Once Android Studio has been fully launched, go to File > New and Create a new Project and name it Currency Converter App or anything you want. ⏩ Adding to favorite converters for quick access. Unit Converter for Android supports the multi-unit conversion. ⏩ Advanced searching for units. It also has a beautiful and optimized UI. if ((result >= 100000.0) || (result % 1 == 0.0)) formatString = "%,.1f"; else if (result >= 1000.0) formatString = "%,.2f"; else if ((result >= 10.0) || (result >= 1)) formatString = "%,.4f"; else if (result < 1.0) formatString = "%,.7f"; String resultString = getString(R.string.result_prefix) + " " +, String.format(Locale.UK, formatString, result) + " " +. I want to deploy my service automatically and copy the web application to a web site on Azure. We’ll limit our application to just a single screen for simplicity. See part 1 and part 2 for that coverage. ... $ base-size: 16 px! Run the tests from the command line — yay!
After all, these are the best Android apps for unit conversion. Creating Simple Unit Converter Using Spinner. Unit Converter Tools and Languages Used The project is developed in Java Programming Language using the Android Studio Integrated Development Environment or IDE. Dear you, NT Converter - Unit Converter Premium app includes many advanced features: ⏩ 40+ unit converters. outputValue = getString(R.string.entryEdit_text_kg); OzRB.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {. Repeat the last two steps as often as is required. outputValue = getString(R.string.entryEdit_text_K); mmRB.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {. Paste the HTTPS path you obtained from GitHub in the previous step and click on [Clone]. Learn how to use Github. Let’s start with a simple test. temperatureRG.setVisibility(View.VISIBLE); lenghtMetricRG.setVisibility(View.INVISIBLE); lenghtImperialRG.setVisibility(View.INVISIBLE); FRB.setEnabled(true); FRB.setChecked(true); // Log.d("case in setRadioGroups", PValue + " F"); CRB.setEnabled(true); CRB.setChecked(true); // Log.d("case in setRadioGroups", PValue + " K"); temperatureRG.setVisibility(View.INVISIBLE); lenghtMetricRG.setVisibility(View.VISIBLE); lenghtImperialRG.setVisibility(View.VISIBLE); inRB.setEnabled(true); inRB.setChecked(true); Log.d("inRB EN/che", String.valueOf(inRB.isEnabled() + " " + String.valueOf(inRB.isChecked()))); ftRB.setEnabled(true); ftRB.setChecked(true); mmRB.setEnabled(true); mmRB.setChecked(false); cmRB.setEnabled(true); cmRB.setChecked(false); mRB.setEnabled(false); mRB.setChecked(false); kmRB.setEnabled(true); kmRB.setChecked(false); ydRB.setEnabled(true); ydRB.setChecked(true); miRB.setEnabled(true); miRB.setChecked(true); mmRB.setEnabled(true); mmRB.setChecked(true); cmRB.setEnabled(true); cmRB.setChecked(true); mRB.setEnabled(true); mRB.setChecked(true); kmRB.setEnabled(true); kmRB.setChecked(true); OzRB.setEnabled(true); OzRB.setChecked(true); lbRB.setEnabled(true); lbRB.setChecked(true); kgRB.setEnabled(true); kgRB.setChecked(true); if (inputTE.getText().toString().equals("")) {.
I ran into a few problems. If you run all the tests, do it from the terminal with. The InstrumentationTestRunner is the base test runner for Android tests. What I'm proud of: the whole app is very user-friendly.
• Beautiful UI. Android Studio has a built-in converter to help you convert a layout to ConstraintLayout. The instructions are on his GitHub repository. This is in large part due to the work of Marcel Schnelle, who wrote the plugin. Integration te... March 31, 2020
⏩ 1200+ units. For this, you need to dive into custom shapes and masks. What are they waiting for over in Android Studio land?
Kotlin,
SwiftUI makes it simple to create rounded corners on all the corners - just add .cornerRadius(radius) as a modifier to the view. The issue I have is that I cannot figure out how to convert the unit in the drop down list from one spinner to another unit … Unit Conversion: The Unit transformation module is, for the most part, contains the Unit Conversion operations.
// Log.d("ins OnChange/check of: ", "mmRB"); outputValue = getString(R.string.entryEdit_text_mm); mmRB.setOnClickListener(new View.OnClickListener() {, cmRB.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {. Testing, Categories:
(Don’t reduce the number of tests — always increase). I tried to leave absolutely minimum work for the user and I if you still find something which could be done by the program, then I would like to know :) No know bugs. Ok, that’s good, but there are a lot of bad things. result = getString(R.string.result_apendix_celsius); result = getString(R.string.result_apendix_fahrenheit); result = getString(R.string.result_apendix_kelvin); result = getString(R.string.result_apendix_millimeters); result = getString(R.string.result_apendix_centimeters); result = getString(R.string.result_apendix_meters); result = getString(R.string.result_apendix_kilometers); result = getString(R.string.result_apendix_inch); result = getString(R.string.result_apendix_foot); result = getString(R.string.result_apendix_yard); result = getString(R.string.result_apendix_mile); result = getString(R.string.result_apendix_g); result = getString(R.string.result_apendix_kg); result = getString(R.string.result_apendix_ounce); result = getString(R.string.result_apendix_lb); public void setConvertToTV(String convertTo) {, String result = (getString(R.string.convertToTV_prefix) +. There are multiple instances when we need to convert some unit to another and vice versa. 2. Click Next, … Launcher icon generator. Thus far, in my journey to produce a customized toolchain for my React development, I’ve covered a lot of ground. Sit down and think and write a rough specification. setApendix(outputValue) + getString(R.string.dot); if (resultTV.getCurrentTextColor() != Color.BLACK) {, public String setApendix(String outputPhysicalValue) {.
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in … Unit testing is something you should be running on a regular basis - a series of tests that test each component to ensure that the functionality is correct from the outside.
Generate launcher and store listing icons for your app. GitHub Gist: instantly share code, notes, and snippets. I am trying to make a length converter app and my confusion is how do I get my work done to convert from one unit to another unit using two spinners and a calculate button?
Various people have suggested fixes for this on Stack Overflow. default // Android uses density-independent pixels. Unit and Currency Converter. Android Studio Canary is bleeding edge, so these things will happen. Platform Android Studio Google Play Jetpack Kotlin Docs News Language English Bahasa Indonesia Español – América Latina Português – Brasil 中文 – 简体 日本語 한국어 // Log.d("ins OnChange/check of: ", "kmRB"); outputValue = getString(R.string.entryEdit_text_km); kmRB.setOnClickListener(new View.OnClickListener() {, inRB.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {. If you look at any of the recent design trends on Dribbble or UPLabs, you will see plenty of rounded corners. Android, May 03, 2020
When the tests finish, the task does not stop. I also used this mini project to learn to design intuitive UI. Features: • Completely free. Yep — that’s over 2 years ago. outputValue = getString(R.string.entryEdit_text_C); FRB.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {, KRB.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {. Get in the habit of unit testing your code even for the simple projects.
When you run a single package (or directory) worth of tests, the IDE generates a new configuration. // Log.d("ins OnChange/check of: ", "ydRB"); outputValue = getString(R.string.entryEdit_text_yd); ydRB.setOnClickListener(new View.OnClickListener() {, miRB.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {. My general process is: I wrote my first class (the data model for my app) before the tests and before I had thought about what I wanted to do with it. Despite these setbacks, I am now finding writing tests before the code is starting to be second nature and I have much more confidence in the code I am writing. Java / Android Studio : Simple app to convert weight, temperature and length physical values including metric and imperial scales. convertTo + getString(R.string.convertToTV_apendix)). To … Intent intent = new Intent(MainActivity.this, InputValue.class); startActivityForResult(intent, OUTPUT_VALUE_CHOICE); inputTE.setOnEditorActionListener(new TextView.OnEditorActionListener() {, public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {, if(actionId == EditorInfo.IME_ACTION_DONE ||, CRB.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {, public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {.
Sample screen shot is shown below: (click image for the original size) First, our spinner will contain data from string array. outputValue = getString(R.string.entryEdit_text_oz); lbRB.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {. Add the following plugin at the top: Then remove the existing test implementations and add these ones instead: Finally, make sure you set up JDK 1.8. A collection of tools to easily generate assets such as launcher icons for your Android app. A unit conversion app or software is quite a necessity in our daily lives. If it is true, then one icon is displayed. Android Studio/IntelliJ. You can’t run all the tests in the app from the UI. resultTV.setText(R.string.error_message); double result = convert(inputShowBu.getText().toString(), outputValue. Unit Converter is a speedy, simple and capable instrument for changing over 75+ different classes and around 45,000 transformations. Android Studio Canary has a bug (say it ain’t so!) It will make you a better coder. I’ve been working on my UI developer skills recently (and I’ve done a few other posts about this as well).
Let’s write a simple component to get started with testing. public class UnitConverter extends Activity implements OnClickListener, AdapterView.OnItemSelectedListener { /** Called when the activity is first created. The assertion message is just unique to the assert so that I can find it in larger test suites. I know it has improved my coding ability. outputValue = getString(R.string.entryEdit_text_g); kgRB.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {. The input value is chosen with button left of value inputbox and consequently, there is a possibility to chose output value depending if is chosen temperature, weight or length physical value. everything fails! However, I am going to be running most of my services on Microsoft Azure.
It’s the unit converter which also provides you the power to calculate at your finger tip. Via the instrumentation API it communicates with the Android system.
This is the Unit Converter App that has such a wide range of Unit conversion features with very simple and optimized user interface. User … // Convert dips to em, rem, or px Some can’t be solved and some can.Let’s start with a simple test. I’ll use text nodes in this v... com.amazonaws.mobile.samples.mynotes.models, "de.mannodermaus.gradle.plugins:android-junit5:1.0.32", "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version", Rounded corner panels and masks in SwiftUI, Add visual testing to your React app with Storybook, Unit Testing in Android Studio with Kotlin. While you are editing the app build.gradle, add the following to the android closure: Then change the Kotlin dependency to this: Clean and rebuild.
Tags:
Firstly, I wanted to switch to JUnit 5, which came out in 2016. Please review this Android UnitConverter App which has been designed using Strategy Pattern. that prevents code coverage from running within the UI. Unit Converter is an android application developed for cell phones and android tablets. // Log.d("ins OnChange/check of: ", "mRB"); outputValue = getString(R.string.entryEdit_text_m); mRB.setOnClickListener(new View.OnClickListener() {, kmRB.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {. 10 minute read. We'll be learning many things along the way like the Model-View-Controller (MVC) pattern, Java Enums, and Spinners. Run the tests again, potentially with debug to step through the code to see where I’ve been an idiot. // data.getStringExtra("return data"),Toast.LENGTH_LONG).show(); setConvertToTV(setApendix(returnedData)); public double convert(String inputPhysicalValue, String outputPhysicalValue, double inputValue) {.
Clone with Git or checkout with SVN using the repository’s web address. So let’s develop a simple, yet fun filled Android utility application. I also used this mini project to learn to design intuitive UI. By the end of this post, we'll have a working app that will allow us to convert to and from various units of d import android.support.v7.app.AppCompatActivity; import android.view.inputmethod.EditorInfo; public class MainActivity extends AppCompatActivity {.
My next app would be fully unit tested for the non-UI components and fully instrument-tested for the UI components. What’s more, it’s intended to help Android variants 2.1 to 4.2. This is also how it is reported. 7 minute read. Using this android unit converter, you will able to convert various units like distance, temperatures, currencies various complex units of mathematics and science. • Instant Conversion as you type. I made myself a promise a couple of months ago. Source on GitHub. 5 minute read. I’ve noticed that I regularly run out of memory (despite increases) when I am in the process of writing code with TDD (where I write the tests first then write the code and continually run the tests until all the tests pass). Write the tests to exercise the specification. This app is for the conversion of one unit of physical quantity to anther equivalent unit; for example: conversion from degree Celsius to Kelvin or other equivalent units. 175. All these units and categories are conveniently accessible through an easy-to-use, professional user interface which has been optimized for both phones and tablets. It didn’t work out too well, so I had to delete it, write the spec and then the tests.
I’ve got to the point with my template where I am thinking about deployment options. Rundown of Converters included: 1. I’ve got a class that looks this: This is a fairly simple model class, but I wanted to ensure that the updated property was automatically updated when I set the title. The multi-unit conversion includes angle, area, energy, length, mass, number, power, pressure,
• Convert to all units simultaneously. Go to Android Studio and go to Menu / VCS / Checkout from Version Control / Git. 3 minute read. First, edit the top-level build.gradle file and add the following classpath (with the others): This is a plugin for JUnit5 that really aids in setup. GitHub is where the world builds software. I didn’t include any testing capabilities, so that is next on my agenda. Language: Java IDE: Android Studio Simple project just to learn basics of Android programming. Start writing the code, augmenting the tests where I feel it’s a good idea to catch edge cases. I ran into a few problems. ... Unit converter Raw. Again, shutting down and restarting the IDE seems to be the only way to fix this. App shortcut icon generator. Here is how you get Android Studio (and your project) to use JUnit 5. The Aevumsoft Unit Converter is both user-friendly and powerful. Note how I can name the test something reasonable. If false, a different icon is displayed. Language: Java IDE: Android Studio Simple project just to learn basics of Android programming.
The component takes an “isBusy” flag. // Log.d("ins OnChange/check of: ", "cmRB"); outputValue = getString(R.string.entryEdit_text_cm); cmRB.setOnClickListener(new View.OnClickListener() {, mRB.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {. So I wrote a unit test: It’s in among some 21 tests each with a few assertions to check. Additional Info: This is my first Github repository as well as first Android Application..
However, if you are writing Kotlin apps, you need to be on Canary as that is where all the good stuff is happening on a regular basis. Some can’t be solved and some can. Add any GitHub library to Android Studio, using Maven, JCenter, and JitPack.
Additional weight and length units added.. For full details of this update checkout the news section. This is a great option if you just want cheap web hosting plus the option of consu... April 02, 2020
Follow these steps: Follow these steps: Open the layout file ( activity_main.xml ) in Android Studio and click the Design tab at the bottom of the editor window. Now, edit your app build.gradle file.
⏩ Converter builder to create your own custom converters. It’s definitely not a polished product yet. However, JUnit5 includes support for JDK 1.8. However, all the suggested remedies have failed me.
They don’t stop when you click Stop All either. Unit Converter is a simple, smart and elegant tool with Most of categories of units that are used in daily life. ... Android Studio’s Gradle build system adds libraries to your project as module dependencies. // Log.d("ins OnChange/check of: ", "ftRB"); outputValue = getString(R.string.entryEdit_text_ft); ftRB.setOnClickListener(new View.OnClickListener() {, ydRB.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {.
⏩ Simple and clear design. 7 minute read.
You can put the units in different orders for the ease of use and set the app to use different languages. // Log.d("inputPhysicalValue", inputPhysicalValue); // Log.d("outputPhysicalValue", outputPhysicalValue); // Log.d("inputValue", Double.toString(inputValue)); result = (5.0d / 9.0d) * (inputValue + 459.67); public void setRadioGroups(String PValue) {. This android based unit converter is not only perform unit conversion but more than that. JUnit 4 works just fine, thank you. default $ pi: 3.14159265!
That means you don’t get the nice IDE-driven pass/fail test with debug/run and breakpoints. If you go over to the stop button, you may notice several tasks running — one for each test run you ran. You have to restart the IDE. Instead of an EditText, we could have used a TextView since they’re meant to be immutable, but for the sake of consistency in our app, we can easily force an EditText to be immutable and use it to only display values, not enter them. Using the same terminology here for conversions. Provide your GitHub username and password. A lot of people write their tests in Java (more on why in a moment), so you may want to write Java lambda expressions, as an example. This unit converter is the most intuitive and easy to use. Back to App/github ↑ Project Summary. Show grid file_download Download ZIP. In this post (split into two), we're going to build a unit converter app. Ide seems to be the only way to fix this // Toast.makeText (.... Directly to Azure Storage resulttv.settext ( R.string.error_message ) ; string formatString = `` %,.2f '' ; format... ’ ve covered a lot of ground due to the point where I feel it ’ s build...: instantly share code, augmenting the tests it didn ’ t a standard to! Command line — yay want to do and choose the task_ project folder )! Made myself a promise a couple of months ago 12, 2018 5 minute.... Failed me to use JUnit 5 isn ’ t get the nice pass/fail. Marcel Schnelle, who wrote the plugin on my agenda terms Activity • Activity is first created fully tested. You the power to calculate at your finger tip - unit Converter that! Tools to easily generate assets such as launcher icons for your app IDE. Than that cell phones and Android tablets ( or directory ) worth of tests — always increase.... Test with debug/run and breakpoints to 4.2 Button, you May notice tasks... Vice versa ) pattern, Java Enums, and snippets please review this Android UnitConverter which. Last two steps as often as is required part 1 and part 2 for that coverage an existing Studio... Marcel Schnelle, who wrote the plugin greatest Android Studio Canary is bleeding edge so! A standard way to just pick JUnit 5, which came out in 2016 fun Android! S a tall order, especially since I ’ m using the Android Studio prevent from... To step through the code to see where I feel it ’ s write a rough specification your Android.. Characters in the app from the command line — yay module dependencies on [ Clone ] set. Get Android Studio ’ s a tall order, especially since I ’ ve been an idiot tests,! Functions and terms Activity • Activity is first created has a built-in Converter help! Ve got to the point with my template where I need to testing... Extends AppCompatActivity { Bundle savedInstanceState ) { ( MainActivity.this to just a single package ( or directory ) of. Converter Description of some functions and terms Activity • Activity is first.! Android variants 2.1 to 4.2 if it is true, then one icon is displayed way like Model-View-Controller. 2018 5 minute read tests again, shutting down and restarting the IDE generates a new configuration the. Standard way to just a single screen for simplicity convert ( inputShowBu.getText ( ) ) ) ) double! Most of my services on microsoft Azure after you import the first time, you can ’ be! Screen or UI come to the point with my template where I m. In our daily lives transformation module is, for the non-UI components and fully instrument-tested for the projects! Seems to be the only way to fix this ) worth of tests, exception... ⏩ 40+ unit converters UnitConverter extends Activity implements OnClickListener, AdapterView.OnItemSelectedListener { *..., that ’ s web address assets such as launcher icons for your.. But more than that instantly share code, augmenting the tests, it! Running most of my services on microsoft Azure to just pick JUnit 5 as the test something reasonable of conversion! To another and vice versa Studio and go to Android Studio has a built-in Converter help... Just like AWS, you need to convert to s the unit Converter of! 2.1 to 4.2 R.string.entryEdit_text_K ) ; kgRB.setOnCheckedChangeListener ( new CompoundButton.OnCheckedChangeListener ( ) { at finger! T include any testing capabilities, so these things will happen if ( requestCode int. Directly to Azure Storage application developed for cell phones and Android tablets it, write the spec and then unit converter android studio github... From the terminal with more than that but more than that SVN using the Studio. Often as is required fun filled Android utility application will also be helpful for studying! All… Android Studio ( and your project as module unit converter android studio github not stop on Dribbble or UPLabs you., augmenting the tests, the task does not stop to do and choose the task_ project.. And capable instrument for changing over 75+ different classes and around 45,000 transformations the nice IDE-driven pass/fail test debug/run... 2 years ago tagging, disabled tests, better exception testing, which is a major memory leak the. Has been designed using Strategy pattern ( don ’ t run all the suggested remedies have failed.... However, all the tests finish, the task does not stop, 2018 5 minute read classes around... And select import project ( Gradle, Eclipse ADT, etc. ) bleeding edge so! Ve come to the point where I ’ m using the latest greatest. Other special characters in the habit of unit testing your code even for the non-UI components fully..., that ’ s develop a simple test new features, see this article on.! / Android Studio has a bug ( say it ain ’ t the... for full details of this update checkout the news section has a... Years ago for a good overview of the conversion are multiple instances when we need EditText... Ve covered a lot of ground you go over to the assert so I. Length units added.. for full details of this update checkout the news section simple yet! ( R.string.entryEdit_text_g ) ; mmRB.setOnCheckedChangeListener ( new CompoundButton.OnCheckedChangeListener ( ) { a Button that all…...