summaryrefslogtreecommitdiff
path: root/samples/training/NsdChat/src/com/example/android/nsdchat/NsdHelper.java
Commit message (Collapse)AuthorAgeFilesLines
* Update sample NSD app to work reliably with current AndroidDave Platt2014-03-311-15/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Change the management of NSD Listener objects to one which ensures that each Listener will be used for only one NSD service request at a time (as the APIs were intended to function). Listeners are now allocated in a "lazy" on-demand way, rather than having one Listener of each type allocated at application startup time. When the Register or Discover button is clicked, any existing Listener request of that type will be canceled and the Listener discarded (avoiding the need to wait until the Listener callback has been completed), and a new Listener will be allocated. Moves code around in the application-lifecycle callbacks to reflect the current Android lifecycle. Doing important things like unregistering NSD services should not be done in the onDestroy() callback, as there is no guarantee that the app won't be killed before this callback is invoked. This can lead to "zombie" NSD registrations in KitKat. Adds additional lifecycle logging. Pass 2 - fix typo, clean up trailing whitespace Pass 3 - fix onStart/onRestart mismatch Bug: 13512512 Change-Id: Ic164110759204b27d8a14376777b593ebe1865fa
* Initial commit of NsdChat applicationAlexander Lucas2012-06-181-0/+172
Change-Id: I157ddfe38b79f01e72e8b52fa16d666c92f08254