This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Connect Mobile 4.40 makeImageRequest localhost error

Hello, I have a small Garmin app, that connects to my Android phone who has a running http server that serves png images by url get encoding: Example 127.0.0.1:9977/


So far, everything was working like a charm, but after updating to Android Garmin Connect Mobile 4.40 it stop working. The makeImageRequest returns a BLE_HOST_TIMEOUT as a responseCode and never downloads the image. Also debugging the Android http server, never receives the request for any picture. (Other requests such as webRequests are properly received as explained bellow, but not imageRequest)


   // Set up the responseCallback function to return an image or null
    function responseCallback(responseCode, data) {
        responseCode = responseCode;
        if (responseCode == 200) {
            image = data;
        } else {
           System.println(Lang.format("Error code $1$",[responseCode]));
           image = null;
        }
    }

    // wrap the request in a function
    function requestImageinGallery(imageId) {
        var url = "http://127.0.0.1:9977/";           // set the image url
        var parameters = { "imageId" => imageId};     // set the parameters
        var options = {                                         // set the options
            :palette => [ Gfx.COLOR_ORANGE,                     // set the palette
                          Gfx.COLOR_DK_BLUE,
                          Gfx.COLOR_BLUE,
                          Gfx.COLOR_BLACK ],
            :maxWidth => 200,                                   // set the max width
            :maxHeight => 200,                                  // set the max height
            :dithering => Communications.IMAGE_DITHERING_NONE   // set the dithering
        };

        // Make the image request
        Communications.makeImageRequest(url, parameters, options, method(:responseCallback));
    }

 
 


The makeWebRequest works perfectly and receives the response from the the httpServer as is running.

 
  function checkIfServerIsRunning() {
      
  var url = "http://127.0.0.1:9977/";           // set the image url
  var params = { "check" => "isAlive"};     // set the parameters

   var options = { // set the options
    :method => Communications.HTTP_REQUEST_METHOD_GET, // set HTTP method
    :headers => { // set headers
    "Content-Type" => Communications.REQUEST_CONTENT_TYPE_JSON}, // set response type
    :responseType => Communications.HTTP_RESPONSE_CONTENT_TYPE_JSON };
    
    Communications.makeWebRequest(url, params, options, method(:onReceive)); }




Can anyone help me?


Thank you in advance.

Top Replies

All Replies