<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"><channel><category>pcsoft.us.windev</category><copyright>Copyright 2026, PC SOFT</copyright><lastBuildDate>24 Oct 2014 15:52:00 Z</lastBuildDate><pubDate>16 Oct 2014 12:38:00 Z</pubDate><description>Hello all,&#13;
&#13;
Hoping someone can help me convert this java script to run in Windev Mobile 18:&#13;
&#13;
&#13;
import android.content.Context;&#13;
import android.telephony.PhoneStateListener;&#13;
import android.telephony.TelephonyManager;&#13;
import android.widget.Toast;&#13;
&#13;
public class PhoneStateMonitor extends PhoneStateListener {&#13;
Context context;&#13;
&#13;
public PhoneStateMonitor(Context context) {&#13;
super();&#13;
// TODO Auto-generated constructor stub&#13;
this.context=context;&#13;
}&#13;
&#13;
//This Method Automatically called when changes is detected in Phone State&#13;
public void onCallStateChanged(int state, String incomingNumber) {&#13;
// TODO Auto-generated method stub&#13;
super.onCallStateChanged(state, incomingNumber);&#13;
&#13;
Toast.makeText(context, "Phone State - "+state+" Incoming Number - "+incomingNumber, Toast.LENGTH_LONG).show();//Giving the Message that Phone State Changed&#13;
//Checking The phone state&#13;
switch(state)&#13;
{&#13;
case TelephonyManager.CALL_STATE_IDLE: //Phone is in Idle State&#13;
Toast.makeText(context, "Phone State is IDLE", Toast.LENGTH_LONG).show();&#13;
break;&#13;
case TelephonyManager.CALL_STATE_RINGING: //Phone is Ringing&#13;
Toast.makeText(context, "Phone State is RINGING", Toast.LENGTH_LONG).show();&#13;
break;&#13;
case TelephonyManager.CALL_STATE_OFFHOOK: //Call is Received&#13;
Toast.makeText(context, "Call State is OFFHOOK",Toast.LENGTH_LONG).show();&#13;
break;&#13;
}&#13;
}&#13;
}&#13;
&#13;
&#13;
&#13;
I can get this part to work:&#13;
&#13;
import android.content.Context;&#13;
import android.telephony.PhoneStateListener;&#13;
import android.telephony.TelephonyManager;&#13;
import android.widget.Toast;&#13;
&#13;
&#13;
public static void check_state(int state, String incomingNumber)&#13;
&#13;
{&#13;
// TODO Auto-generated method stub&#13;
Context context2 = getApplicationContext();&#13;
&#13;
&#13;
//this bit is missing the loop part where it checks for any changes on state&#13;
&#13;
&#13;
Toast.makeText(context2, "Phone State - "+state+" Incoming Number - "+incomingNumber, Toast.LENGTH_LONG).show();//Giving the Message that Phone State Changed&#13;
//Checking The phone state&#13;
switch(state)&#13;
{&#13;
case TelephonyManager.CALL_STATE_IDLE: //Phone is in Idle State&#13;
Toast.makeText(context2, "Phone State is IDLE", Toast.LENGTH_LONG).show();&#13;
break;&#13;
case TelephonyManager.CALL_STATE_RINGING: //Phone is Ringing&#13;
Toast.makeText(context2, "Phone State is RINGING", Toast.LENGTH_LONG).show();&#13;
break;&#13;
case TelephonyManager.CALL_STATE_OFFHOOK: //Call is Received&#13;
Toast.makeText(context2, "Call State is OFFHOOK",Toast.LENGTH_LONG).show();&#13;
break;&#13;
}&#13;
}&#13;
&#13;
&#13;
&#13;
hope someone can advise on this.&#13;
&#13;
many thanks iso</description><ttl>30</ttl><generator>WEBDEV</generator><language>en_US</language><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/48506-wm18-java/read.awp</link><title>WM18 Java</title><managingEditor>moderateur@pcsoft.fr (El moderador)</managingEditor><webMaster>webmaster@pcsoft.fr (El webmaster)</webMaster><item><author>guest</author><category>pcsoft.us.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/48506-solved-wm18-java-48651/read.awp</comments><pubDate>24 Oct 2014 15:52:00 Z</pubDate><description>Iso,&#13;
&#13;
Hope you get your solution working with the tips I send you ! :)&#13;
&#13;
Bye&#13;
Danny</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/48506-solved-wm18-java-48651/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/48506-solved-wm18-java-48651/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/48506-wm18-java/read.awp">WM18 Java</source><title>Re: SOLVED Re: WM18 Java</title></item><item><author>guest</author><category>pcsoft.us.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/48506-solved-wm18-java-48646/read.awp</comments><pubDate>24 Oct 2014 12:52:00 Z</pubDate><description>Really appreciate you help on this Danny here's his amazing reply, hope it can help out others in the future:&#13;
&#13;
&#13;
Hi,&#13;
&#13;
I just…</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/48506-solved-wm18-java-48646/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/48506-solved-wm18-java-48646/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/48506-wm18-java/read.awp">WM18 Java</source><title>Re: SOLVED Re: WM18 Java</title></item></channel></rss>
