Greeting,
I'm doing a small test project on android, the app is playing radio streaming, and it should stop when the phone rings.
So I should call a certain function when the phone rings.
Since there is no direct way for my application to know when the phone rings, it should be programmed in native java.
I have no experience with java (I only know how to make some elementary functions), so it's too much for me, so I'm asking for help if someone has done it successfully.
This is approximately the java code I should embed in WINDEV Mobile:
// Listener to detect incoming calls.
private class CallStateListener extends PhoneStateListener {
@Override
public void onCallStateChanged(int state, String incomingNumber) {
switch (state) {
case TelephonyManager.CALL_STATE_RINGING:
// called when someone is ringing to this phone
callWLProcedure("RadioStop");
break;
}
}
}