Android Question name provider 4g

scsjc

Well-Known Member
Licensed User
Longtime User
Is possible get name company or some information about the provider use on phone (Vodafone, movistar, orange...)

Thanks
 

DonManfred

Expert
Licensed User
Longtime User
You can try this library:
https://www.b4x.com/android/forum/t...log-telephony-sms-mms-and-more.57444/#content

Code something like

Maybe you need to set a permission if using targetsdk 23+ (use Runtimepermissions)

B4X:
Sub Globals
    'These global variables will be redeclared each time the activity is created.
    'These variables can only be accessed from this module.
    Dim tp As TelephonyProvider
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")
    tp.Initialize
    Dim c As Cursor
    c = tp.Carriers
    If c.RowCount > 0 Then
        For i = 0 To c.RowCount-1
            c.Position = i
            LogColor("======TELEPHONY PROVIDERS ================", Colors.Green)
            Dim colcount As Int = c.ColumnCount
            'Log("columns="&colcount)
            For o = 0 To colcount -1
                Log(c.GetColumnName(o)&"="&c.GetString(c.GetColumnName(o)))
            Next
            LogColor("==========================================", Colors.Green)
        Next
    End If
 
Upvote 0

scsjc

Well-Known Member
Licensed User
Longtime User
You can try this library:
https://www.b4x.com/android/forum/t...log-telephony-sms-mms-and-more.57444/#content

Code something like

Maybe you need to set a permission if using targetsdk 23+ (use Runtimepermissions)

B4X:
Sub Globals
    'These global variables will be redeclared each time the activity is created.
    'These variables can only be accessed from this module.
    Dim tp As TelephonyProvider
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")
    tp.Initialize
    Dim c As Cursor
    c = tp.Carriers
    If c.RowCount > 0 Then
        For i = 0 To c.RowCount-1
            c.Position = i
            LogColor("======TELEPHONY PROVIDERS ================", Colors.Green)
            Dim colcount As Int = c.ColumnCount
            'Log("columns="&colcount)
            For o = 0 To colcount -1
                Log(c.GetColumnName(o)&"="&c.GetString(c.GetColumnName(o)))
            Next
            LogColor("==========================================", Colors.Green)
        Next
    End If
Thanks, I try
 
Upvote 0
Top