Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Google url shortener is not working on mobile qml
Forum Updated to NodeBB v4.3 + New Features

Google url shortener is not working on mobile qml

Scheduled Pinned Locked Moved Mobile and Embedded
2 Posts 1 Posters 2.6k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    murat.mamangmail.com
    wrote on last edited by
    #1

    Hello,

    I would want to use google url shortener due to hide actual link from people. I am trying build one media player for android but google url shortener is not working. If i gave actual link there is no problem.

    Also i tried with stocqt which is coming with qtcreater also it was not working. In stocqt there is link and i converted it shortener link after i saw that it was not working.

    Actually shortener url is working in android as well.

    Any one knows how to achieve that problem how can we use google url shortener .

    Regards
    Murat

    1 Reply Last reply
    0
    • M Offline
      M Offline
      murat.mamangmail.com
      wrote on last edited by
      #2

      Hi All,
      Okay i found out solution by myself, the following code can able to get actual link.

      Idea is you need parse from response where is location.

      @function httpGet(theUrl)
      {
      var locationUrl;
      var http = new XMLHttpRequest()
      http.open ("GET", theUrl, true); // async
      http.send (null);

                          http.onreadystatechange = function() // Call a function when the state changes.
                          {
                              if (http.readyState == 4)
                              {
                                  if (http.status == 200)
                                  {
      
                                      locationURL = http.getResponseHeader("location")
                                      //console.log("headers: " + locationUrl + " locationUrl: " + locationUrl)
                                  } else
                                  {
                                      console.log("error: " + http.status)
                                  }
                              }
                          }
                          return locationUrl;
                      }@
      
      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved