其實(shí)就是訪問這個(gè)php文件,返回一段數(shù)據(jù),一般用json,然后安卓可以解析就行了了。走h(yuǎn)ttp協(xié)議。
堅(jiān)守“ 做人真誠 · 做事靠譜 · 口碑至上 · 高效敬業(yè) ”的價(jià)值觀,專業(yè)網(wǎng)站建設(shè)服務(wù)10余年為成都廣告推廣小微創(chuàng)業(yè)公司專業(yè)提供企業(yè)網(wǎng)站制作營銷網(wǎng)站建設(shè)商城網(wǎng)站建設(shè)手機(jī)網(wǎng)站建設(shè)小程序網(wǎng)站建設(shè)網(wǎng)站改版,從內(nèi)容策劃、視覺設(shè)計(jì)、底層架構(gòu)、網(wǎng)頁布局、功能開發(fā)迭代于一體的高端網(wǎng)站建設(shè)服務(wù)。
android 用HttpURLConnection類操作
以HTTP協(xié)議像php的站點(diǎn)頁面提交GET或POST請求。
請求的內(nèi)容中可以夾帶JSON格式的數(shù)據(jù),
也可以直接用k=vk=vk=v這樣的url資源格式傳數(shù)據(jù)。
手機(jī)端的------// 提交反饋信息,這是post方式提交
服務(wù)端,php不懂說以,你再找找,跟客戶端關(guān)系不大
public String user_feedback(String feedbackType,String feedbackContent,String contacts) {
ArrayListNameValuePair nv=new ArrayListNameValuePair();
nv.add(new BasicNameValuePair("userId", this.user.userid));
nv.add(new BasicNameValuePair("feedbackType", feedbackType));
nv.add(new BasicNameValuePair("feedbackContent",feedbackContent));
nv.add(new BasicNameValuePair("userContact",contacts));
nv.add(new BasicNameValuePair("permit", this.user.permit));
DefaultHttpClient client = new DefaultHttpClient();
HttpPost post = new HttpPost(uri);
String strResult = "";
try {
HttpEntity entity = new UrlEncodedFormEntity(nv, "UTF-8");
post.setEntity(entity);
// 獲得HttpResponse對象
HttpResponse httpResponse = client.execute(post);
if (httpResponse.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
// 取得返回的數(shù)據(jù)
strResult = EntityUtils.toString(httpResponse.getEntity());
}
} catch (ClientProtocolException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
Log.i("jsonHelper", strResult);
return strResult;
}
文章標(biāo)題:安卓通過php上傳數(shù)據(jù) php上傳apk文件
網(wǎng)站鏈接:http://www.rwnh.cn/article18/dosiigp.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供靜態(tài)網(wǎng)站、虛擬主機(jī)、網(wǎng)站策劃、面包屑導(dǎo)航、網(wǎng)站設(shè)計(jì)、企業(yè)建站
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)