Ankur Shah

Greenhorn
+ Follow
since Nov 09, 2001
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
(keep public parts private until JForum day)
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt
Moderation Tools

Recent posts by Ankur Shah

I really wish someone would reply to me...even if you do not know it just so I know I'm not being ignored. I've been writing for the past few weeks with now response to me questions at all.
Thank You
Ankur Shah
I think the problem originates when trying to execute:
serverSocket.accept();
Can anyone tell me what this error message means:
java.net.ConnectException
at java.net.PlainSocketImpl.connect (Native
Method)
at java.net.PlainSocketImpl.connect (bytecode 33)
at java.net.PlainSocketImpl.connect (bytecode 9)
at java.net.Socket.<init> (bytecode 96)
at java.net.Socket.<init> (bytecode 9)
at clientTest.main (bytecode 31)
(serverSocket.accept)
(clientTest is what I wrote)
I am having a ServerSocket problem using Jeode EVM on iPaq. It works correctly through the first run but with multiple runs it eventually returns:
java.net.ConnectException

Although it does run correctly with with JVM on my PC I think the problem is with th Jeode EVM I'm not sure though. If anyone knows what the problem is or can direct me please help me out.
Thanks
Ankur
I am having a ServerSocket problem using Jeode EVM on iPaq. It works correctly through the first run but with multiple runs it eventually returns:
java.net.ConnectException

Although it does run correctly with with JVM on my PC. If anyone knows what the problem is or can direct me please help me out.
Thanks
Ankur
16 years ago
Javaranch
I am having a socket problem with Jeode on iPaq. I have a client program and a server program which I have running on the same iPaq machine. All the server side does is start a ServerSocket and listens for a Socket from the client side. The client side just makes a Socket object to the same ip/port.
When I initially run the program the socket is successfully accepted on the server side. However when I close the client and server programs and rerun them multiple times I eventually (2nd - 4th try) get an error on the client side saying:
java.net.ConnectException
I am cutting and pasting the client and server side below.
I think it has something to do with the ServerSocket but I'm not sure. I would greatly appreciate help on this problem.
Thanks
Ankur Shah

CLIENT SIDE---------------------------------------
import java.io.*;
import java.net.*;

public class clientTest
{

public static void main (String[] args)
{
System.out.println("Client Started...");
Socket sock = null;
try
{
sock = new Socket("127.0.0.127",500);
System.out.println("Socket Created Successfully);
}
catch(IOException e)
{
System.out.println(e);
}
try
{
while(true)
{
Thread.sleep(500);
}
}
catch (InterruptedException e){}
}
}

SERVER SIDE---------------------------------------
import java.io.*;
import java.net.*;
public class serverTest
{
public static void main (String args[])
{
System.out.println("Server Started...");
ServerSocket ss = null;
try
{
InetAddress inet = InetAddress.getByName("127.0.0.127");
ss = new ServerSocket(500,20,inet);
System.out.println("ServerSocket listening on:\n"+ss.getInetAddress()+"/"+ss.getLocalPort());
ss.accept();
System.out.println("Socket Accepted");
}
catch(IOException e)
{
System.out.println(e);
}
catch(Exception e)
{
System.out.println(e);
}

try
{
while(true)
{
Thread.sleep(500);
}
}
catch (InterruptedException e){}
}
}
In the middle of my MIDlet program I'm getting an "heap out of memory message" do you know what I could do to alleviate this situation.
Ankur
16 years ago
I have an MIDP application running on Palm that has a good number of Form and List objects. My question was does anyone know any code optimization tips specific to MIDP or any links to sites concerning it?
Thanks
Ankur
16 years ago
In my program I need to go back and forth from a Form page and a Canvas page.
Form - has TextField object as well as Back and Quit buttons
Canvas - has a drawing and 2 buttons
My problem is:
1)When I start up the application I get the Canvas screen
2)When I push the button to get to the Form the screen for Form comes up fine
3)When I push the Back button from Form I come back to the Canvas page
4)Now when I try to push the button for Form screen again (#2) nothing happens and I can't get the form screen a second time
PLEASE HELP ME OUT SOMEONE!!!
16 years ago
All I want to do is show a rectangle on a form with a textfield and buttons and everything else. I want Text to be displayed within the rectangle as well. How can I do this? What is the code for it?
Ankur

Originally posted by Robert Hendry:
Hello,
I am trying to left align an Image on a form but it ALWAYS shows up on the right. The Code is
Form frmLogin = new Form("AMOS Login");
Image img ;
try{
img = Image.createImage("/midp/uidemo/anl.png");
frmLogin.append(new ImageItem,"",img,ImageItem.LAYOUT_LEFT,""));
}
catch(Exception ex){
frmLogin.append("Cannot Load Image");
}
When displayed on the Palm, it looks like the layout is meaning less. The image is on the right all the time. Any ideas how to get it on the RIGHT??
Tx!
Bob....


16 years ago
Hello Javaranch
I'm doing development using MIDP for PalmOS. I'm familiar with how MIDlets work but I had a question about Graphics. Right now I have a Form object which displays the following objects: StringItem, TextField, a few Button Commands.
What I want to do is draw a rectangle on the upper half of the screen and the StringItem text be visible. So basically I want a rectangle drawn around the text that I display. What do I need to add codewise to add a rectangle. Can you give me a few lines of code to get me started?
Thanks
Ankur Shah
16 years ago