Using launch url to open another app

The place to discuss anything and everything about running your LiveCode on Android

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Knoxf
Posts: 7
Joined: Wed Sep 17, 2014 11:27 am

Using launch url to open another app

Post by Knoxf » Wed Sep 17, 2014 12:08 pm

I was hoping that someone else has used "launch url" to open another app with a LiveCode app on an android device for example a phone, if so how does the syntax for the file path need to be constructed. I have tried many ways but i am very new to this and am not sure how to construct the path to an installed app on a android device. I have started with something like this: launch url "file:/sdcard/data/app/.....and so on" at this point i don't know if i point it only to a folder or is there a file that opens the app that i should include, I tested in Windows 7 and opened notepad (launch url "file:C:\Windows\notepad.exe") and that worked but i don't understand how it should be for android. If someone has used the launch url to open another app or even a built in / pre-installed app, could i get an example of the syntax of the full path used to open the app would be great. Thanks. Knox

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Using launch url to open another app

Post by Simon » Wed Sep 17, 2014 12:19 pm

Hi Knox,
I've only ever launched files from the "engine" or "documents" folders and that is;
launch url " file://...

There is another livecoder here looking to use files on the sd card, how are you finding the path to the file?

Simon
EDIT: OH And welcome to the forum! :)
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

Knoxf
Posts: 7
Joined: Wed Sep 17, 2014 11:27 am

Re: Using launch url to open another app

Post by Knoxf » Wed Sep 17, 2014 12:36 pm

That is just it I am not doing it I have not got any successful paths to work on and android device, that is the part that is stopping me. I have searched the internet and cant find any examples of how to construct that path. The results that come up from searches are mostly from the stackoverflow site and it is all in Java...and i am far from a Java developer....LiveCode is my first try at any coding...can you say NOOB...hahaha, but anyways if you or the other livecoder find anything out please let me know and if i find something i will reply to this thread and let you know. This seems like it would be so simple but it is proving to be difficult. Thanks. Knox

newtronsols
Posts: 192
Joined: Tue Mar 11, 2014 12:57 pm

Re: Using launch url to open another app

Post by newtronsols » Wed Sep 17, 2014 12:52 pm

Do you mean: http://lessons.runrev.com/m/4069/l/5867 ... rl-schemes

I did try to find/guess the custom url scheme for common apps like gmail etc without success. But it will work for your own app to your own app.

You can search and find custom url schemes for some apps like hulu: "hulu://". But often you try and find it doesn't work - they may have changed/eliminated it with new releases...

It's one area that Livecode could have led the way. Imagine if all Livecode apps had custom url schemes.

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Using launch url to open another app

Post by Simon » Wed Sep 17, 2014 1:02 pm

...can you say NOOB...hahaha
Not gonna happen here.

I just looked at a test app I made and I see it works with "mnt/sdcard/" with the path to the folder and file I made.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

Knoxf
Posts: 7
Joined: Wed Sep 17, 2014 11:27 am

Re: Using launch url to open another app

Post by Knoxf » Wed Sep 17, 2014 1:18 pm

Simon, what was the full path and what kind of file do you include in the path for android apps, this is my issue i don't understand how the folder / file structure works on an android device.

Knoxf
Posts: 7
Joined: Wed Sep 17, 2014 11:27 am

Re: Using launch url to open another app

Post by Knoxf » Wed Sep 17, 2014 4:02 pm

Simon, I just noticed in one of your posts you used this syntax launch url "file://..." are the two forward slashes after the colon required because i have only been using one.... just wondering if maybe that might be part of my problem, I am going to go try with two slashes now and see if i get any different results. Thanks. Knox

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Using launch url to open another app

Post by Klaus » Wed Sep 17, 2014 4:58 pm

Hi Knox,

open a local file in your browser and check the address line! -> file:///Users/klaus/Desktop/bassist.jpg
Its even 3 SLASHES! :D

But the last slash is coming from the file path as you get with "answer file..." -> /Users/klaus/Desktop/bassist.jpg


Best

Klaus

Knoxf
Posts: 7
Joined: Wed Sep 17, 2014 11:27 am

Re: Using launch url to open another app

Post by Knoxf » Wed Sep 17, 2014 6:20 pm

Klaus wrote:Hi Knox,

open a local file in your browser and check the address line! -> file:///Users/klaus/Desktop/bassist.jpg
Its even 3 SLASHES! :D

But the last slash is coming from the file path as you get with "answer file..." -> /Users/klaus/Desktop/bassist.jpg


Best

Klaus
Klaus, Ah I see, have you used launch url to open another app on an android device if so what is the full path used to give an example, here is the last thing i tried because i was searching through my test phone to look for where apps get installed :
launch url "file:/sdcard/Android/data/com.adobe.reader/" but it does not work i get prompted with a message asking what to open it with but none of the choices are adobe (HTML viewer and ES file explorer) but either i choose gives error "unfortunately, HTML Viewer has stopped." or same message but with ES file explorer. Thanks. Knox
but when i try this it does not open adobe reader

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Using launch url to open another app

Post by Simon » Wed Sep 17, 2014 7:17 pm

Hi Knox,
I don't think you can launch just the app... What we do is launch documents like my.pdf, my.jpg and let the OS choose the correct application to show the file in. The only app that we get launched empty is the mail app.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

Knoxf
Posts: 7
Joined: Wed Sep 17, 2014 11:27 am

Re: Using launch url to open another app

Post by Knoxf » Wed Sep 17, 2014 7:37 pm

Simon wrote:Hi Knox,
I don't think you can launch just the app... What we do is launch documents like my.pdf, my.jpg and let the OS choose the correct application to show the file in. The only app that we get launched empty is the mail app.

Simon
Oh, well I have a problem because the app I need to open is not one that has associated documents....for example .pdf or .jpg or files of that type. I need to open a app I built outside of live code in the MIT Appinventor, it is a barcode scanner it scans a QR code then saves the contents in a file then i have it set to close itsself and it sends a text result out that it finished. I was hoping to have livecode open that app and then when it gets the result back read the file and use that data. I was doing all this to try and work around the fact that livecode does not yet support QR code scanning for android. I guess its back to the drawing board for me. Thanks. Knox

P.S. Anybody know if you can open a app that does not have associated documents with a livecode command of some sort.

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Using launch url to open another app

Post by Simon » Wed Sep 17, 2014 9:58 pm

Hi Knox,
You could edit the AndroidManifest file for your barcode reader and associate it to a filetype.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

Post Reply