regarding HTTPClient : How to get the HTTP request posted by the native browser

by Viju » Fri, 20 May 2011 09:34:00 GMT


Sponsored Links
 Hi,

Is it possible to get all the HTTP URL request triggered by the
browser (Apache) from my client application ? If then, can you please
tell me the framework API which gives me the URL ?

I'm developing some kinda of HTTP sniffer application for android
which will log all the HTTP Url request made by the native browser
(Apace) and store it in a local file.

-- 



Re: regarding HTTPClient : How to get the HTTP request posted by the native browser

by Jens » Fri, 20 May 2011 17:31:40 GMT


 Apache - as in the HttpClient, org.apache.http.* or the web server?
Further - the browser in the phone typically doesn't use the apache
HTTP client library, it's JNI to WebKit.

The good thing is that you're not going to be able to sniff either
without building your own firmware and flashing the phone.




-- 


Sponsored Links


Other Threads

1. How to perform socket communication

Hi
I have done socket communication in a single application it is working fine
But my requirement is i have opened two emulators and i am able to send sms
between those two.
Now i want to run server in one emulator(myavd-5554)
and client on another emulator(myavd1-5556)
I have used the following code
on Serverside
public class TCPServerActivity extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        Thread sThread = new Thread(new TCPServer());
        sThread.start();
        try {
            Thread.sleep(90000);
        } catch (InterruptedException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
       Log.d("","Server activity closed");
    }
}



public class TCPServer implements Runnable{

    public static final String SERVERIP = "127.0.0.1";
    public static final int SERVERPORT = 3000;

    public void run() {
         try {
              Log.d("TCP", "S: Connecting...");

              ServerSocket serverSocket = new ServerSocket(SERVERPORT);
              while (true) {
                 Socket client = serverSocket.accept();
                 Log.d("TCP", "S: Receiving...");
                 try {
                      BufferedReader in = new BufferedReader(new
InputStreamReader(client.getInputStream()));
                      String str = in.readLine();
                      Log.d("TCP", "S: Received: '" + str + "'");

                    } catch(Exception e) {
                        Log.e("TCP", "S: Error", e);
                    } finally {
                         client.close();
                         Log.d("TCP", "S: Done.");
                    }

              }

         } catch (Exception e) {
           Log.e("TCP", "S: Error", e);
         }
    }
}



on client side
public class TCPClientActivity extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        Thread cThread = new Thread(new TCPClient());
        cThread.start();

        Log.d("","Client activity closed");

    }
}

public class TCPClient implements Runnable {

     public static final String SERVERIP = "127.0.0.1";
        public static final int SERVERPORT = 3000;

    public void run() {
         try {

           InetAddress serverAddr = InetAddress.getByName(SERVERIP);

           Log.d("TCP", "C: Connecting...");
           Socket socket = new Socket(serverAddr, SERVERPORT);
           String message = "Hello from Client";
               try {
                Log.d("TCP", "C: Sending: '" + message + "'");
                PrintWriter out = new PrintWriter( new BufferedWriter( new
OutputStreamWriter(socket.getOutputStream())),true);

                out.println(message);
                Log.d("TCP", "C: Sent.");
                  Log.d("TCP", "C: Done.");

             } catch(Exception e) {
                 Log.e("TCP", "S: Error", e);
                } finally {
                  socket.close();
                }
         } catch (Exception e) {
              Log.e("TCP", "C: Error", e);
         }
    }
}


So i run Server application on 5554 first and then client application on
5556
But i didn't receved the message
Please help me
Thanks in advance

-- 

2. AudioTrack - Clicking Proplem

I am trying to resolve the clicking problem while using the
AudioTrack. It takes place only when playing the first part of the
wave (pcm) buffer when the offset to the write is  0 (zero).

            track.write(buffer, offset, minBufferSize);

 It tells me that there is something wrong with the pcm data. Could it
be because the wave data, I generate using Audacity, has some header
as opposed to the pure pcm which does not? I was looking for the
converter tools to generate pure pcm but found none. Applications I
found generate only  wave data so I am not able to test this
assumption. At this point I am sure that filling the buffer is
correct. Any ideas?

Roman

-- 

3. Synchronizing AudioTrack and AudioRecord

4. Perkenalan Juga :)

5. Android Apps: Qibla Compass

6. Adding some changes to AudioHardwareAlsa.cpp file

7. Simple question... how do I open the browser?