Recent

Author Topic: using OpenURL  (Read 3707 times)

ausdigi

  • Jr. Member
  • **
  • Posts: 52
  • Programmer
    • RNR
using OpenURL
« on: February 04, 2015, 02:01:54 am »
I'm testing laztoapk and wanted to open a URL
Code: [Select]
OpenURL('http://web-site.com')But when I run that on the Android simulator (AVD) it seems to be replacing (URL encoding) the two slashes with %2F instead (and ending up doing a google search with my URL). I've tried escaping the slashes in various ways without success and leaving out the "http://" part results in it doing nothing. Is Lazarus doing anything or where is the problem? I am having trouble following the code because it goes through a OpenURLWidgetsetImplementation variable and I got lost.
Win10/64: CT 5.7 32&64

Leledumbo

  • Hero Member
  • *****
  • Posts: 8757
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: using OpenURL
« Reply #1 on: February 04, 2015, 07:09:02 am »
I am having trouble following the code because it goes through a OpenURLWidgetsetImplementation variable and I got lost.
If you use LCL custom drawn for android, the implementation is in lcl/interfaces/customdrawn/customdrawnobject_android.inc. Just see what it does and why your URL doesn't work.

ausdigi

  • Jr. Member
  • **
  • Posts: 52
  • Programmer
    • RNR
Re: using OpenURL
« Reply #2 on: February 04, 2015, 11:59:03 pm »
thanks for that...

TCDWidgetSet.DoOpenURLWidgetsetImplementation just splits the URL in to the "protocol" section and the rest and then passes those strings on to Lava (by the looks of things). When I run it in the emulator it seems to turn that straight in to a google search query, rather than opening the actual URL. So I don't know where the problem is and I don't think I can work it out so I'll just never put a clickable link into an Android app if I ever write a proper one.
Win10/64: CT 5.7 32&64

 

TinyPortal © 2005-2018