Tuesday, May 6, 2008

J2ME Proxifier

Here is my first j2me library for j2me developers...This library will mainly help airtel/gprs programmers who is interested in developing applications for mobile phones.
This library will provide a tool like proxyfier for j2me applications.Jar archive consists of two classes 'settings' and 'TCPconnection' in org.proxybypass package

Settings Class
Mainly to specify the proxy and proxy port number
Constructor
settings set= new settings(String proxyip, String proxyport)

note port is of String type

TCPconnection
Core of the Library to provide the tcp connection through the proxy

Constructor
TCPconnection mytcp = new TCPconnetion( Settings set,String server, String port)
set :is the settings class with proxy ip and porxy port
server :-Server to communicate with
port :- Port of the server

Methods
  • boolean makeinit()
method to initialize the connection returns true when successfully connected else returns false
this should called before calling any other methods given below
  • InputStream getInputStream()
Method to get the input stream for reading from server

  • OutputStream getOutputStream()
Method to get Output stream for writing to the server

Tough this will allow any tcp connections, to achieve a succesful http communication we need some more tricky manipulation in the http request headers abt that i will disscuss later


Library Downlaod is available here