View Single Post
Old 10-05-2010, 12:53 PM   #9
Junior Member
th0br0 began at the beginning.
Posts: 3
Karma: 10
Join Date: Oct 2010
Device: Kindle 3G+WiFi
Excellent find. This will get the MPD client I had in mind for a long time done real sone
Should you be evaluating connecting to some non-standard port (such as MPD in my case) it truly is a shame that they only seem to support http and https.

However, what you can still do stuff like this:

	KTextArea ktx = new KTextArea();

	public void start() {
		try {

					new ConnectivityHandler() {

						public void disabled(NetworkDisabledDetails arg0)
								throws InterruptedException {
							// TODO Auto-generated method stub


						public void connected() throws InterruptedException {
							try {
								URL testUrl = new URL("http", "", 6600,
								URLConnection con = testUrl.openConnection();
								DataInputStream dis = new DataInputStream(con
								String inputLine;

								while ((inputLine = dis.readLine()) != null) {
							} catch (Exception e) {
								ktx.append("exception: " + e.getMessage());

		} catch (Exception e) {
			System.out.println("Error Connecting:" + e.getMessage());
Of course the device still sends that bad HTML Header
But after that

Mind that the nasty downside to this is that you can't be on usbnet while doing this...
Seems that the Kindle thinks that there is no W-Lan connection if usb0 is up

Sucks from my point of view, especially as we have to do the connection via that connectivity handler but it can't be helped i guess.

Last edited by th0br0; 10-05-2010 at 01:42 PM.
th0br0 is offline   Reply With Quote