yashsingh1/xdaforums huggingface dataset:
[Nook Color Android Development] sinanju:
Weird. Here's the code around that line:

Set<BluetoothDevice> pairedDevices = mBluetoothAdapter.getBondedDevices();
if (pairedDevices.size() > 0)
{
for (BluetoothDevice device : pairedDevices)
{
if (device.getBluetoothClass().hasService(BluetoothClass.Service.NETWORKING))
{
pan_device = device.getAddress();
break;
}
}
}

The line is question is the hasService check. There should be no way to get there with a null pointer. I check that the set has items in it and the for loop should stop when I run out. Looking at it, the size check is almost certainly redundant since the for loop simply wouldn't execute if I went there with an empty set.

Edit: Perhaps its the getBluetoothClass call that's letting me down. What other devices do you have paired? I'll add a check for a null back from that call and push an update today.
[Nook Color Android Development] sinanju:
I pushed the fix. The update should be in the market. At least I know what the developer's console sends, now. Docs said it could return a null -- mea culpa.
[Nook Color Android Development] Ophbalance:
I thought that I had the HTC paired... but it's apparently decided to be a @#$@#$ and bork it's BT stack or something. I have it at CM7 right now, but it didn't have issues at CM6. I'm going to take it back to CM6 and hopefully it will start to pair correctly again... ah, to have the funds to actually buy an android phone, instead of this gimped up HTC :P. The updated app is working if nothing is paired now, so thanks for that!
[Nook Color Android Development] Ophbalance:
And so, something was borked with CM7 on my HTC. I can now use wireless tether with the NC and my laptop, something I've been struggling against all morning.
[Nook Color Android Development] sinanju:
Wunderbar.
[Nook Color Android Development] BitingChaos:
I just tested it, and it worked great (first try). I left a 5/5 review on the Market.

I went to the Bluetooth screen on my Nook Color and iPhone 3GS, turned on Bluetooth on each, and then had them discover & pair with each other.

I then loaded up MyWi and started the Bluetooth tether. On the Nook Color I added the widget to my Desktop and tapped it to start it up.

I loaded up the Browser and went to google.com, then clicked the News link, etc.

I loaded up the Market and gave the 5/5 review right then.
[Nook Color Android Development] toyboy372:
I installed this program and I have no widget and no superuser access. How do I give it superuser access.

Thanks.
[Nook Color Android Development] sinanju:
Did you try to add the widget to your home screen? Was it not in the list of available widgets?
[Nook Color Android Development] toyboy372:
There was no widget on the list for it.
[Nook Color Android Development] sinanju:
Then the app is not installed. Do you see it in the list when you visit the Market and look at your installed apps?
[Nook Color Android Development] toyboy372:
I installed the app, see it in my list of programs and when I clik it there it brings up a screen that says something about no device to pair with.
[Nook Color Android Development] toyboy372:
Uninstalled, rfeinstalled and restarted it 3 times also.
[Nook Color Android Development] sinanju:
If you don't see the widget in the list of widgets to add to a screen (you may have to scroll), then something is wrong with the Nook -- The app is showing 300+ active installations in the developers dashboard, so your case would seem to be unique. Perhaps if you told me what you have actually installed on the Nook: CM7, I assume -- which version, any particular variation, what kernel, etc.

Also, having a paired phone that provides network access is a requirement. Even if you did have the widget on the desktop, it would do nothing until that requirement is satisfied. If you have a device paired properly, that will appear in the application's display.
[Nook Color Android Development] xvoorheesx:
It's not asking for SU.??????
[Nook Color Android Development] kardain:
I had the same issue... however a "fix permissions" via rom manager took care of that and it started calling SU.
[Nook Color Android Development] toyboy372:
Notnope, not asking for su. Explain rom manager, i'm new to this.
[Nook Color Android Development] sinanju:
It's an app that comes with CM7. "Fix Permissions" is one of its functions.

That said, my app does not ask for SU. The widget does, but you haven't gotten that far.
[Nook Color Android Development] xvoorheesx:
I'll try that. Thanks for your info.
[Nook Color Android Development] xvoorheesx:
No joy.
[Nook Color Android Development] sinanju:
What do you have installed on your device?

Do you have your phone paired?

Can you connect using pand by hand as described earlier in the thread?
[Nook Color Android Development] nookierookie:
Hi sinanju,

I love this app, which rocks as far as battery life goes and pairs well with the iPhone 4's personal hotspot feature.

I am scared to use it again though. Both times that i used it heavily, it worked well for the bt connection ( after a few failed attempts and needing to press the widget several times [AND needing to get the damned phone close enough to the weak nook antanna]). But somewhere in the fray, my WiFi completely bit the dust. Totally trashed.

As in, when i was back home with my personal WiFi, it would scan and scan and no WiFi networks would show up, zero, nada. Not my neighbor's, even. Just the sad list at the bottom on the ones it remembered but was not in range ofeven after toggling WiFi off and on.

So, does this work as a bug report? Fixing permissions did nothing and clearing caches did nothing. Restarting didn't fix it, reflashing neither the kernel (dals .29 at the first WiFi death, and the .31 one more recently)nor the cm7 roms i was using at the time would fix it. I also checked the settings.db file to investigate airplane and other mode s that have been known to cause problems. I finally had to do a total wipe and reflash to regain WiFi connectivity.

I maybe could reproduce it, and get log files or run some shell commands this time, though I'm not sure what I'd be looking for. Whaddya advise? I really want to use this app daily, ( and help with any bugs), but nandroid backups are annoying and time consuming to restore, but it is definitely what I'll rely on this time.

I still gave it 5 stars, since this WiFi issue may be unrelated, and technically the app functioned as advertised, beautifully. Maybe WiFi just gets jealous on my nook and decides to take its ball and go home.

Please advise.
[Nook Color Android Development] sinanju:
That's a known issue, unrelated to my app. Several here have had the problem, me included. The cause is unknown, but the solution is to remove remembered networks from the list. WiFi scanning will then start working again and you can then re-add them.

I'll also point out that WiFi and Bluetooth clash on the Nook and you should only have one enabled at a time... it may be why you have to hit the tethering widget more than once. If you're using Bluetooth, turn off WiFi and if you're using WiFi turn off Bluetooth.
[Nook Color Android Development] kardain:
A thought on that issue... given there is a known conflict, would you consider it beneficial to put in a notification of sorts that will prompt the user to kill WiFi if it is enabled?
[Nook Color Android Development] Deaks2:
I've always had both wifi and bt enabled on my nook, of course both have never been active at the same time. I have no conflicts and the app works as designed.
[Nook Color Android Development] azuwis:
For the 1st class connection problem, please have a look at this http://xdaforums.com/showthread.php?p=8236341#post8236341 , might help.
[Nook Color Android Development] shumash:
App Works with Verizon, No Additional Cost

For those of you with Verizon plans, you know that to get hotspot wifi or tethering you have to pay extra. Let it be known that this app will tether the NC through a DROID X2 to its 3G connection WITHOUT PAYING FOR TETHERING! It's not fast, but its free. Great app, sinanju. Thanks!
[Nook Color Android Development] sinanju:
If you've seen the FC I mention in the update to the top of th OP, let me know.
[Nook Color Android Development] rroginela:
Hi,

Can someone post the APK please? The market link seems not to be working for me and I would love to give this a go.

Alternatively I would accept help on getting my market app to find it.

Thanks in advance!
[Nook Color Android Development] sinanju:
You'd be much better off figuring out why the link doesn't work. What actually happens when you click it? What is the setup on your nook, rom- and kernel-wise?

If you want to look for it with the market app, the most direct but non-obvious term to use is the internal package name "earlmagnus"... it will be the only hit.
[Nook Color Android Development] rroginela:
Hi,

Thanks for the response. My nook is running the latest of kernel from dangrlin, it is on cm7 nightly 118 I believe. my build.prop has one edit the manufacturer and device are set to HTC/VISION because Netflix would play fast without it. as far as the link it just says it isn't found. I have a feeling it is the build.prop fingerprint but I'm unsure how it should be set.

here is my build.prop

# begin build properties

# autogenerated by buildinfo.sh

ro.build.id=GRI40

ro.build.display.id=GRJ22

ro.build.version.incremental=eng.buildbot.20110615.130641

ro.build.version.sdk=10

ro.build.version.codename=REL

ro.build.version.release=2.3.4

ro.build.date=Wed Jun 15 13:07:13 UTC 2011

ro.build.date.utc=0

ro.build.type=user

ro.build.user=buildbot

ro.build.host=bb1

ro.build.tags=test-keys

ro.product.model=HTC Vision

ro.product.brand=bn

ro.product.name=encore

ro.product.device=encore

ro.product.board=encore

ro.product.cpu.abi=armeabi-v7a

ro.product.cpu.abi2=armeabi

ro.product.manufacturer=HTC

ro.product.locale.language=en

ro.product.locale.region=US

ro.wifi.channels=

ro.board.platform=omap3

# ro.build.product is obsolete; use ro.product.device

ro.build.product=encore

# Do not try to parse ro.build.description or .fingerprint

ro.build.description=passion-user 2.3.3 GRI40 102588 release-keys

ro.build.fingerprint=google/passion/passion:2.3.3/GRI40/102588:user/release-keys

# end build properties

#

# system.prop for encore

#

wifi.interface=tiwlan0

wifi.supplicant_scan_interval = 30

dalvik.vm.heapsize=32m

ro.additionalmounts=/mnt/emmc

rild.libpath=/system/lib/libreference-ril.so

rild.libargs=-d /dev/ttyS0

ro.cwm.forbid_format=/boot

#

# ADDITIONAL_BUILD_PROPERTIES

#

keyguard.no_require_sim=true

dalvik.vm.dexopt-flags=m=y

ro.com.google.locationfeatures=1

ro.com.google.networklocation=1

ro.allow.mock.location=1

qemu.sf.lcd_density=160

ro.setupwizard.enable_bypass=1

ro.sf.hwrotation=270

ro.setupwizard.enable_bypass=1

keyguard.no_require_sim=1

wifi.interface=tiwlan0

alsa.mixer.playback.master=default

alsa.mixer.capture.master=Analog

dalvik.vm.heapsize=32m

ro.opengles.version=131072

ro.rommanager.developerid=cyanogenmodnightly

taken out because of oink restriction

ro.com.google.clientidbase=android-google

ro.com.android.wifi-watchlist=GoogleGuest

ro.setupwizard.enterprise_mode=1

ro.com.android.dateformat=MM-dd-yyyy

ro.com.android.dataroaming=false

ro.config.ringtone=Playa.ogg

ro.config.notification_sound=regulus.ogg

ro.config.alarm_alert=Alarm_Beep_03.ogg

ro.modversion=CyanogenMod-7-06152011-NIGHTLY-encore

ro.setupwizard.mode=OPTIONAL

dalvik.vm.dexopt-flags=m=y

net.bt.name=Android

dalvik.vm.stack-trace-file=/data/anr/traces.txt
[Nook Color Android Development] sinanju:
Try hitting the link from a desktop machine, then log into the market and see what it says for compatible devices. The only restriction I have on the app is the minimum version supported being Froyo. The market dashboard says, explicitly, that the app is available for HTC G2 (vision) devices.
[Nook Color Android Development] BigMots:
Downloaded the app from the market on my Nook running the nook2android CM7 ROM (v7.0.2 Build GRI40). App installed, paired it to my WM6.1 Treo Pro phone (it has the Internet Sharing app for USB or BT PAN). Turned on the program on the Treo and selected "BT PAN" option. When I click on the widget on the Nook, it does connect (Green Dot), HOWEVER no app is able to connect to the internet (Dolphin browser, stock browser etc) AND it disconnects after a while.

Alternatively I have a Samsung Epic (Galaxy S - Sprint version), what tethering app can I use on that (it is NOT rooted).

Any help would be appreciated.
[Nook Color Android Development] sinanju:
Which "The Internet Sharing App" would that be?
[Nook Color Android Development] BigMots:
Hi

It's called "Internet Sharing App", allows you to share the phone's Data connection to laptop either via USB or Bluetooth PAN.

BigMots
[Nook Color Android Development] sinanju:
I think I know the one you're talking about. It reports when a client has connected -- does it do so for you? While connected, can you open the terminal emulator and ping 8.8.8.8?
[Nook Color Android Development] BigMots:
Actually the way it work is that I start the app and click "Connect" (a drop-down box in the app gui lets me select either BT PAN or USB) and then I click the "NCtether" widget on my Nook's home screen (I have used the USB connection with my laptops several times).

That said, I tried the ping per your suggestion but I get no response to the ping command in the terminal emulator. i.e. 100% packet loss.

The NCtether app does have the necessary "su" / root access as required.

thanks

BigMots
[Nook Color Android Development] sinanju:
I used to have a WinMo 6.5 phone and used that app... the display does change when a client, like my app, connects.
[Nook Color Android Development] sinanju:
I should also ask if the phone successfully tethers with anything else... a laptop or desktop computer?
[Nook Color Android Development] BigMots:
Hi

The phone does tether with a laptop successfully and has done so several times.

BigMots
[Nook Color Android Development] sinanju:
I'm not sure what to tell you. The widget, at its core, doesn't actually do anything except run pand --connect.

- If the green LED is lit on my widget for more than 5 seconds, it's definitely thinks it got a good bluetooth connection. If it stays lit for less than 5 seconds, things may have started well and gone immediately downhill.

- Tether a laptop to the phone and watch the interface of the tethering app when you do so. It should change when the connection is made. Make sure the same thing happens when you tether the Nook.
[Nook Color Android Development] BigMots:
Sounds like a plan, while I have used the laptop tether via USB, I have not done so via BT PAN, so will check that out to see how that goes.

Keep this thread posted on the progress.

thanks

BigMots
[Nook Color Android Development] Deaks2:
Did you see this? http://review.cyanogenmod.com/#change,6603
[Nook Color Android Development] sinanju:
Yeah... It looked like others were going to beat me to it, so I hadn't spent any significant time on the problem.
[Nook Color Android Development] painter_:
I feel really dumb, I have no idea how to use the BT PAN that was included in CM7.

The app that sinanju provided works well but I would like for the BT network to be able to get my email and sinanju's app does not allow for this.
[Nook Color Android Development] sinanju:
What problem are you having with email? I just double-checked a BT connection with my app and had no problem retrieving GMail with the stock mail client. To my knowledge, it has always worked.

As far as I can tell, running the latest nightly on my Nexus One, the BT support provides a tethering capability without a stand-alone client. From the Nook's perspective, the connection my app makes is now a first-class connection... so, for example, the market now works.
[Nook Color Android Development] painter_:
I just upgraded my phone from the HTC hero to the Nexus S 4g, With the new PAN service on CM7 I no longer need to use a tethering app. On the nook I use your app to start the connection. It connects flawlessly and holds the connection as long as the Nook stays in range.

Once connected anything that uses http and https works fine. I can not get gmail or exchange push on the bluetooth connection, nor can I connect to a Cisco VPN. Wifi tether works fine.

I have not looked at it much as I typically only surf on my lunch break using the bluetooth connection.
[Nook Color Android Development] sinanju:
Weird... ok... the 1st class connection idea is out. When starting the stock browser (which I rarely use anymore) I got a message about a lack of connection, but got the page anyway. I can, however, confirm

- Cisco VPN access over the connection

- Mail

I really don't know what's going on for you. Any chance of a logcat when things are breaking down?
[Nook Color Android Development] boxcar8028:
I just try this yesterday and it worked flawlessly. my nook and my htc aria paired and connected up just fine. the range is not bad the battery life is so much better then tethering wifi. my aria is running a lot cooler now tethering bluetooth over wifi.

I know it was a long shot but I was really hoping that this would had worked with GPS tether but no joy.

great app, thanks sinanju. :D
[Nook Color Android Development] dj710:
First I would like to say thank You for this wonderful app. Job well done.

I am not using a Nook Color. I am using a Viewsonic Gtablet. I have used your app on several of the Gingerbread ROMs for this tablet and it worked flawlessly on all of them. I recently installed a HoneyComb ROM (gtabcomb beta 3.3). I really like the HoneyComb interface. I thought I'd give the Bluetooth tethering app a try on HoneyComb. Much to my surprise it setup the PAN network to my Droid X. When I touched the widget to turn it off it turned the connection off but the led remained green. After this it would not connect again. I went into Settings, Applications, Manage Applications and force stopped the app. The LED on the widget remained green but touching the widget started the connection again. Touching it again stopped the connection but the LED remained green and it wouldn't toggle again. It will always connect once and then disconnect after I force stop it. Do you think you might be able to solve this issue? I will continue to use this app this way anyway. It sure is better than going into the terminal every time and entering the commands that way.

Thanke you again for this great app.:D:D:D
[Nook Color Android Development] sinanju:
Possibly, if you can get me the logcat. Sadly, there's no way for me to debug it using the emulator. Here's how the LED works:

Tapping the widget starts a service. That service then starts the connection and spawns two threads. One thread periodically checks the status of the connection by executing "ifconfig bnep0" and logging the result as a debug message. My observation was that, if the connection is broken, attempts to read the result will hang. So, there is a second thread that monitors the first. Every time the first thread successfully reads the connection status, it clears a count. Every time the second thread checks the first, it increments a count. If the count is too high, the second thread assumes the first is hung and goes through the process of cleaning up. That process includes clearing the LED -- something that's done in a "finally" block, so there's no way for it not to be executed. Unfortunately, I can't work around the hanging behavior as an attempt to check the reader with BufferedReader.ready() always tests false, even when the read will succeed.

I can only assume that, though the status is showing a broken connection, the thread is not hanging. If you can get me the text of that status from logcat, I can test for it and fix the bug. If you're not setup for development, there are logcat readers in the market.
[Nook Color Android Development] dj710:
I'm having trouble getting it to work again. Here is the commands I use from the terminal.

pand --connect xx:xx:xx:xx:xx:xx (xx = my phone bluetooth MAC address)

ifconfig bnep0 down

dhcpcd bnep0

I have to use these commands to get it to work.

To kill the connection I can use

pand --kill -k xx:xx:xx:xx:xx:xx

or

pand --killall -K

Now when I try the Nook Color app the LED turns yellow and stays there. If i go to the terminal and enter ifconfig bnep0 I see that it does not have an IP address. If I enter

ifconfig bnep0 down

dhcpcd bnep0

then

ifconfig bnep0 Now I see an IP address and the LED on your app is green.

I'm working on some log files to send you which might help too.

Thank You
[Nook Color Android Development] sinanju:
This is what's between the LED being yellow and the LED being green:

pand --connect <pan_device>

Thread.sleep(4000); // pand needs time to settle

dhcpcd bnep0

setprop net.dns1 8.8.8.8
[Nook Color Android Development] dj710:
To work with honeycomb (at least on the gtab), there has to be another line before the dhcpcd. ifconfig bnep0 down. I think it is because of the bluetooth address. The first octet changes from 42 to 43. I,m not sure why this happens, but it does. If we don't have the ifconfig bnep0 down line then we don't get an IP address. Maybe you could do a honeycomb version.

The current version does create the PAN connection. just no network connection because no IP address
[Nook Color Android Development] sinanju:
I'll try adding it tomorrow. It may work perfectly well that way on all versions. I'll PM you an APK to sideload and try out. If it works, I'll release an update.
[Nook Color Android Development] dj710:
Just wanted to say thank you. I appreciate all your help.
[Nook Color Android Development] sinanju:
PM has been sent
[Nook Color Android Development] cyberma007:
Can you please make this to work so it is on demand?

so it does not need to be on and off, from a widget?

Someone is doing that for a N900 and i have the scripts, but i am not a programer, you maybe can use it?

I would even pay for the app!!!

Thanks

Also I tried it on my honeycomb 3.2 tablet and i cant turn off widget, it stays green until i reboot
[Nook Color Android Development] sinanju:
Honeycomb doesn't work at the moment. I had planned to work on it last weekend, but hurricane prep got in the way and I only got power back today.

Based on comments left in the market, an on-demand feature is already on the list, but getting Honeycomb working first is my priority.
[Nook Color Android Development] cyberma007:
Great Thank you so much, You are the best, Love to beta test if you need anyone ;)
[Nook Color Android Development] izi975:
I have been testing the tethering. I have noticed the following needs to be done after starting the NC tether:

1. in the terminal you need to symply type in "ifconfig bnep0 down" and "dhcpcd bnep0"

after that e-mail starts to work (not gmail), opera works just fine, so does youtube, adroid market also works. I have succeded in getting tethering to work yesterday after reading through a lot of posts and also experimenting. It took a few tries to get it to work. I have tested the procedure this morning and it works.

I would be happy to test anythin if we can get this working on HoneyComb.

I have been testing this with my G-tab on FlasBack 7.2 and my SonnyErricson TM717.
[Nook Color Android Development] voided:
ConnectivityService status not updated with PAN

I suspect some of the apps (including the built-in google apps for gmail etc) does not work because they use the ConnectivityService to access the net, and since this method of reverse tethering doesn't change the connectivity state within this service, those apps still believe that there is no internet connection on the device.

See here for more information. Hopefully someone will fix this in the upcoming versions. Cheers

1