Parth Mankad

Greenhorn
+ Follow
since Jan 27, 2003
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Parth Mankad

Hello everybody

i need to send sms from my pc to a mobile phone.the mobile phone will be connected to the pc through data cable.what i want is that the mobile phone that is connected to the pc should act as an intermediary.means that i will send a message from my pc which will go to the mobile phone that is connected to the pc and then the mobile will send it to the actual recepient.plz tell me how to do it

thanx
parth
[ May 31, 2006: Message edited by: Bear Bibeault ]
17 years ago
hello payal

i tried to use the code from the link given by u.but i am getting java.lang.outofmemory exception.plz help

parth
18 years ago
Hello everybody

i am developing a small application in which i download a .jpg image from web and display it on the mobile.that part works fine.now i want to add Zoom In/Zoom Out feature in my application.Plz can someone tell me how to do it and integrate it with my exisiting code.below is my code where in i get a image from web.

import java.io.*;
import javax.microedition.io.*;
import javax.microedition.lcdui.*;
import javax.microedition.midlet.*;

public class Zoom extends MIDlet implements CommandListener
{
private Display display;
private int screenHeight;
private int screenWidth;
private int numColors;
private StringItem message;
private byte[] data;
private Image image,displayed;
private ShowImage showimage;
private TextBox entryForm;
private Command okCommand = new Command("OK", Command.OK, 1);
private Command zoomCommand=new Command("ZOOM",Command.SCREEN,2);
private Command exitCommand = new Command("EXIT", Command.EXIT, 2);

public Zoom()
{
}

protected void startApp() throws MIDletStateChangeException
{
initMIDlet();
HttpConnection conn = null;
try
{
conn =(HttpConnection)Connector.open("url");
int rc = conn.getResponseCode();
if (rc == HttpConnection.HTTP_OK)
{
try
{
DataInputStream din =new DataInputStream(conn.openInputStream());
data = new byte[(int)conn.getLength()];
din.readFully(data);
din.close();
}
catch (IOException e)
{
}
new
}
else
{

}
conn.close();
}
catch (IOException e)
{

}

}
public void exitMIDlet(){
notifyDestroyed();
}
private void initMIDlet()
{
display = Display.getDisplay(this);
entryForm = new EntryForm();
display.setCurrent(new DummyCanvas());

}

public void commandAction(Command c, Displayable d)
{
if (c == okCommand)
{
display.setCurrent(showimage);
}

else
{
exitMIDlet();
}
}

class DummyCanvas extends Canvas
{
protected void paint(Graphics g)
{
screenHeight = getHeight();
screenWidth = getWidth();
numColors = display.numColors();

// Go directly to the main screen

display.setCurrent(entryForm);
}
}
class EntryForm extends TextBox
{
EntryForm()
{
super("Enter a URL", "image",20, 0);
addCommand(exitCommand);
//addCommand(sendCommand);
setCommandListener(Zoom.this);
}
}


// Show the image...

class ShowImage extends Canvas
{

ShowImage(byte[] imageData )
{
image = Image.createImage( imageData,0,imageData.length );
display.setCurrent( this );
addCommand(okCommand);
addCommand(zoomCommand);
addCommand(exitCommand);
setCommandListener( Zoom.this );
}

protected void paint( Graphics g )
{
g.drawImage(image, 0, 5,g.TOP | g.LEFT );
}


}
protected void pauseApp(){
}

protected void destroyApp( boolean
unconditional )
throws MIDletStateChangeException {
exitMIDlet();
}


}

thanx
parth
18 years ago
hello debojit

i have no idea of using WML.can u plz help me out with it.

thanx
parth
18 years ago
hello everybody

I have windows 2000 server and Tomcat 4.0.1 installed on it and i have a folder called test in tomcat in which i have a image file and a jsp file in which i have a button called Download file.it is a gif file.what i want is that when someone access the jsp page through there MOBILE and clicks on the download file button then the image should be saved on the MOBILE phone.how can i do this.
plz help

parth
18 years ago
hello everybody

I have windows 2000 server and Tomcat 4.0.1 installed on it and i have a folder called test in tomcat in which i have a image file and a jsp file in which i have a button called Download file.it is a gif file.what i want is that when someone access the jsp page through there MOBILE and clicks on the download file button then the image should be saved on the MOBILE phone.how can i do this.
plz help

parth
18 years ago
hello everybody

I have windows 2000 server and Tomcat 4.0.1 installed on it and i have a folder called test in tomcat in which i have a image file and a jsp file in which i have a button called Download file.it is a gif file.what i want is that when someone access the jsp page through there MOBILE and clicks on the download file button then the image should be saved on the MOBILE phone.how can i do this.
plz help

parth
18 years ago
JSP
i have an applet which runs only in JRE1.3.1. if i user a higher or lower version then it hangs.plz tell me how can i make sure that my applet runs on all possible versions of jre.

thanks
18 years ago
this is my server code
import java.net.*;
import java.io.*;
import java.util.*;
import java.lang.*;



class Server1
{

Socket soc;
ServerSocket sersoc;
InputStream inStream,iStream;
DataInputStream inDataStream,iDataStream;
ObjectInputStream inObjStream;
OutputStream outStream;
DataOutputStream outDataStream;
ObjectOutputStream outObjStream;
int j;
public void runServer()
{
try
{
sersoc=new ServerSocket(2000);
System.out.println("Server Started");
while(true)
{
soc=sersoc.accept();
System.out.println("Waiting to Accept Data");
getFile();

}
}
catch(Exception e)
{
System.out.println("This is error generated by function runServer()");
e.printStackTrace(System.out);
}

//soc.close();
}
public byte[] ConvertFile(String filelocation) throws Exception
{
try
{
File f = new File(filelocation);
System.out.println("file length"+ f.length());
byte[] b = new byte[(int)(f.length())];
FileInputStream in = new FileInputStream(filelocation);
in.read(b);
return b;
}
catch(Exception e)
{
System.out.println("This is error generated by function ConvertFile()");
e.printStackTrace(System.out);
return null;
}
}

public void getFile()
{
System.out.println("get file called");
try
{

DataOutputStream fout = new DataOutputStream(soc.getOutputStream());
System.out.println(ConvertFile("c:\\test.jar"));
byte[] filebits = ConvertFile("c:\\test.jar");
fout.writeInt(filebits.length);
fout.write(filebits);
fout.flush();

}
catch(Exception e)
{
System.out.println("This is error generated by function getFile()");
e.printStackTrace(System.out);
}
}



public static void main(String[] args)
{
Server1 ms=new Server1();
ms.runServer();
System.out.println("call runserver");
}
}

and this is my client code

import java.net.*;
import java.io.*;
import java.util.*;
class Client1
{
Socket connection;
InputStream inStream;
DataInputStream inDataStream;
ObjectInputStream inObjStream;
OutputStream outStream,oStream;
DataOutputStream outDataStream,oDataStream;
public void ConvertFileBack(byte[] in, String outfile) throws Exception
{
System.out.println("***outfile***"+outfile);
FileOutputStream fos = new FileOutputStream(outfile);
fos.write(in);
fos.close();

}


public void connectServer()
{
try
{
connection = new Socket ( "10.0.0.56",2000 );
DataInputStream dis = new DataInputStream(connection.getInputStream());
byte[] fileenc = new byte[dis.readInt()];
dis.read(fileenc);
ConvertFileBack(fileenc, "C:\\test\\test.jar");
}
catch(ConnectException ce){
System.out.println( "Server is Closed\n" );
System.exit ( 1 );
}
catch ( IOException except) {
System.out.println( "Error connecting to server\n" );
except.printStackTrace ();
System.exit ( 1 );
}
catch ( Exception e) {
System.out.println( "Error " );
System.exit ( 1 );
}


}
public static void main(String[] args)
{
Client1 cs=new Client1();
cs.connectServer();
}
}
plz see if u can find any bug in the above code
18 years ago
I have a jar file called test.jar on my server and i am sending that file on my client.the client-server communication is through socket.the file gets created on the client howerver when i unjar the file it extracts only some files and then gives me the error

"java.io.eofexception:unexpected end of ZLIB input steram".
plz tell me how to solve this problem.can somebody plz send me the code for this.

thanx
18 years ago
i want to download files from my server using an applet.the files need to be downloaded to any location on the client.however the user should not be givent the save file dialog box.plz help me how can i do this
18 years ago
the.dbf file is being quiered through jsp page
18 years ago
hi all

i am using Tomcat 4.0 and jsp wherein i upload a .dbf file.the file gets uploaded poperly and i am also able to view the contents of the file.i another .dbf file i uploaded then it is always saved with the same name so evertime i upload a dbf file the previous filegets overwritten.my problem i s that the file gets overwrriten properly but tomcat shows me the data of the previous file and not the new file that has been uploaded.i have tried to delete the file and re-create it every time it is uploaded but still i am facing the same problem.i have also put the following in my jsp page


response.setDateHeader("Expires", 0);
response.setHeader("Cache-Control", "no-store, no-cache, must-revalidate");
response.addHeader("Cache-Control", "post-check=0, pre-check=0");
response.setHeader("Pragma", "No-cache");

but still the same problem.plz can u tell me the solution for this
18 years ago
I have a java program and i am running it with a help of batch file.but i wnat that my the process cmd.exe should not be seen in the task manager.can somebody plz help me with this.
19 years ago
i am using Jpcap api library for packet captuirng.i am able to find the device on my machine with the finddevice() function.it shows me

\Device\NPF_GenericNdisWanAdapter.but when i try to open the device it gives me error.

net.sourceforge.jpcap.capture.CaptureDeviceOpenException: Error opening adapter:
The system cannot find the device specified
plz help me in solving this problme