| | |
| | | }
|
| | |
|
| | | public void add(RequestParams params) {
|
| | |
|
| | | if (!BaseApplication.deviceAvailable) {
|
| | | return;
|
| | | }
|
| | | try {
|
| | | File path = BaseApplication.getInstance().getFilesDir();
|
| | | File f1 = new File(path, "1.txt");
|
| | | if (!f1.exists()) {
|
| | | f1.createNewFile();
|
| | | }
|
| | | File f2 = new File(path, "2.txt");
|
| | | if (!f2.exists()) {
|
| | | f2.createNewFile();
|
| | | }
|
| | | FileWriter fw1 = new FileWriter(f1);
|
| | | fw1.write("test1");
|
| | | fw1.close();
|
| | | FileWriter fw2 = new FileWriter(f2);
|
| | | fw2.write("test2");
|
| | | fw2.close();
|
| | | params.setUri(AppApi.BASE_URL +AppApi.REGISTER_ADD);
|
| | | params.addBodyParameter("file1", f1);
|
| | | params.addBodyParameter("file2", f2);
|
| | | x.http().post(params, new BaseCommonCallBack() {
|
| | | @Override
|
| | | public void success() {
|