Android UI, and Networking. Can do most networking on Android Bluetooth only on 2.0, Not supported with version 1.6.

  • Published on
    24-Dec-2015

  • View
    213

  • Download
    1

Embed Size (px)

Transcript

<ul><li> Slide 1 </li> <li> Android UI, and Networking </li> <li> Slide 2 </li> <li> Can do most networking on Android Bluetooth only on 2.0, Not supported with version 1.6 </li> <li> Slide 3 </li> <li> Bruce Scharlau, University of Aberdeen, 2009 Android has many components Bluetooth and USB drivers now gone from kernel XMPP gone from application framework </li> <li> Slide 4 </li> <li> All layouts are hierarchical </li> <li> Slide 5 </li> <li> All screens are derived from view </li> <li> Slide 6 </li> <li> Hierarchical views can include similar groups </li> <li> Slide 7 </li> <li> Children do as told in Android TextView is child of parent viewgroup and fills, or wraps content </li> <li> Slide 8 </li> <li> There are many types of controls in Android </li> <li> Slide 9 </li> <li> Lists can be handled via adapters and filled from xml file of values </li> <li> Slide 10 </li> <li> Table layout allows for just that with data </li> <li> Slide 11 </li> <li> Use the hierarchy viewer tool to optimize and debug interface </li> <li> Slide 12 </li> <li> Views are tied to activities (screens) in Android One class per activity, and screen, which may be done as xml file </li> <li> Slide 13 </li> <li> One layout per activity (class) main.xml goes with AuctionStart list.xml goes with ListItems hit_server.xml goes with HitServer </li> <li> Slide 14 </li> <li> Xml layout file details components Hierarchy of views as noted earlier </li> <li> Slide 15 </li> <li> Xml layout inflated in onCreate Set value of inflated object INCOMPLETE CODE New view items and attached to xml values </li> <li> Slide 16 </li> <li> Android emulator runs as localhost, ie loopback Emulator is at 127.0.0.1 so need to call service at IP address of service to test network apps on developer machine </li> <li> Slide 17 </li> <li> Bruce Scharlau, University of Aberdeen, 2009 Activity is one thing you can do </li> <li> Slide 18 </li> <li> Apps move through states during lifecycle onPause is last state to preserve state and cleanup before app possibly destroyed </li> <li> Slide 19 </li> <li> Handler class provides access to running thread for main UI Handler has Looper which contains MessageQueue that can be called and return objects to UI thread </li> <li> Slide 20 </li> <li> Handler puts thread response into UI thread </li> <li> Slide 21 </li> <li> Method returns string from network Bruce Scharlau, University of Aberdeen, 2009 Log output for debugging, etc Simple method to call URL and return value </li> <li> Slide 22 </li> <li> Might need robust calls to network Put heavy lifting work in HTTPRequestHelper so accessible to other classes Handler waits for message and then returns </li> <li> Slide 23 </li> <li> Parse xml response and populate Java bean instance Bruce Scharlau, University of Aberdeen, 2009 </li> <li> Slide 24 </li> <li> Add permissions to manifest for connection and network Bruce Scharlau, University of Aberdeen, 2009 </li> <li> Slide 25 </li> <li> End of Lecture </li> </ul>