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
Upvote 0

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.
[{"et_id":1,"et_name":"EG","et_aufpreis":0},{"et_id":2,"et_name":"1. Etage","et_aufpreis":0},{"et_id":3,"et_name":"2. Etage","et_aufpreis":0},{"et_id":4,"et_name":"3. Etage","et_aufpreis":3},{"et_id":5,"et_name":"4. Etage","et_aufpreis":3.5},{"et_id":6,"et_name":"5. Etage","et_aufpreis":4},{"et_id":7,"et_name":"6. Etage","et_aufpreis":4.5},{"et_id":8,"et_name":"7. Etage","et_aufpreis":5},{"et_id":9,"et_name":"8. Etage","et_aufpreis":5.5},{"et_id":10,"et_name":"9. Etage","et_aufpreis":6},{"et_id":11,"et_name":"10. Etage","et_aufpreis":6.5},{"et_id":12,"et_name":"11. Etage","et_aufpreis":7},{"et_id":13,"et_name":"12. Etage","et_aufpreis":7.5},{"et_id":14,"et_name":"13. Etage","et_aufpreis":8},{"et_id":15,"et_name":"14. Etage","et_aufpreis":8.5},{"et_id":16,"et_name":"15. Etage","et_aufpreis":9},{"et_id":17,"et_name":"16. Etage","et_aufpreis":9.5},{"et_id":18,"et_name":"17. Etage","et_aufpreis":10},{"et_id":19,"et_name":"18. Etage","et_aufpreis":10.5},{"et_id":20,"et_name":"19. Etage","et_aufpreis":11},{"et_id":21,"et_name":"20. Etage","et_aufpreis":11.5},{"et_id":22,"et_name":"Keller","et_aufpreis":0},{"et_id":23,"et_name":"Souterain","et_aufpreis":0},{"et_id":24,"et_name":"Dachgeschoss","et_aufpreis":12}]
 
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
Top