Android Question Json Data in Tableview

junaidahmed

Well-Known Member
Licensed User
Longtime User
I have used Tableview for Sqlite and CSV file.Any one have use "Json Data" in Tableview ???
 

DonManfred

Expert
Licensed User
Longtime User
Its very useful for all "B4" Developers....
Maybe. WRITE one.

YOU are in the need to use a JSON, not me. Feel free to write a routine to convert a JSON to a CSV for example.

Dont expect other do YOUR work....
 
Last edited:
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
This is an Example JSON.... It can be more complex.
 
Upvote 0

junaidahmed

Well-Known Member
Licensed User
Longtime User
Thanks to all for supporting....

I have done "Json Data" in Tableview........
B4X:
Sub JobDone (Job As HttpJob)
    
    Try
        'Msgbox(Job.JobName,"")
        'Msgbox(Job.GetString(),"")
        
        If Job.Success Then
            If (Job.JobName = "StageList") Then
                Dim parser As JSONParser
                parser.Initialize(Job.GetString())
                Dim root As List = parser.NextArray
                Table1.Initialize(Me, "Table1", 2, Gravity.CENTER_HORIZONTAL, True)
        
                Table1.CellAlignment = Bit.Or(Gravity.LEFT, Gravity.CENTER_VERTICAL)
                Table1.HeaderColor = Colors.Blue
                Table1.HeaderTextColor = Colors.Yellow
                Table1.TextColor = Colors.Blue
                Table1.TableColor = Colors.Red
                Table1.RowHeight = 30dip
                
                Table1.AddToActivity(Activity, 5, 12%y , Activity.Width, Activity.Height - 12%y)
        
                Table1.MultiSelect = False
                Table1.SortColumn = False
                Table1.SingleLine = False
                Table1.ClearAll
                
                Table1.LineWidth = 2dip
                Table1.TextSize = 14
    
                Table1.SetHeader(Array As String("StageCode","StageDescriptions"))
        
                For Each colroot As Map In root
                    
                    Table1.AddRow(Array As String(colroot.Get("Serial"),colroot.Get("Stage")))
                Next
End Sub
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…