October 2018
Intermediate to advanced
464 pages
15h 17m
English
We'll use three buttons to initiate each action, so start by opening activity_main.xml and perform the following steps:
<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".MainActivity"> <ToggleButton android:id="@+id/buttonLights" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Lights" android:layout_centerHorizontal="true" android:layout_above="@+id/buttonAction" ...