Android Question How to Monitor GPRS Connection?

incendio

Well-Known Member
Licensed User
Longtime User
Hello,

I need to monitor in real time which application that use GPRS data connection in my device (oreo 8)

Is it possible which B4A?

Thanks.
 

victormedranop

Well-Known Member
Licensed User
Longtime User
What I do. Ping google if response ok
Connect to host.

Thanks to stu14.

B4X:
Sub CheckConnection As Boolean
    'Requires Phone Library
    Dim p As Phone
    Log(p.GetDataState)
    Log(p.GetNetworkType)
    Dim Response, Error As StringBuilder
    Response.Initialize
    Error.Initialize
    'Ping Google DNS - if you can't reach this you are in serious trouble!
    p.Shell("ping -c 1 8.8.8.8",Null,Response,Error)
    Log("======= Response ========")
    Log(Response)
    Log("======= Error ===========")
    Log(Error)
    Log("======================")

    If Error.ToString="" Then
        Return True
    Else
        Return False
    End If
End Sub
 
Upvote 0

incendio

Well-Known Member
Licensed User
Longtime User
Thanks for your answer, but this is not what I want.
This is to check whether connection is exist.

I want to check which applications that use GPRS connection to send/receive data from my device.
 
Upvote 0
Top