Welcome to the Official BlackBerry Support Community Forums. This is your resource to discuss support topics with your peers, and learn from each other. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Java Development

Reply
New Developer
moshlp
Posts: 15
Registered: 01-27-2010
My Carrier: AT&T
Accepted Solution

9500 simulator auto hangs up call

[ Edited ]

hi, I've developed an app that generates a call through code:

 

PhoneArguments pa = new PhoneArguments(PhoneArguments.ARG_CALL, newNumber);

Invoke.invokeApplication(Invoke.APP_TYPE_PHONE, pa);

 

it works in previous version simulators and even in 9530, but in 9500 when the new number is dialed, it hangs up immediately.As a matter of fact, it goes to callDisconnected(int callId) method.  Any thoughts?

thanx

 

Please use plain text.
Administrator
MSohm
Posts: 10,873
Registered: 07-09-2008
My Carrier: Bell

Re: 9500 simulator auto hangs up call

What BlackBerry device software version are you testing on?  You can find this under Options, About on the BlackBerry Smartphone.  Does this also occur when creating a call using the Phone application?

 

Try running the clean.bat file located in the simulator directory to reset the simulator back to its default state.

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Found a bug? Report it using the Issue Tracker
Please use plain text.
New Developer
moshlp
Posts: 15
Registered: 01-27-2010
My Carrier: AT&T

Re: 9500 simulator auto hangs up call

thanx for answering....the version is 5.0.0.252 and using the Phone application works fine,and even after running clean.bat it's still hanging up the second number...I'm using net.rim.eide.componentpack4.5.0_4.5.0.16...but it works on 9530, that's weird.., my boss wants to try it on the Storm model, that is 9500 and 9530, right?

 

thanx

Please use plain text.
Administrator
MSohm
Posts: 10,873
Registered: 07-09-2008
My Carrier: Bell

Re: 9500 simulator auto hangs up call

I tried the same BlackBerry Smartphone simulator, but was unable to reproduce this.  Do you get a dialog box when you attempt the phone call?  What Windows OS are you using?

 

You have the model numbers correct.  The BlackBerry 9500 and 9530 both refer to the Storm.  The BlackBerry Storm 2 is the 9550.

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Found a bug? Report it using the Issue Tracker
Please use plain text.
New Developer
moshlp
Posts: 15
Registered: 01-27-2010
My Carrier: AT&T

Re: 9500 simulator auto hangs up call

no alert box., just the display shows Call Disconnected....I'm using Windows Seven 32bits...what OS did you try it on?...thanx

Please use plain text.
New Developer
moshlp
Posts: 15
Registered: 01-27-2010
My Carrier: AT&T

Re: 9500 simulator auto hangs up call

also tried it on XP 32bits and same thing

Please use plain text.
New Developer
moshlp
Posts: 15
Registered: 01-27-2010
My Carrier: AT&T

Re: 9500 simulator auto hangs up call

i'll post my code:

 

/**
 * 
 */
package com.blackberry.test;

import java.util.Enumeration;

import javax.microedition.pim.Contact;
import javax.microedition.pim.ContactList;
import javax.microedition.pim.PIM;
import javax.microedition.pim.PIMException;
import javax.microedition.pim.PIMItem;

import net.rim.blackberry.api.invoke.Invoke;
import net.rim.blackberry.api.invoke.PhoneArguments;
import net.rim.blackberry.api.pdap.BlackBerryContactList;
import net.rim.blackberry.api.phone.Phone;
import net.rim.blackberry.api.phone.PhoneCall;
import net.rim.blackberry.api.phone.PhoneListener;
import net.rim.device.api.system.EventInjector;
import net.rim.device.api.ui.Keypad;
import net.rim.device.api.ui.UiApplication;
import net.rim.device.api.ui.container.MainScreen;

public class Test extends UiApplication {

	public static void main(String[] args) {
		Test theApp = new Test();
		theApp.enterEventDispatcher();
	}

	public Test() {
		pushScreen(new Express());
	}

}

class Express extends MainScreen implements PhoneListener {

	private boolean is111 = false;
	private static String number = "111";
	private static String newNumber = "222";

	public Express() {

		super();

		Phone.addPhoneListener(this);

	}



	public void callEndedByUser(int callId) {
		
		if (is111) {
		PhoneArguments phoneCallArgs = new PhoneArguments(
			PhoneArguments.ARG_CALL, newNumber);
		Invoke.invokeApplication(Invoke.APP_TYPE_PHONE, phoneCallArgs);
		is111 = false;
		
		}
	}



	public void callInitiated(int callId) {

		PhoneCall call = Phone.getCall(callId);
		String c = (String) call.getDisplayPhoneNumber();
		String call2 = "";
		for (int i = 0; i < c.length(); i++) {
			if (Character.isDigit(c.charAt(i))) {			
				call2 += c.charAt(i);
			}
		}
		if (call2.equalsIgnoreCase(number)) {
			is111 = true;
			EventInjector.KeyCodeEvent ev = new EventInjector.KeyCodeEvent(
					EventInjector.KeyCodeEvent.KEY_DOWN, (char) Keypad.KEY_END,
					0);
			EventInjector.KeyCodeEvent ev2 = new EventInjector.KeyCodeEvent(
					EventInjector.KeyCodeEvent.KEY_UP, (char) Keypad.KEY_END, 0);
			try {
				Thread.sleep(1000);
			} catch (InterruptedException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			EventInjector.invokeEvent(ev);
			EventInjector.invokeEvent(ev2);
			try {
				Thread.sleep(1000);
			} catch (InterruptedException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
	}
}

 

 

 

Please use plain text.
Administrator
MSohm
Posts: 10,873
Registered: 07-09-2008
My Carrier: Bell

Re: 9500 simulator auto hangs up call

Is your callInitiated method firing its events?  If so, it could be hanging up the call before the simulator incoming call prompt appears.

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Found a bug? Report it using the Issue Tracker
Please use plain text.
New Developer
moshlp
Posts: 15
Registered: 01-27-2010
My Carrier: AT&T

Re: 9500 simulator auto hangs up call

[ Edited ]

that's the methodI thought should fire the event ...how should it be done?...could you mend my code?...thanx

Please use plain text.
New Developer
moshlp
Posts: 15
Registered: 01-27-2010
My Carrier: AT&T

Re: 9500 simulator auto hangs up call

that was exactly was going on, it was entering callInitiated method twice before changing the display number and therefore hanging up. I added a flag to ensure it'll enter only once per call redirection. any better solution? Thanx for the ideas...

Please use plain text.