Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat
interacting with a website from gideros app - Gideros Forum

interacting with a website from gideros app

piepie Member
edited July 2017 in General questions
Hi I am planning to put together a website (maybe using a cms) and a gideros app to let registered users update some info on it.
I saw some old post about REST api but it seems that the app needs to open a browser window to interact with the website.
How would you do it? Is there something "better" than REST,which can be used without opening a browser window on the device?
Any other suggestions?

Thank you


  • talistalis Guru
    Accepted Answer
    It seems , urlloader is your answer.
    See this post for detail;

    Likes: hgy29, antix, pie, totebo

    +1 -1 (+4 / -0 ) Share on Facebook
  • piepie Member
    edited September 2017
    UrlLoader is my answer! thank you :)
    however I have some strange behaviours using it - which could be related.

    1) I can't access my php page using https (which should be supported as said in documentation)

    but as I said, this may be coming from:

    2) If I write the same url by hand and concatenate strings to get it, I have different results: the first works, the latter returns an error from php.

    I made a string comparison using string.byte on each char of the strings, and I found out that even if the strings look the same, they have different bytecodes: moreover, if I print out the characters while I am comparing them - they don't look the same! :-O
    But they look the same in gideros Output panel if I print the concatenated strings..

    This is what I got: here you can find the mismatching characters in my url, I don't know if there are others:

    "source_ok" is the character as it should be (written "by hand")
    "parsed_bad" is the character as it comes out from string concatenation from gideros (it was originally inserted by hand - so it should be the same as source, but then it is concatenated with others and it "changes"?)
    "badchar" is the string.sub(parsedString, i,i)
    "okchar" is the string.sub(sourceString, i,i)
    This is the snippet that generated the table above
    local compare = {}
    local tva = {}
    local urlva = handwrittenUrl
    for i=1, #urlva do
    	local s = string.byte(urlva,i)
    	tva[#tva+1] = s
    local tnonva = {}
    local urlnonva = parsedUrl
    for i=1, #urlnonva do
    	local s = string.byte(urlnonva,i)
    	tnonva[#tnonva+1] = s
    if #tva == #tnonva then
    	for i=1, #tva do 
    	if tva[i] == tnonva[i] then
    			print("MISMATCH:", i, "tva: "..tva[i], "tnonva: "..tnonva[i])
    			compare[#compare+1] = {source_ok = tva[i], parsed_bad = tnonva[i], okchar = string.sub(urlva, i, i), badchar = string.sub(urlnonva, i, i)}
    	print("error, string lenght is different")
    I could give you the test urls and more details via email/pm: I don't like to share my test server details on the public internet ;)

    @n1cke could this be related to the latest bug you fixed in layout (http://giderosmobile.com/forum/discussion/comment/52790#Comment_52790 ) ?

    Any help is appreciated, thank you :)
  • hgy29hgy29 Maintainer
    Accepted Answer
    @pie, gideros console interprets HTML, so if you try to print out html encoded strings, they will be shown unencoded.

    Also for SSL, if it doesn't work on player it means that you lack a specific DLL, which isn't provided by QT nor gideros due to potential licensing issues. There is a bug report about this in gideros github...
  • SinisterSoftSinisterSoft Maintainer
    Accepted Answer
    Here are the extra files for ssl (windows players) - just unrar into the gideros folder in program files:

  • piepie Member
    edited September 2017
    Thank you! :)
    for the records the issue is this one: I forgot about that

    Now my question is: should it work out of the box on android player or there is something else to do?
    The same app that works with @Sinistersoft files on windows player, on Android player gets an error (not better defined) as response.

    If I set

    I can see that my output is error 403 Forbidden
    Thank you

    p.s. if I use plain http it works, but I'd like to use https ;)
  • hgy29hgy29 Maintainer
    If you get a 403 response then it means that SSL handshake did succeed, and the server itself forbids you the access to the URL you asked. It can happen when the server does name based virtual hosting but the ssl stack doesn't support SNI extension.
  • Thank you, I will check with my hosting provider. But if the problem is this one shouldn't it happen on windows player too?
  • hgy29hgy29 Maintainer
    Accepted Answer
    Not necessariy, Gideros uses the OS routines to open http connections. It is possible that windows libs do support SNI while Android do not.
    In the case of Android, we are using the (deprecated) Apache HTTP library, which, according to this site: https://stackoverflow.com/questions/5879894/android-ssl-sni-support doesn't support SNI. The best way forward would be to switch to the official android HTTP library...

    Likes: antix, pie

    +1 -1 (+2 / -0 ) Share on Facebook
  • piepie Member
    edited October 2017
    I need to use https with urlloader:
    while gideros uses apache http library, as a workaround, is there a way to know if a host would work with gideros urlloader https before buying it? What should I ask to the hosting support?

    Thank you :)
Sign In or Register to comment.