Network connection Android Kendo UI

4 posts, 0 answers
  1. Roman
    Roman avatar
    2 posts
    Member since:
    Aug 2012

    Posted 16 Oct 2013 Link to this post

    Hi *,

    I'm writting an application with Kendo UI, which schould build a https connection to a server. The application runs pretty well in the simulator, but after the installation on a mobile device (Android 4.1.2), the application is not able to build an Internet connection, namely a connection to the target server.

    I use the following code to build the connection:
    var check = new XMLHttpRequest();
                    check.open("GET", "https://IP:PORT/test" ,false);
                    check.setRequestHeader("Authorization", utils.getServerAuthString());
                    check.onreadystatechange = function () {
                        if (check.readyState == 4) {
                            if (check.status == 200) {
                                utils.saveServerData();
                            } else {
                                utils.showError("status:" + check.status);
                            }
                        }
                    }
                    check.send(null);

    From the mobile device, I always receive a value "0" as Status, namely "Status: 0" (See line 9).

    By the ways, I also use the kendoui remote datasource to get data; however, it is not working too on the mobile device; see the following code.
    viewModel: kendo.observable({
                datasource: new kendo.data.DataSource({
                        transport: {
                            read: {
                                cache: false,
                                url: URL,
                                dataType: "json",
                                beforeSend: function(req) {
                                    req.setRequestHeader('Authorization', utils.getServerAuthString());
                                }
                            }
                        }
                })
            })

    I hope you can help me.

    Best regards,
  2. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 16 Oct 2013 Link to this post

    Hi Roman,

    Android debugging is currently not trivial, as the Android port of WebKit doesn't provide a Web Inspector interface for its WebView. What you can do is use add console.log all over the problematic code and check out your device logs in Graphite's output pane or use remote web debugger like Weinre.

    You can also setup Fiddler to intercept your device's traffic which would give you a clue what's going on by reviewing the requests/responses.

    Regards,
    Steve
    Telerik
    You've missed the Icenium Visual Studio Integration keynote? It has been recorded and posted here.
    Looking for tips & tricks directly from the Icenium team? Check out our blog!
    Share feedback and vote for features on our Feedback Portal.
  3. Roman
    Roman avatar
    2 posts
    Member since:
    Aug 2012

    Posted 16 Oct 2013 Link to this post

    Hi Steve,

    Thank you for your promp answer.
    I have configured fiddler as proxy for the mobile phone; after trying to execute the request, I could receive a response with the HTTP code 200 (in fidler) like expected, but the error in the application is still present. unfortunnaly, it's not possible for me to see the content of the response because of the HTTPS connection (Tunnel).

    Please help!

    regards,
    Roman
  4. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 17 Oct 2013 Link to this post

    Hello Roman,

    You need a FiddlerRoot certificate, see the instructions available here. Also Fiddler has "Decrypt HTTPS Traffic" option in Tools -> Fiddler Options -> HTTPS.

    Regards,
    Steve
    Telerik
    You've missed the Icenium Visual Studio Integration keynote? It has been recorded and posted here.
    Looking for tips & tricks directly from the Icenium team? Check out our blog!
    Share feedback and vote for features on our Feedback Portal.
Back to Top