June 2017
Intermediate to advanced
232 pages
5h 4m
English
Finally, the last step: the easiest one. We have to start and stop the web server and implement the listener, so that we get notified when the user sends data using the HTML page:
public class MainActivity extends Activity implements AndroidWebServer.WebserverListener { ... }
Here, the WeserverListener is the callback interface.
if (Boards.enableWebserver()) { aws = new AndroidWebServer(8180, this); aws.setListener(this); }
The preceding code simply checks the type of the Android Things board as we described in Chapter 2, Creating an Alarm System Using Android Things. If the board ...
Read now
Unlock full access