[Nook Color Android Development] sinanju:
The ad revenue from this app has passed the $25 mark -- what it cost me to register with Google to put the app in the market. As promised, any revenue the app earns from that point forward will be added to my annual donation to the Baypath Humane Society of Hopkinton, Massachusetts -- a no-kill shelter.

Thanks from me and thanks from the kittens and puppies.

----------

I've written a widget to establish a PAN connection between the Nook a phone. It grabs the first networking-capable device it finds in the list of pairings. A couple of things to note:

There is an application. All it will do is show you what device, if any, it can connect to. It has to turn on Bluetooth to get the list, but it will politely ask you before doing so.

The widget will turn on Bluetooth, but it isn't so polite. For the life of me, I can't find a code snippet nor can I think of one that will start the polite activity (or any activity) from a widget that doesn't directly involve a button press. If anyone has such a snippet, I'd love to see it. I know its possible because the Bluetooth GPS widget does it. Fixed!

The widget, of course, requires root.

I do send a Toast when the process is complete, but toast from my widget isn't reliable. I need to figure that out, too... advice is welcome. Fixed!

Still to do: Monitor the connection and reflect the status in the widget. Fixed!

If nothing else, it's prettier than a GSCript script. Once it's stable and complete, I'll stick it in the marketplace.

Note... You must be running CM7 and you must have already paired the phone before you can use this....

Apr-13: New version with better Bluetooth device state management.

Apr-17: Added connection monitoring, polite Bluetooth enabling

Note: The pop-up to grant superuser access is asynchronous, so there may be a timing window on first use where state is not correctly monitored. I'll try to work that out, but in the meantime, all subsequent uses should work.

The icon will display a yellow LED during the connection process and a green one once the connection is going.

If a connection could not be established, the LED may go briefly green, then turn off. The challenge is that the only way I can monitor the connection is with "pand -l" or "ifconfig bnep0" and if the connection is gone, the attempt to read the result from those commands simply hangs. So, I start a thread and then periodically run "pand -l". A different thread monitors the first and, if it looks stuck, I kill the process and turn off the LED. But, until I can be sure it's really stuck and not just taking time to answer, the LED will be green. Fixed!

Obviously, once the connection is broken, the LED will go off.

Since I have the LED, I've taken out most of the toast, though some still comes from the OS.

Apr-19 Fixed the widget graphics so the LED turns off instead of disappearing. Fixed the green-before-failed connection status issue. Added a proper toggle -- if the connection is off, tapping the widget turns it on and if the connection is on, tapping the widget turns it off.

Apr-20 The official version is now in the Market:

https://market.android.com/details?id=earlmagnus.nctether

May-27 Fixed a null pointer issue discovered by Ophbalance

As always, feedback is welcome.