Hello Sir
I am new with J2ME and eclipseIDE I have completed my Mobile Application approximately
but now I face a problem I have to connect it first and when exit I minimized it and messaging is continuous now I wish to receive these messages and When I restore it then All updates is taken by it during restoring but in this it display an java.IO.lang error I have tagged code with this pl help me in this because this is the only part is remaining in my application
the code is given below
public void startApp() {
String connectList[];
connectList = PushRegistry.listConnections(true);
if (connectList == null || connectList.length == 0){
try{
_display = Display.getInstance();
ImplementationFactory.setInstance(new MyImplementationFactory());
VKBImplementationFactory.init();
Display.init(this);
try{
incomingConnection = (MessageConnection) Connector.open(ConnectionString);
this.incomingConnection.setMessageListener(this);
}catch(Exception e){
Dialog.show("SMS Exception","IO Exception!"+e.toString(),"OK", null);
}
setDefaultImage();
screens.main_Screen();
screens.mainMenu.show();
}catch(Exception ex){
Dialog.show("Application Error","Low Memory, Minimum requirement is 800 kb "+ex.getMessage(),"Ok", null);
}
} else{
_display = Display.getInstance();
ImplementationFactory.setInstance(new MyImplementationFactory());
VKBImplementationFactory.init();
Display.init(this);
_display.showNotify();
_display.restoreMinimizedApplication();
add_Push_Registry();
}
}
///////////this is for minimizing and exit
public void close_App(){
System.gc();
_display.minimizeApplication();
}
/////////this is for setting push registry for restoring ////////
private void add_Push_Registry() {
try{
String MIDletRegistered = PushRegistry.getMIDlet(ConnectionString);
incomingConnection = (MessageConnection) Connector.open(ConnectionString);
this.incomingConnection.setMessageListener(this);
if(MIDletRegistered == null){
Dialog.show("IS Zigbee MIDlet Registered","NULL","OK", null);
PushRegistry.registerConnection(ConnectionString, GetMIDletClassName(), "*");
}else{
if(!MIDletRegistered.equals(GetMIDletClassName()))
Dialog.show("Midlet listen","Port for receiving SMS is already occupied by some other application",
"OK", null);
}
}catch(Exception e){
Dialog.show("EX","IO Exception!"+e.toString(),"OK", null);
}
}
thanks
Om Parkash J2ME developer