implement service as required for notification
use service to wrap around udp sender task

Pressing the notification creates a new activity, hence the need to save
settings when starting.
unbind from service when application stops as per api
acquire wifi and cpu wakelocks in sender
pointless to conditionalize reset of condition variable
synchronize sensor event/send, don't crash with gyro lackage

Sensor event handler and send both modify member variables, and run
asynchronously. Both blocks need synchronization as result.

Gyro-less data is mostly useless, but it's not necessary to crash on
such devices in any case.
don't force screen on as poor wakelock substitute
start service other than binding to it

Prevents service from dying along with the app on close, or on lack of
memory for the app.
stop the service when not sending after app close
prevent multiple copies of the main window at a time
fix typo
create and reuse float arrays

Don't create array values in each iteration of the sensor event loop.
This puts unnecessary GC pressure and so CPU load.

Reuse initialized values held in member variables instead.
use standard condition variable rather than CyclicBarrier

Java contains condition variable primitive in the "Object" base class.
CyclicBarrier isn't suited for this.
don't register as sensor event handler twice
poll for debug events, don't register a handler

Registering an event handler from a running application makes that event
handler go stale and presumably crash when a service calls it after the
app doesn't exist anymore.

Switch to polling for debug events. This also simplifies logic where the
service had to keep track of the handler and whether to generate the
events.
prevent crash when switching from task manager/launcher

Tested-by: @KyokushinPL
Reported-by: @KyokushinPL
set start button checkbox to off if stopping due to error
break out early if can't resolve hostname
wait for worker thread to exit before stop() ends

Since "bool running" is volatile, we can use it to signal the send
thread to break out of its loop.
prevent first text input widget grabbing focus

Use an empty layout to grab focus. According to Google and Stack
Overflow is the best solution. See:
<http://stackoverflow.com/questions/6117967/how-to-remove-focus-without-
setting-focus-to-another-control>.

Actually fixes showing debug info on small screens with high DPI.