Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public String getContent(int nid){
- int nilaiku=0;
- String Alamat = "http://twitter.piecesofstory.com/";
- XMLRPCClient client = new XMLRPCClient(Alamat+"xmlrpc.php");
- ArrayList<jsonResult> hasilnya = new ArrayList<jsonResult>();
- try {
- Object[] sum = (Object[]) client.call("node.getContent", nid);
- for (int i=0;i<sum.length;i++){
- HashMap hm = (HashMap) sum[i];
- hasilnya.add(new jsonResult(hm.get("title").toString(), Integer.parseInt(hm.get("nid").toString()),Alamat+hm.get("filepath").toString()));
- }
- Gson gson = new Gson();
- String hasil = gson.toJson(hasilnya);
- Log.i("Ferry-code", hasil);
- return hasil;
- } catch (Exception e) {
- e.printStackTrace();
- Gson gson = new Gson();
- hasilnya.add(new jsonResult(e.toString(), nilaiku,e.toString()));
- String hasil = gson.toJson(hasilnya);
- Log.i("Ferry-code", hasil);
- return hasil;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment