BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 01-21-2010, 09:42 AM   #1 (permalink)
Knows Where the Search Button Is
 
Join Date: Dec 2009
Model: 7100T
PIN: N/A
Carrier: java
Posts: 31
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default division by zero

Please Login to Remove!

hi to all,

i am implementing the listener for missed call and incoming SMS. i have put both the listener in thread. so when i am running this application on simulator and if incoming call or missed call come first and after that any time SMS comes then it is working fine. But when SMS is coming first on simulator before any call or missed call then "division by zero" error is coming.

the code for the sms listener is below

messageflag = false;
MessageConnection _mc = (MessageConnection)Connector.open("sms://:0");
MessageListener l= new MessageListener()
{

public void notifyIncomingMessage(MessageConnection conn) {

messageflag = true;
Date date1 = new Date();
timeon = date1.getTime();
}

};
if(mc != null)
mc.setMessageListener(l);


if(messageflag == true)
{
LED.setColorConfiguration(500,500,0x00009900);
LED.setState(LED.STATE_BLINKING);
Date date2 = new Date();
timeoff = date2.getTime();
if(timeoff - timeon > 10000)
{
messageflag = false;
}
}

can somebody help me out for this problem.

with thanx and regards
shakeel
Offline  
Old 01-22-2010, 09:37 AM   #2 (permalink)
Knows Where the Search Button Is
 
Join Date: Dec 2009
Model: 7100T
PIN: N/A
Carrier: java
Posts: 31
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default division by zero

hi,


now i am able to debug my application while sending sms. now i have put only one listener that is messagelistener.

when a new sms arrives on simulator. i am trying to see varaibles in the variables window. there is one error which is like this "com.sun.jdi.InternalException:get error code in reply:252 occured while retreiving array length". is it the error of debugger or is it due to no reply for sms from simulator?it is coming only for messagelistener.


i am not understanding what is the mean of this error?



with thanx and regards

shakeel
Offline  
Old 01-23-2010, 04:14 AM   #3 (permalink)
Knows Where the Search Button Is
 
Join Date: Dec 2009
Model: 7100T
PIN: N/A
Carrier: java
Posts: 31
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default division by zero

Hi to all,

Now i have implemented the message listener out of thread in the same manner as in the above post. but still i am getting the same error "division by zero".
while simulating the application, i am sending sms from another simulator on port 5000 and in the project configuration i have set the source port as 5000. what is going wrong in my appraoch i don't know.can somebody help me out.

with thanx and regards
shakeel
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Copyright 2004-2014 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.