Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
302 views
in Technique[技术] by (71.8m points)

java - 如何从代号为ConnectionRequest的https站点获取响应? Android 10中https中的问题(在Google Pixel中)(How to get response from https site from Codename one's ConnectionRequest ? issue in https in Android 10 (In Google Pixel ))

I am new to Codenameone , I am having strange issue in Codenameone's ConnectionRequest API while fetching response from https site in google pixel device in which anroid 10 is installed.

(我是Codenameone的新手,从安装了Anroid 10的Google像素设备的https站点获取响应时,Codenameone的ConnectionRequest API出现了奇怪的问题。)

fetching from https site is working fine.

(从https站点提取正常工作。)

However in the simulator it is fine and also with the other device that has android less than version 10.

(但是,在模拟器中也可以,并且也可以与其他Android版本低于10的设备一起使用。)

what could be the solution for this OR am i doing somthing worng?

(这可能是什么解决方案,或者我正在做些磨损的事情?)

Here is my code and error i am getting in device

(这是我在设备中遇到的代码和错误)

 TextArea resultTextArea = new TextArea();
    Button download = new Button("RUN");

    download.addActionListener((e) -> {
        ConnectionRequest cr = new ConnectionRequest(url, false);
        SliderBridge.bindProgress(cr, progress);
        NetworkManager.getInstance().addToQueueAndWait(cr);
        if (cr.getResponseCode() == 200) {

            String resultString = "";


            try {

                byte[] initialArray = cr.getResponseData();
                resultString = new String(initialArray);

                resultTextArea.setText(resultString);
            } catch (Exception eee) {
                resultString = "Error => " + resultString + eee.getMessage();
            }

            System.out.println(resultString);
        }
    });

在此处输入图片说明

  ask by sam translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...