Downloading an extension to the app
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Downloading an extension to the app
Hello all,
I'm creating an App both for desktop and mobile devices. I would like a feature to download an extension for the app, like an in app purchase. I had a look on how to add in app purchase for various devices but that's not what I'm looking for. I was wondering if it is possible to have the app download a card or a stack, preferable a card.
So I would like the app to have a button, and for that button if the card is available go to the card/stack if not then download the card/stack.
I tried searching for it but came up with nothing.
Help would be most appreciated.
Thank you
Sheldon
I'm creating an App both for desktop and mobile devices. I would like a feature to download an extension for the app, like an in app purchase. I had a look on how to add in app purchase for various devices but that's not what I'm looking for. I was wondering if it is possible to have the app download a card or a stack, preferable a card.
So I would like the app to have a button, and for that button if the card is available go to the card/stack if not then download the card/stack.
I tried searching for it but came up with nothing.
Help would be most appreciated.
Thank you
Sheldon
Re: Downloading an extension to the app
Hi Sheldon,
I think adding a stack is easier way than adding a card and you can use "start using" to use script of your app.
Anyway i think you have to download a stack to add a cd to your app ... and delete it after cd is copied
Best regards
Jean-Marc
I think adding a stack is easier way than adding a card and you can use "start using" to use script of your app.
Anyway i think you have to download a stack to add a cd to your app ... and delete it after cd is copied
Best regards
Jean-Marc
https://alternatic.ch
Re: Downloading an extension to the app
thank you Jean-Marc,
I've looked at start using in the dictionary but I don't understand it quite well.
Can you use all objects in that stack or just scripts.
I also looked at copy in dictionary and I understand that but what i don't understand is how to implement download from a standalone app, both desktop and mobile, and do I save the stacks for download as standalone apps. for example exe file for windows.
once I copy a card to use do still need to use "Start using".
Is there an example code or tutorial for this?
Thank you
Sheldon
I've looked at start using in the dictionary but I don't understand it quite well.
Can you use all objects in that stack or just scripts.
I also looked at copy in dictionary and I understand that but what i don't understand is how to implement download from a standalone app, both desktop and mobile, and do I save the stacks for download as standalone apps. for example exe file for windows.
once I copy a card to use do still need to use "Start using".
Is there an example code or tutorial for this?
Thank you
Sheldon
Re: Downloading an extension to the app
Sorry, my english is not the best in this forum. There is some guys whom think I can progress
http://forums.livecode.com/viewtopic.ph ... =+download

I my context I use scripts and custom properties but I think you can place a group from the mainstack onto downloaded stack or copy objets.Can you use all objects in that stack or just scripts.
this thread should be useful for thathow to implement download from a standalone app
http://forums.livecode.com/viewtopic.ph ... =+download
No. The stacks stay a .livecode file but you can open it from your standalone appdo I save the stacks for download as standalone apps. for example exe file for windows.
https://alternatic.ch
Re: Downloading an extension to the app
Hi Jean-Marc,
Sorry for the late reply. This helped a lot thank you.
I'm able to copy a card over into my standalone but when I close then execute the standalone again the card is not there. Is there a way to allow the standalone to retain the card after copying and close without having to copy again?
I hope I'm clear in what I want to achieve.
Thank you
Sheldon
Sorry for the late reply. This helped a lot thank you.
I'm able to copy a card over into my standalone but when I close then execute the standalone again the card is not there. Is there a way to allow the standalone to retain the card after copying and close without having to copy again?
I hope I'm clear in what I want to achieve.
Thank you
Sheldon
Re: Downloading an extension to the app
Hi Sheldon,
If you want add cds I think use stacks is a better way
Jean-Marc
NO.Your standalone remains like you compiled it when you close itIs there a way to allow the standalone to retain the card after copying
If you want add cds I think use stacks is a better way
Jean-Marc
https://alternatic.ch
Re: Downloading an extension to the app
Hi Sheldon,
please keep in mind that Apple stirctly forbids downloading "code"
and stacks are considered code by Apple unfortunately.
Can't you provide a "complete" stack and only let the user go to until then
forbidden cards/substacks after entering the "in-app-purchase" code?
Know what I mean?
No idea if this is feasable for with your app.
Best
Klaus
please keep in mind that Apple stirctly forbids downloading "code"
and stacks are considered code by Apple unfortunately.
Can't you provide a "complete" stack and only let the user go to until then
forbidden cards/substacks after entering the "in-app-purchase" code?
Know what I mean?
No idea if this is feasable for with your app.
Best
Klaus
Re: Downloading an extension to the app
Hi Jean-Marc,
Ok thank you.
All works for me except the progress bar. I followed the lesson located at livecode website how-to-show-the-progress-of-a-download because i did not understand it from your application.
When I use :
it only shows connected which leads to
being false and showProgress ending.
Any solution?
Thank you
Sheldon
Ok thank you.
All works for me except the progress bar. I followed the lesson located at livecode website how-to-show-the-progress-of-a-download because i did not understand it from your application.
When I use :
Code: Select all
put pStatus
Code: Select all
if the number of items in pStatus = 3 then
Any solution?
Thank you
Sheldon
Re: Downloading an extension to the app
Hi Sheldon,
Have a look to "--•• progress bar" in cd script
Jean-Marc
I just tested it and it works for meAll works for me except the progress bar
I used a custom progressbar. I'm not sure that was a good ideaI followed the lesson located at livecode website

Have a look to "--•• progress bar" in cd script
Jean-Marc
https://alternatic.ch
Re: Downloading an extension to the app
Hi Jean-Marc,
I really don't understand your custom progress bar, I know it should but I'm unable get my head around it.
This is the entire code I'm trying to use, and all work except the progress bar. I don't know what I'm doing wrong.
I'm on windows platform if that makes a different and I will be using the app on multiple platforms.
only minor changes from the livecode lesson
Thank you
Sheldon
I really don't understand your custom progress bar, I know it should but I'm unable get my head around it.
This is the entire code I'm trying to use, and all work except the progress bar. I don't know what I'm doing wrong.
I'm on windows platform if that makes a different and I will be using the app on multiple platforms.
Code: Select all
on mouseUp
put "urlToFile" into tDownloadLink
libURLSetStatusCallback "showPro", the long name of me
hide scrollbar "proBar"
load URL tDownloadLink with message "downloadComplete"
end mouseUp
command showPro pURL, pStatus
if the number of items in pStatus = 3 then
if the visible of scrollbar "proBar" = false then
put the last item of pStatus into tTotalBytes
set the startValue of scrollbar "proBar" to 0
set the endValue of scrollbar "proBar" to tTotalBytes
show scrollbar "proBar"
end if
set the thumbPosition of scrollbar "proBar" to item 2 of pStatus
end if
put pStatus
end showPro
command downloadComplete pURL, pStatus
hide scrollbar "proBar"
if pStatus = "error" or pStatus = "timeout" then
answer error "The file could not be downloaded."
else
put the effective filename of this stack into fPath
set the itemDelimiter to slash
delete last item of fPath
put last item of pURL into tFilename
put fPath & slash before tFileName
put URL pURL into URL ("binfile:" & tFileName)
unload pURL
end if
end downloadComplete
Thank you
Sheldon
Re: Downloading an extension to the app
Hi Sheldon,
For download I use libURLDownloadToFile, I never used "load URL"
I believe understand libURLDownloadToFile is better for callbacks (and also for mobile.
What do you get at
Best regards
Jean-Marc
For download I use libURLDownloadToFile, I never used "load URL"
I believe understand libURLDownloadToFile is better for callbacks (and also for mobile.
What do you get at
Code: Select all
...
put pStatus
end showPro
Jean-Marc
https://alternatic.ch
Re: Downloading an extension to the app
Hi Jean-Marc,
I get "contacted"
and i know i need it to had loading ***
I have no clue how to use libURLDownload
I will try and search for a tutorial on it.
EDIT: when I try a new button with just the libURL and callback it comes up as downloaded
Thank you
Sheldon
I get "contacted"
and i know i need it to had loading ***
I have no clue how to use libURLDownload
I will try and search for a tutorial on it.
EDIT: when I try a new button with just the libURL and callback it comes up as downloaded
Thank you
Sheldon
Re: Downloading an extension to the app
Hi Sheldon,
You can match the process
Best regards
Jean-Marc
I thought that stack "DownloadZipExtract001" was one.I have no clue how to use libURLDownload
I will try and search for a tutorial on it.

You can match the process
Best regards
Jean-Marc
https://alternatic.ch
Re: Downloading an extension to the app
I write back about the first subject of this thread.
As Klaus said, we can not download stack.
I’m working now for a « iTunes way » to add one folder with one stack, one .txt file and one subfolder with .txt files in the documents folder of my app. For OS X, Windows and iOS.
It works like that
First install
1. check folders with specific prefix like « onePackageModule_ » & nameModule exist in documents folder
2. check there is a file nameModule & « .txt «
This file contains one line to verify identity and one line about the folder content
3. move folder to new destination by rename folder
Update
1. check there is a same folder
2. check version in file nameModule & « .txt «
3. move stack by rename file
4. write version infos to file nameModule & « .txt «
Subfolder with .txt files (exemples and files created by user) is conserved
Best regards
Jean-Marc
As Klaus said, we can not download stack.
I’m working now for a « iTunes way » to add one folder with one stack, one .txt file and one subfolder with .txt files in the documents folder of my app. For OS X, Windows and iOS.
It works like that
First install
1. check folders with specific prefix like « onePackageModule_ » & nameModule exist in documents folder
2. check there is a file nameModule & « .txt «
This file contains one line to verify identity and one line about the folder content
3. move folder to new destination by rename folder
Update
1. check there is a same folder
2. check version in file nameModule & « .txt «
3. move stack by rename file
4. write version infos to file nameModule & « .txt «
Subfolder with .txt files (exemples and files created by user) is conserved
Best regards
Jean-Marc
https://alternatic.ch