Saturday, December 3, 2011

Cursed ad-hoc networking problem on Android


It is stil a problem to connect my Samsung Galaxy Tab P-1010 (Wi-fi only) to Internet
through my cell phone. Since Google does not do anything about this, people individually
seek for a solution for this. I have tried many compiled wpa_supplicant.so files on my device,
unfortunately, the only picture that I saw was a tablet computer without wi-fi support.

I have a new idea about this. I know it is not an elegant solution like debugging the source code of wpa_supplicant
and compile it for several devices.  But this is worth to share.

Firstly, suppose that we have an Android device with Wi-fi feature only and call it "Android Device". And suppose that we have a Java installed cell phone (it would be an S6 installed Nokia or Blackberry or an android cell-phone), and we will call it "Cell Phone". The development steps
for my solution are given below:

(Step 1) Implement a tiny http proxy for the Android Device. Suppose that, it listens from the port 8088.
(Step 2) Set the proxy settings on the web browser of Android Device, "localhost" for host and "8088" for port.
(Step 3) Implement a tiny JavaME application, which accepts URL's that sent by (Step 1) through a bluetooth connection, and downloads the
content of the accepted URL's and sends the content using the same bluetooth connection to the http proxy defined in (Step 1).


Now, we can expand those steps for our idea. Suppose that, the http proxy given in (Step 1) is connected to the JavaME application (Step 3) with bluetooth. There are many bluetooth protocols but I think (but I am not really sure about that)
the rfcomm type connection is the common type in both the JavaME and Android.

Whenever the proxy in (Step 1) accepts an URL, it sends this request to the JavaME application using the bluetooth connection.
The application defined in (Step 3) has an internet data plan, so it downloads the content and sends them to the proxy in (Step 1). 

Ok, not the best way, but it seems it would work.

Maybe, somebody wants to implement this.

3 comments:

  1. It is super frustrating. I've been trying unsuccessfully to do something similar...

    - Test a localhost site running on my Macbook Pro on my HTC Evo over an ad hoc network. (I've been able to test over a real wi-fi network, but I need to be able to pull the local site up on my phone when without a true wi-fi network or when that one is firewalled). It seems like it's turned off by default on Android.

    Have any ideas for getting this to work? There has to be a solution (short of rooting)?

    ReplyDelete
  2. Does your blog have a contact page? I am having problems locating it but, I’d like to shoot you an e-mail. I’ve got some ideas for your blog you might be interested in hearing. Either way, great site and I look forward to seeing it grow over time.

    ReplyDelete
  3. Thank you! It is a great reply! We are happy to see that kind of comments here.

    There are many authors who have their own expertness in some special subject in Practical Code Solutions.

    Our mail address is stdioe@gmail.com.
    We will be glad to hear your ideas.


    jbytecode, For the Practical Code Solutions Team

    ReplyDelete

Thanks