在这里,我想从服务器获取一些数据值,然后使用JSON将一些数据上传到服务器。请解释一些代码。
我想获取值并分配特定的TextView。请帮助我。
这是我的Json对象。 url ===>“ http://220.247.201.26/DistributionService/DDService”
String request = "{'DistributionID': 'NORORG147530',\n" +
" 'locationId': 147530,\n" +
" 'record_id': 24594,\n" +
" 'dilivery_place': '',\n" +
" 'further_details': '',\n" +
" 'noOfNormal': 2,\n" +
" 'noOfClassified': 0,\n" +
" 'noOfCds': 0,\n" +
" 'img_collector': '',\n" +
" 'dilivery_status': '',\n" +
" 'geo_long': '',\n" +
" 'geo_lat': '',\n" +
" 'contact': '',\n" +
" 'full_name': 'Motha Confectionery Works (pvt) Ltd',\n" +
" 'response': {\n" +
" 'resultcode': 100,\n" +
" 'resultdesc': 'Result Successull',\n" +
" 'redirect_to': '',\n" +
" 'value': ''\n" +
" }\n" +
"}";
这是我的数据视图活动,称为“分发详细信息”。
公共类DistributionDetails扩展了AppCompatActivity {
private DistributionViewDetails det;
static TextView ID;
static TextView DelPlace;
static TextView CName;
static TextView Tele;
static TextView status;
Button btnDIR;
@Override
protected
void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_distribution_details);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
ID = (TextView) findViewById(R.id.lblID);
DelPlace = (TextView) findViewById(R.id.lblAddress);
CName = (TextView) findViewById(R.id.lblCompanyName);
Tele = (TextView) findViewById(R.id.lblTelenum);
status = (TextView) findViewById(R.id.lblStatus);
btnDIR = (Button) findViewById(R.id.btnDIR);