HI to all,
would like to have small application able to send caller id (incoming number) on android phone to PC. On PC visual basic application is waiting on UDP port for data.
I make small application but caller ID is not show up at any time. I'm using Samsung Galaxy alpha with android 4.4.4
main:
service:
.
any help will be very appreciated.
Thanks,
Damir
would like to have small application able to send caller id (incoming number) on android phone to PC. On PC visual basic application is waiting on UDP port for data.
I make small application but caller ID is not show up at any time. I'm using Samsung Galaxy alpha with android 4.4.4
main:
B4X:
#Region Project Attributes
#ApplicationLabel: B4A Example
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
#End Region
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
Sub Process_Globals
Dim UDPSocket1 As UDPSocket
Dim Server As ServerSocket
Dim PE As PhoneEvents
Dim PhoneId As PhoneId
End Sub
Sub Service_Create
PE.InitializeWithPhoneState("PE",PhoneId)
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim ButtonSend As Button
Dim EditData As EditText
Dim EditDest As EditText
Dim LabelIP As Label
Private Button1 As Button
Private Button2 As Button
Private Button3 As Button
Private EditText1 As EditText
Private EditText2 As EditText
Private Label1 As Label
Private Label2 As Label
Private Label3 As Label
Private Label4 As Label
Private Label5 As Label
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
'Activity.LoadLayout("Layout1")
Activity.LoadLayout("CALLER_ID")
Msgbox("OVO JE TEST!", "")
Dim IP As String
If FirstTime Then
UDPSocket1.Initialize("UDP", 5000, 8000)
IP = Server.GetMyWifiIP
StartService(sPhone)
End If
'Label2.Text=IP ' LabelIP.Text = IP
EditDest.Text="192.168.1.255"
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub Button3_Click
Label1.Text="BUTTON3_click"
End Sub
Sub Button2_Click
Label1.Text="BUTTON2_click"
End Sub
Sub Button1_Click
Label1.Text="BUTTON1_click"
End Sub
Sub PE_PhoneStateChanged (State As String, IncomingNumber As String, Intent As Intent)
If State="RINGING" Then ' Ringing state.
Msgbox("RINGING: ","jebiga" )
Label2.Text=IncomingNumber
ButtonSend_Click
End If
'your code ..
End Sub
service:
B4X:
#Region Service Attributes
#StartAtBoot: False
#End Region
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Dim PE As PhoneEvents
' Dim PhoneId As PhoneId
End Sub
Sub Service_Create
'PE.InitializeWithPhoneState("PE",PhoneId)
PE.Initialize("PE")
End Sub
Sub Service_Start (StartingIntent As Intent)
End Sub
Sub Service_Destroy
End Sub
Sub PE_PhoneStateChanged (State As String, IncomingNumber As String, Intent As Intent)
Log("PhoneStateChanged, State = " & State & ", IncomingNumber = " & IncomingNumber)
Log(Intent.ExtrasToString)
Msgbox("PhoneStateChanged, State = " & State & ", IncomingNumber = " & IncomingNumber, "")
If State="RINGING" Then ' Ringing state.
Msgbox("RINGING: ","jebiga" )
' Label2.Text=IncomingNumber
'ButtonSend_Click
End If
' Log(Intent.ExtrasToString)
End Sub
any help will be very appreciated.
Thanks,
Damir