How to get php json_encode($array) in to android to manipulate it data?

How to get php `json_encode($array)` in to android to manipulate it data? I have a php that encode a array in json_encode($array); and when i echo json_encode($array); i get: `[{"id":"1","name":"player1","score":"20","quarter":"Q - 1"},{"id":"2","name":"player2","score":"18","quarter":"http:\/\/localhost\/win.jpg"}]` Now in android i want to get that array from the php and put it in a array that let me take for example from index 0 with the key name the string value that it contains and then set that string to a textView text. In iphone i only do this code: NSDictionary *json = [NSJSONSerialization JSONObjectWithData:data options:kNilOptions error:&error]; (data is my local url "http://localhost/my.php") and then i can easy take the data from the dictionary with `valueForKey:name` and `objectAtIndex:0` and put it string to a textfield. Please complete code implementation in java so i can understand. Because i'm new in java and i'm losing my head with a lot of erros and hours trying to do this in different ways. Thanks to the one that resolve my problem.

以上就是How to get php json_encode($array) in to android to manipulate it data?的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JSON 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准

联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏