The arquitecture form is a follow (simple phone interfaces) :
1. Main Activity
2. DialPad Activity
3. Call Activity
4. Start Service (by default)
5. TSerVoipPhone (Listed a Android Service From ABto Trial SDK)
Start Service listen when the user remove app from list app o use the task killer (it works in almost android test)
Sub Service_Destroy
Log("Service is Destory")
CancelScheduledService(TServVoipPhone)
StopService(TServVoipPhone)
End Sub
Sub Service_TaskRemoved
'This event will be raised when the user removes the app from the recent apps list.
Log("Service task remove")
CancelScheduledService(TServVoipPhone)
StopService(TServVoipPhone)
'StartServiceAt(TServVoipPhone,5000,False)
End Sub
on TSerVoipPhone catch "kill by user" an try to restore
Sub Service_Destroy
Log("Voip is Destory")
StartServiceAt(Me,5000,False)
End Sub
Sub Service_TaskRemoved
Log("Voip is task removed")
StartServiceAt(Me,5000,False)
End Sub
The service run again (have all permision, autostar,battery optimization)
whats is the problem ?
Service task remove <- service remove by the user
** Service (tservvoipphone) Destroy ** <- stop service from start
Voip is Destory <- service destroy listen
onRemoteAlerting = [Ljava.lang.Object;@2f51101 <- service is Up Again
OnIncomingCall = [Ljava.lang.Object;@20bc3d <- service report a incoming call
Sub Voip_OnIncomingCall(uri As String, callId As Long)
Log($"Voip_OnIncomingCall(${uri}, ${callId})"$)
VoipCallInfo.ContacName = uri
VoipCallInfo.IsVideo = VoipPhone.isVideoCall
'VoipCallInfo.State = PhoneState.call_state_iscomming
VoipCallInfo.State = 2
SetAndNotify(DevNotHandlerMsg.voip_OnInCall.Replace(":%1",uri),Call) <- Error [ line: 424] ' I try comment this line but error success after
StartActivity(Call) <- Error
End Sub
Voip_OnIncomingCall(<sip:
delgadol@iptel.org>, 1) <- service listen handler a incoming call
isVideoCall allowed = true <- Video permitted
check for video call
at this time
tservvoipphone_voip_onincomingcall (java line: 424)
java.lang.NullPointerException: Attempt to read from field 'net.dumaco.voipapp2.devnothandlermsg net.dumaco.voipapp2.tservvoipphone._devnothandlermsg' on a null object reference
at net.dumaco.voipapp2.tservvoipphone._voip_onincomingcall(tservvoipphone.java:424)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:213)
at org.abtollc.sdk.b4a.AbtoPhone.raiseEvent(AbtoPhone.java:844)
at org.abtollc.sdk.b4a.AbtoPhone.OnIncomingCall(AbtoPhone.java:765)
at org.abtollc.sdk.AbtoPhone$8.handleMessage(AbtoPhone.java:469)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:221)
at android.app.ActivityThread.main(ActivityThread.java:7520)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)
This Error is on android 9/10 and MIU 8.1 , on emulator run OK.
thanks in advence.