package ru.dcms_social; import android.app.*; import android.content.*; import android.os.*; import android.support.v7.app.*; import android.util.*; import android.view.*; import android.widget.*; import java.net.*; import java.io.*; import org.json.*; public class Menu extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.menu); Button name = (Button) findViewById(R.id.name); String strJson="{\"name\":\"Vlad\"}"; String result_name =""; try { JSONObject jo= new JSONObject(strJson); //Iterate the jsonArray and print the info of JSONObjects result_name = jo.getString("name"); name.setText(result_name); } catch (Exception je) { name.setText("Error w/file: " + je.getMessage()); } } }