Building Arduino Projects for the Internet of Things
CHAPTER 6 ■ IOT PATTERNS: REMOTE CONTROL There are two options to customize screen layout—you can either use the drag-and-drop f ...
CHAPTER 6 ■ IOT PATTERNS: REMOTE CONTROL android:layout_height="?attr/actionBarSize" android:background="?attr/colorPrimary" app ...
CHAPTER 6 ■ IOT PATTERNS: REMOTE CONTROL android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/act ...
CHAPTER 6 ■ IOT PATTERNS: REMOTE CONTROL Your app’s screen layout is ready, and it should look similar to Figure 6-14. Figure 6 ...
CHAPTER 6 ■ IOT PATTERNS: REMOTE CONTROL Listing 6-6. Default Code for MainActivity.java public class MainActivity extends Actio ...
CHAPTER 6 ■ IOT PATTERNS: REMOTE CONTROL Once you have downloaded the library, switch the view of Android Studio from Android to ...
CHAPTER 6 ■ IOT PATTERNS: REMOTE CONTROL Figure 6-17 shows the dialog box that will be presented when you paste the MQTT librar ...
CHAPTER 6 ■ IOT PATTERNS: REMOTE CONTROL Next you are going to write code to communicate with the MQTT broker. As shown in Figur ...
CHAPTER 6 ■ IOT PATTERNS: REMOTE CONTROL public class MQTTClient { private static final String TAG = "MQTTClient"; private Strin ...
CHAPTER 6 ■ IOT PATTERNS: REMOTE CONTROL MQTT broker when the user taps on the app screen. Finally, disconnect the app from the ...
CHAPTER 6 ■ IOT PATTERNS: REMOTE CONTROL //is present. getMenuInflater().inflate(R.menu.menu_main, menu); return true; } @Overri ...
CHAPTER 6 ■ IOT PATTERNS: REMOTE CONTROL External Libraries..................................................................... ...
CHAPTER 6 ■ IOT PATTERNS: REMOTE CONTROL void callback(char topic, byte payload, unsigned int length) { // Print payload String ...
CHAPTER 6 ■ IOT PATTERNS: REMOTE CONTROL Listing 6-15. Code for Standard Arduino Functions void setup() { // Initialize serial p ...
CHAPTER 6 ■ IOT PATTERNS: REMOTE CONTROL In your Android Studio, deploy and run the app on your Android device by choosing Run ➤ ...
CHAPTER 6 ■ IOT PATTERNS: REMOTE CONTROL If you have an Android device connected to your computer, Android Studio will prompt yo ...
CHAPTER 6 ■ IOT PATTERNS: REMOTE CONTROL Tap on the screen and check the LED attached to your Arduino. Its state should change e ...
© Adeel Javed 2016 139 A. Javed, Building Arduino Projects for the Internet of Things, DOI 10.1007/978-1-4842-1940-9_7 CHAPTER 7 ...
CHAPTER 7 ■ IOT PATTERNS: ON-DEMAND CLIENTS Since this is just an example to help you better understand the pattern, it’s purpos ...
CHAPTER 7 ■ IOT PATTERNS: ON-DEMAND CLIENTS Software Required In order to develop the smarter parking system, you need the follo ...
«
3
4
5
6
7
8
9
10
11
12
»
Free download pdf