Win a copy of Classic Computer Science Problems in Swift this week in the iOS forum!

Mania Pawar

Greenhorn
+ Follow
since Jun 17, 2006
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 Mania Pawar

hi

any body say me how to import org.kxml2.io.*;

because i got error on this line they say package does not exist .

i am downlode that kxml2 jar file but i don't known how to use and where it add.

please help me because i am newer in j2me

thank you !

i am waitting here .........
11 years ago
When testing on 3230 I got one of these errors sometimes (most of the time when I fetch the contact list from phonebook and when i click on Add from contact button to add the contact number to the text (PHONENUMBER)):
- app crashed with message error "App.closed.jes-2a2.javax.microedition.lcdui1@1"
- same error with jes-140, jes-15f,...

Does someone know what it means ?
Thanks
11 years ago
hey all the expert guy

i am newer in j2me.

and

i am developing free sms sending application.
now problem is i want to use existing phone memory for reading sms and send from my application it is possible if yes then how.

and if u possible then send me sample code on that.

plz reply me i am waitting ur reply..........
thank u ......
11 years ago
hi everybody
thank for read my post.

i am creaded one application in j2me but now i want add flash screen in application when application how add this.

plz i am waitting ...
ok thanks!
11 years ago
hi all,

can i access hanset adress book in j2me application.

and plz send me sample code because i am newer in j2me.


plz send it i am waiting here....

thank u
11 years ago
i having one problem in following code

error "Uncaught exception java/lang/NullPointerException."

///////////////////httpconn.java /////////////

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

import java.io.*;
public class httpconn implements Runnable
{
private String url;
private InfoForm fmInfo;
private smsindya midlet;
protected writesms wrsms;

public httpconn(String url, InfoForm fmInfo1)
{
this.midlet = midlet;
this.url = url;
this.fmInfo = fmInfo1;
}

public void run()
{
parseNewsFeed();
}

public void start()
{
Thread thread = new Thread(this);
try
{
thread.start();
}
catch (Exception e)
{
fmInfo.setMessage("Fatal: Unable to start the SMSIndya.");
}
}

private void parseNewsFeed()
{

StreamConnection conn = null;
InputStream s = null;
StringBuffer b = new StringBuffer();
try
{

fmInfo.setMessage("trying to connect ...");
//error occur in this line
conn = (StreamConnection)Connector.open(url);

if (conn == null)
{
fmInfo.setMessage("no connection to \n" + url);
return;
}
else
{
fmInfo.setMessage("reading ...");
}

s = conn.openInputStream();
int ch;
while((ch = s.read()) != -1) {
b.append((char) ch);
}

if (b.toString()=="Blank Values")
{
fmInfo.setMessage(b.toString());
}
else
{
midlet.display.setCurrent(wrsms);
}
}
catch (Exception e)
{
fmInfo.setMessage("Error parsing XML!" + e.toString());
}
finally
{
try
{
if (conn != null)
{
conn.close();
}
if(s != null)
{
s.close();
}
}
catch (IOException ignored)
{
fmInfo.setMessage("IO exception" + ignored.toString());
}
}
}
}
//////////////////////////////////////////////

/*--------------------------------------------------
* InfoForm.java
*
* Extend Form component to show system/info messages
*-------------------------------------------------*/
import javax.microedition.lcdui.*;
public class InfoForm extends Form implements CommandListener
{
private Command cmBack;
private StringItem Message;
private smsindya midlet;
public InfoForm(smsindya midlet)
{

super("Information");

this.midlet = midlet;

cmBack = new Command("Back", Command.BACK, 2);
Message = new StringItem ("Please wait", "");

addCommand(cmBack);
append(Message);
setCommandListener(this);
}

public void commandAction(Command c, Displayable s)
{
if (c == cmBack)
{

midlet.display.setCurrent(midlet.fmsmsindya);
}


}

public void setMessage(String Message)
{
this.Message.setText(Message);
midlet.display.setCurrent(this);
}
}
/********************************************************************/

fmInfo.setMessage("trying to connect ...");
//error occur in this line

plz reply me i am waitting ur response.
thanks!
11 years ago
i am devloped one aplication to send free sms from handset to handset but i am having one problem that

how to access address book form handset.

i am get one solution but i am newer for j2me

that solution is JSR75 specification
but who to use this

plz send me reply and sample code if u possible.

thanks
12 years ago
thank for reply

i am change as ur replay but i am found another error

javax.microedition.io.ConnectionNotFoundException: TCP open

if((i1 = httpconnection.getResponseCode()) != 200)

on this line

plz replay

thanks
12 years ago
i am try to post data from j2me client side through http connection but code alway get exception massage i am comment that code plz help.because i am new in j2me


thank
[ June 19, 2006: Message edited by: Mark Spritzler ]
12 years ago
hi i am try to run this program but i have got one warning plz help me .

import javax.microedition.midlet.*;

import javax.microedition.lcdui.*;

import javax.microedition.io.*;

import java.io.*;

public class HttpGET extends MIDlet implements CommandListener {
/* * the default value for the url string is * http://64.28.105.110/servlets/webyu/Chapter7Servlet?request=gettimestamp * * user can change it to some other urls within the application * */
private static String defaultURL = "http://www.smsindya.com/app/forlogin.asp?userid=919892790096&password=26201439&isdcode=91";

// GUI component for user to enter web url
private Display myDisplay = null;

private Form mainScreen;

private TextField requestField;

// GUI component for displaying web page content
private Form resultScreen;

private StringItem resultField;

// the "send" button used on mainScreen
Command sendCommand = new Command("SEND", Command.OK, 1);
// the "back" button used on resultScreen
Command backCommand = new Command("BACK", Command.OK, 1);
public HttpGET(){
// initializing the GUI components for entering web urls
myDisplay = Display.getDisplay(this);
mainScreen = new Form("Type in a URL:");
requestField =new TextField(null, defaultURL,100, TextField.URL);
mainScreen.append(requestField);
mainScreen.addCommand(sendCommand);
mainScreen.setCommandListener(this);
}
public void startApp() {
myDisplay.setCurrent(mainScreen);
}
public void pauseApp() { }
public void destroyApp(boolean unconditional) { }
public void commandAction(Command c, Displayable s) {
// when user clicks on "send" button on mainScreen
if (c == sendCommand) {
// retrieving the web url that user entered
String urlstring = requestField.getString();
// sending a GET request to web server
String resultstring = sendGetRequest(urlstring);
// displaying the page content retrieved from web server
resultScreen = new Form("GET Result:");
resultField = new StringItem(null, resultstring);
resultScreen.append(resultField);
resultScreen.addCommand(backCommand);
resultScreen.setCommandListener(this);
myDisplay.setCurrent(resultScreen);
} else if (c == backCommand) { // do it all over again
requestField.setString(defaultURL);
myDisplay.setCurrent(mainScreen);
}
} // send a GET request to web server

public String sendGetRequest(String urlstring) {
HttpConnection hc = null;
DataInputStream dis = null;
String message = "";
try { /* openning up http connection with the web server * when the connection is opened, the default request * method is GET */
hc = (HttpConnection) Connector.open(urlstring);
// establishing input stream from the connection
dis = new DataInputStream(hc.openInputStream());
// reading the response from web server character by character
int ch;
while ((ch = dis.read()) != -1) {
message = message + (char) ch;
} } catch (IOException ioe) {
message = "ERROR";
} finally {
try {
if (hc != null)
hc.close();
} catch (IOException ignored) {}
try { if (dis != null)
dis.close();
} catch (IOException ignored) {}
}
return message;
}
}

i have got warning

Warning: To avoid potential deadlock, operations that may block, such as
networking, should be performed in a different thread than the
commandAction() handler.

plz help
my email :- ilumania@yahoo.co.in

thanks!
12 years ago