I'm trying to export json to an Android device. I've used it like Java like Play! Doctor: But this does not work. I know that this is not an Android problem because I did it with php } I met DB and the browser shows me: Try going back as oak attribute ly restaurant: return json_encode ($ some) and it works well, what can I do?
Package Controller; Import java.util.list; Import org.codehaus.jackson.node.ArrayNode; Import org.codehaus.jackson.node.ObjectNode; Import model Restaurant; Import play.libs.Json; Import play.mvc *; Public Class Servicio Controller {Public static result coordination () (//System.out.println (= XXXXXXX ") is expanded; Object node RPTA = Jason.NOBackJack (); Arrayode Restaurant = RPTAAirode (); List & lt ; Restaurants & gt; Rests = Restaurants & Restaurants; for rest in the restaurant (int i = 0; i & lt; rests.size (); i ++) {rest = rests.get (i); ObjectNode RestJs = Json.newObject (); RestJs.put ("nombre", rest.nombre); RestJs.put ("LAN", rest.longitud); RestJs.put ("lat", rest.latitud); restaurantses.add (RestJs);} ObjectNode response = Json.newObject (); Response.put ("Restaurants", R Levels); Return is OK (response);}
{"Restaurants": [{"Nombre": "ODONTOLOGIA", "Loan": - 12.054695, "Late": - 77.085268}, {"number": "Letus", "Loan": - 12.057444, "Late" : "Number": "Commodore", "Loan": - 12.059332, "Loan": - 77.081856}, {"Numbers": "" "" "" "" "": 12.060279, "Latitude": - 77.081594} "Latitude": - 77.083104}, {"number": "" "," Luke ": - 12.06009," late ": - 77.083804}, {" number ":" CIBERCAFE "," loan ": - 12.059857," Let ": - 77.084563}, {" number ":" geography "," lawn ": - 12.05507," late ": - 77.086127}, {" number ":" MacKayna "", "Lone": - 12.055854, "Late": - 77.081816}, {"number": "electronica", "loan": - 12.056347, "late": - 77.082055}, {"number": "economy" , "Lone": - 12.058123, "Late": - 77.080639}, {"Number": "Minas", "Loan": -12.05199, "Late": - 77.087165}, {"number": "administration", " Loan ": - 12.05789," Late ": - 77.081602}, {" Number ":" Nuvo Restaurant "," Loan ": -70.23123," Late ": - 12.31234}]
return OK (restaurant) ;
No comments:
Post a Comment