Sub Service_Start (StartingIntent As Intent)
If StartingIntent.Action = "android.provider.Telephony.SMS_RECEIVED" Then
Log("sms received")
Dim p As Phone
Dim status As Int = p.GetRingerMode
sms_analize(status)
else If StartingIntent.Action = "android.intent.action.PHONE_STATE" Then
Log(StartingIntent.GetExtra("state"))
Select StartingIntent.GetExtra("state")
Case "IDLE"
NativeMe.RunMethod("stop",Null)
reset_flash_status
Case "OFFHOOK"
NativeMe.RunMethod("stop",Null)
reset_flash_status
Case "RINGING"
Dim p As Phone
Dim status As Int = p.GetRingerMode
call_analize(status)
End Select
End If
End Sub