当前位置:去回答>百科问答>xtu怎么用

xtu怎么用

2024-06-11 12:22:38 编辑:join 浏览量:555

xtu怎么用

Client:

需要Xutils.jar

调用上传:

[java] view plain copy

String uploadHost=http://129.44.0.137:8080/AndroidUploadServer/upload.do;

RequestParams params=new RequestParams();

params.addBodyParameter(msg,imgtxt.getText().toString());

params.addBodyParameter(filePath.replace(/, ), new File(filePath));

uploadMethod(params,uploadHost);

上传方法:

[java] view plain copy

public void uploadMethod(final RequestParams params,final String uploadHost) {

http.send(HttpRequest.HttpMethod.POST, uploadHost, params,new RequestCallBackString() {

@Override

public void onStart() {

// msgTextview.setText(conn...);

}

@Override

public void onLoading(long total, long current,boolean isUploading) {

if (isUploading) {

// msgTextview.setText(upload: + current + /+ total);

} else {

// msgTextview.setText(reply: + current + /+ total);

}

}

@Override

public void onSuccess(ResponseInfoString responseInfo) {

// msgTextview.setText(reply: + responseInfo.result);

}

@Override

public void onFailure(HttpException error, String msg) {

// msgTextview.setText(error.getExceptionCode() + : + msg);

}

});

}

Server:

需要smartupload.jar猛戳下载 测试代码下载

[java] view plain copy

import com.jspsmart.upload.SmartUpload;

import javax.servlet.ServletException;

import javax.servlet.http.HttpServletRequest;

import javax.servlet.http.HttpServletResponse;

import java.io.IOException;

public class UploadServlet extends javax.servlet.http.HttpServlet implements javax.servlet.Servlet {

protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

response.setContentType(text/html,charset=UTF-8);

SmartUpload smartUpload = new SmartUpload();

try {

smartUpload.initialize(this.getServletConfig(), request, response);

smartUpload.upload();

com.jspsmart.upload.File smartFile = smartUpload.getFiles().getFile(0);

if (!smartFile.isMissing()) {

String saveFileName = /data/ + smartFile.getFileName();

smartFile.saveAs(saveFileName, smartUpload.SAVE_PHYSICAL);

response.getWriter().print(ok: + saveFileName + , msg: + smartUpload.getRequest().getParameter(msg));

} else {

response.getWriter().print(missing...);

}

} catch (Exception e) {

response.getWriter().print(e);

}

}

}

您好,尝试太多只会暂时锁定机器,即一段时间无法解锁如果您的机器处在usb调试打开的情况下,您可以通过在开机状况下用数据线连接电脑,在电脑上打开刷机精灵等软件利用里面的去除开机密码的工具解决这个问题如果您的机器没有打开USB调试,可以通过升级官方固件来重新恢复系统感谢您对酷比魔方的支持!

加巍 tt6261130

标签:xtu

版权声明:文章由 去回答 整理收集,来源于互联网或者用户投稿,如有侵权,请联系我们,我们会立即处理。如转载请保留本文链接:https://www.quhuida.com/answer/120890.html
热门文章