Building Arduino Projects for the Internet of Things

(Steven Felgate) #1
CHAPTER 5 ■ IOT PATTERNS: REALTIME CLIENTS

As provided in Listing 5-13 , add a second element TextView. This will display the
time when the last motion was detected.


Listing 5-13. Add a TextView Element to content_main.xml


<TextView
android:id="@+id/updated_field"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_below="@+id/intrusion_icon"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="20sp"
android:textColor="#000000"
android:text="Intrusion Detected @ "
/>


Your app’s screen layout is ready, and it should look similar to Figure  5-14.

Figure 5-13. Dialog box for adding an image to an app

Free download pdf