#Region Project Attributes
#ApplicationLabel: Network Mapper
#VersionCode: 1
#VersionName: 1.0
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
#End Region
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
Sub Process_Globals
Dim sb As StringBuilder
Dim p As Phone
End Sub
Sub Globals
Dim ClientList As ListView
End Sub
Sub Activity_Create(FirstTime As Boolean)
sb.Initialize
Activity.LoadLayout("main")
Activity.AddMenuItem("Refresh","Refresh")
Activity.AddMenuItem("Exit","Shutdown")
GetList
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub ClientList_ItemClick (Position As Int, Value As Object)
End Sub
Sub ClientList_ItemLongClick (Position As Int, Value As Object)
End Sub
Sub GetList
ClientList.Clear
p.Shell("cat /proc/net/arp", Null, sb, Null)
File.WriteString(File.DirInternal,"Catch.arp",sb.ToString)
Dim TextReader1 As TextReader
TextReader1.Initialize(File.OpenInput(File.DirInternal, "Catch.arp"))
Dim line As String
line = TextReader1.ReadLine
Do While line <> Null
If line.Contains("HW") Then
line = TextReader1.ReadLine
Else
Dim v As String
v = line
ClientList.AddTwoLines(v.SubString2(41,59),v.SubString2(0,14))
line = TextReader1.ReadLine
End If
Loop
TextReader1.Close
File.Delete(File.DirInternal,"Catch.arp")
sb.Remove(0,sb.Length)
End Sub
Sub Refresh_click
GetList
End Sub
Sub Shutdown_click
Activity.Finish
End Sub