【问题标题】:Android-Volley-Multipart-RequestAndroid-Volley-Multipart-Request
【发布时间】:2019-05-05 17:48:15
【问题描述】:

我正在尝试使用 Android-Volley-Multipart-Request 将一些图像和文本发送到服务器,如下所示: https://github.com/Ankit7791/Android-Volley-Multipart-Request

但解释不够。

如果我能得到一个很好的教程或解释我做错了什么,我会很高兴。此外,我对其他图书馆建议持开放态度。

我对其进行了一些修改以处理下面的代码

@Override
protected Map<String, String> getParams() {
                Map<String, String> params = new HashMap<>();

                params.put(Utils.KEY_APPID, "j8Ue72@lfZy");
                params.put(Utils.KEY_APIKEY, "f9da8764b6d8c3413e5503d6bfe91e63");
                params.put(Utils.KEY_MOBILE, "0541778110");
                params.put(Utils.KEY_ORDERID, "Sam_100001");

                return params;
            }

            @Override
            protected Map<String, DataPart> getByteData() {
                Map<String, DataPart> params = new HashMap<>();
                // file name could found file base or direct access from real path
                //for now just get bitmap data from ImageView
                params.put(Utils.Accept_signature, new DataPart(idImageCapture.getText().toString(), idImagebyteArray, "image/*"));
                params.put(Utils.Accept_receive, new DataPart(imageLocation.getText().toString(), locationImagebyteArray, "image/*"));
                params.put(Utils.Accept_location, new DataPart(signature.getText().toString(), signatureImagebyteArray, "image/*"));
                return params;
            }
        };

不知道是什么问题

但我不断收到以下错误:

android.content.res.resources$notfoundexception: 字符串资源 id #0xc8

【问题讨论】:

  • 尝试发布完整的logcaterrors

标签: android android-volley multipartform-data


【解决方案1】:

Volley 中尝试这个多部分请求。对你有很大帮助,如果有任何问题,请在此处发表评论。

【讨论】:

    猜你喜欢
    • 2020-11-01
    • 2021-07-08
    • 2021-12-26
    • 1970-01-01
    • 2020-02-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多