Re: A Doubt in Making a Phone call to other Mobile Devies using J2ME
Posted By:
Anonymous
Posted On:
Wednesday, January 26, 2005 09:37 PM
Hi,
Have you tried on Device? I created simple Midlet with this method and it's working fine. Iam able to make a call. I haven't done any settings. But in Emulator platformRequest() method returning false still working on device.
Just try to load into any J2ME Device which suports MIDP2.0.
Iam not seeing any problem in u'r code other than "+" sign. Remove that and try. for local calling number no need +.
here is my code u can check this.
import javax.microedition.lcdui.Display;
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
public class PhoneCall extends MIDlet{
String _phoneNum,_message;
boolean _results;
public void PhoneCall(){
}
public void startApp()
{
_phoneNum = getAppProperty("PHONENUM");
makePhoneCall();
inputForm();
}
public void pauseApp()
{
}
public void destroyApp( boolean unconditional )
{
}
void makePhoneCall() {
_message ="in make phonecall";
try {
_results = platformRequest(_phoneNum);
if(_results)
_message = "Connection is ok";
else
_message = "Connection is fail";
}catch(IllegalArgumentException e){
System.out.println("IllegalArgument Exception :" +e.toString());
}
catch(Exception e) {
System.out.println("Exception: "+e.toString());
}
}
private void inputForm(){
Form _inputForm = new Form("Make Phonecall");
_inputForm.append("Phone call Result : "+_message);
Display.getDisplay( this ).setCurrent(_inputForm);
}
}
Seenu