Creating LiveCode applications that play well with git
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- VIP Livecode Opensource Backer
- Posts: 1005
- Joined: Sat Apr 08, 2006 3:06 pm
- Location: Overland Park, Kansas
- Contact:
Re: Creating LiveCode applications that play well with git
Try setting the behavior to the long id of the stack.
Trevor DeVore
ScreenSteps - https://www.screensteps.com
LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder
ScreenSteps - https://www.screensteps.com
LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder
Re: Creating LiveCode applications that play well with git
As if by magic that worked - my guess is you knew it would Since it was already loaded into memory I thought the stack name was enough. Also, just putting "the long id" in front of the name isn't supplying any more information so a bit puzzling to me. The dictionary syntax wasn't clear when you need the long id.Try setting the behavior to the long id of the stack
Glad you were there with your knowledge - thanks!
-
- VIP Livecode Opensource Backer
- Posts: 1005
- Joined: Sat Apr 08, 2006 3:06 pm
- Location: Overland Park, Kansas
- Contact:
Re: Creating LiveCode applications that play well with git
You're welcome. I'm still puzzled as to why you are having problems setting the stackFiles to the behavior, though.jim1001 wrote:Since it was already loaded into memory I thought the stack name was enough. Also, just putting "the long id" in front of the name isn't supplying any more information so a bit puzzling to me. The dictionary syntax wasn't clear when you need the long id.
Glad you were there with your knowledge - thanks!
Trevor DeVore
ScreenSteps - https://www.screensteps.com
LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder
ScreenSteps - https://www.screensteps.com
LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder
Re: Creating LiveCode applications that play well with git
Trevor,
Tried to move my project from local drive to a network as I saw you had updated Levure to allow use of network drives (didn’t realise it was so long since I checked!).
I had the local drive project open in LiveCode which I exited. I then copied the file structure onto the network drive. When I opened the project on the network drive I got lots of messages of form “A stack with the same name as the one you are trying to load is already open. Before loading <network drive stack> what do you want to do with <local drive stack>?”
Thanks for help.
Tried to move my project from local drive to a network as I saw you had updated Levure to allow use of network drives (didn’t realise it was so long since I checked!).
I had the local drive project open in LiveCode which I exited. I then copied the file structure onto the network drive. When I opened the project on the network drive I got lots of messages of form “A stack with the same name as the one you are trying to load is already open. Before loading <network drive stack> what do you want to do with <local drive stack>?”
- If I’ve exited LiveCode when the local drive stacks were open why are they still open when I close then start a fresh instance of LiveCode? They do have destroyStack set to false but shouldn’t they be removed from memory when LiveCode exits?
- To stop it happening in the future I’ve read on the forums that you can a) set destroyStack property to “true” for new stacks in Preferences and b) set destroyStack “true” for existing stacks. Would that create any problems with a Levure project?
- Even if I choose to purge the local stacks they are still reported as open the next time I open the network drive project. Is the answer to open the local project, set all stacks with destroyStack as true, close LiveCode then open it again on the network project?
Thanks for help.
Re: Creating LiveCode applications that play well with git
One more for the road Trevor:
I’m not copying my media onto the Android device every time I install my application. I have the media already on the device and refer to the absolute path of a media file from code within my app. If I want to set an Assets / Media directory base location for use when running on Android (that will be a different location to the corresponding IDE directory) is the best / natural Levure way to put it in a preferences : shared : android file? I’m not sure if that’s a recommended use for preference files.
ps: I don’t quite understand how you’ve used preferences in the Bell Conductor app. In app.yml you set different values for preferences filename > user > default & windows. But you also have a prefs.yml set in the build profiles section. Please can you explain?
Many thanks,
Jim
I’m not copying my media onto the Android device every time I install my application. I have the media already on the device and refer to the absolute path of a media file from code within my app. If I want to set an Assets / Media directory base location for use when running on Android (that will be a different location to the corresponding IDE directory) is the best / natural Levure way to put it in a preferences : shared : android file? I’m not sure if that’s a recommended use for preference files.
ps: I don’t quite understand how you’ve used preferences in the Bell Conductor app. In app.yml you set different values for preferences filename > user > default & windows. But you also have a prefs.yml set in the build profiles section. Please can you explain?
Many thanks,
Jim
-
- VIP Livecode Opensource Backer
- Posts: 1005
- Joined: Sat Apr 08, 2006 3:06 pm
- Location: Overland Park, Kansas
- Contact:
Re: Creating LiveCode applications that play well with git
`shared` preferences won't work on mobile devices. AFAIK there isn't a shared location for mobile devices. If there is then we would need to add the logic to the preferences helper.jim1001 wrote:I’m not copying my media onto the Android device every time I install my application. I have the media already on the device and refer to the absolute path of a media file from code within my app. If I want to set an Assets / Media directory base location for use when running on Android (that will be a different location to the corresponding IDE directory) is the best / natural Levure way to put it in a preferences : shared : android file? I’m not sure if that’s a recommended use for preference files.
While you could use preferences to store a path, I don't think I would Unless the path is going to be different on every Android device I would probably just write a function that returns a different value based on the environment.
Code: Select all
function MediaAssetFolder
if the environment is "development" then
# return IDE path
else
# return Android path
end if
end MediaAssetFolder
prefs.yml stores default values to use for preferences. See these docs:jim1001 wrote:ps: I don’t quite understand how you’ve used preferences in the Bell Conductor app. In app.yml you set different values for preferences filename > user > default & windows. But you also have a prefs.yml set in the build profiles section. Please can you explain?
https://github.com/trevordevore/levure/ ... ces-values
Trevor DeVore
ScreenSteps - https://www.screensteps.com
LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder
ScreenSteps - https://www.screensteps.com
LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder
Re: Creating LiveCode applications that play well with git
Thanks for the advice. That was an option I’d considered & good to know your thoughts.I would probably just write a function that returns a different value based on the environment.
I had looked at the preferences docs on the wiki before my first posting & have just looked at them again. As I understand it now:
- the developer sets default app preferences in prefs.yml. The user cannot read or write to these.
- if an app uses preferences then the developer can ask the user whether they want to share preferences for all users of the device (maybe on install?) This would determine whether in the app code preferences are stored to the shared or user preferences file
- the user can override the default prefs.yml preferences by setting values in the app. These user-set preferences are then stored in the file specified by the developer in app.yml > preferences filename > user / shared prefs file
Thanks.
Re: Creating LiveCode applications that play well with git
Re: the above messages from one of my previous postsWhen I opened the project on the network drive I got lots of messages of form “A stack with the same name as the one you are trying to load is already open.
I think (hope) I may have found the problem. I set a lot of behavior script files as stack files of the UI in the app.livecodescript file & use levureAppFolder() for the first part of the path to the behavior script files. However LiveCode hardcodes these paths in the UI .livecode file on saving. So even though I moved the project to a network drive Z: these files were trying to be loaded from the local C: drive on project startup.
When I saved the UI .livecode file after clicking through all the warning messages & clicking the “Open application” button for the Levure app the stack files were then hardcoded as Z:/… in the saved UI .livecode file on disk. The next time I opened the network drive project I didn’t get the “stack with the same name…” messages.
Hope that makes sense!
-
- VIP Livecode Opensource Backer
- Posts: 1005
- Joined: Sat Apr 08, 2006 3:06 pm
- Location: Overland Park, Kansas
- Contact:
Re: Creating LiveCode applications that play well with git
Yes it does. I think if you try setting the stackFiles property by hand (rather than using the PI) then you can use relative paths to the behavior files without the IDE adding the full paths. In LC 9 the PI works properly. In LC 8 there are still some issues with relative paths. I just set the stackFiles by hand and it works for me and I don't have to worry about setting the stackFiles in my code.
Trevor DeVore
ScreenSteps - https://www.screensteps.com
LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder
ScreenSteps - https://www.screensteps.com
LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder
Re: Creating LiveCode applications that play well with git
Trevor,
Testing on an Android device using the uninstall - build apk - install apk works reliably. I'm doing it all the time using the method described in the wiki. We talked a while back in this thread (Jun 15) about the Test button. It would really speed things up if that could work for an Levure Android app the same way it works for a non-Levure one. Could I put in a request for it? I know you'll have another million things on your to-do list but hope you don't mind me asking. I've no idea how complex it would be to get it working.
ps: using Levure all the time and slowly trying more & more features. Wouldn't go back.
Thanks,
Jim
Testing on an Android device using the uninstall - build apk - install apk works reliably. I'm doing it all the time using the method described in the wiki. We talked a while back in this thread (Jun 15) about the Test button. It would really speed things up if that could work for an Levure Android app the same way it works for a non-Levure one. Could I put in a request for it? I know you'll have another million things on your to-do list but hope you don't mind me asking. I've no idea how complex it would be to get it working.
ps: using Levure all the time and slowly trying more & more features. Wouldn't go back.
Thanks,
Jim
-
- VIP Livecode Opensource Backer
- Posts: 1005
- Joined: Sat Apr 08, 2006 3:06 pm
- Location: Overland Park, Kansas
- Contact:
Re: Creating LiveCode applications that play well with git
Have you tried `levurePackageApplication "android simulator"`?
https://github.com/trevordevore/levure/ ... -simulator
https://github.com/trevordevore/levure/ ... -simulator
Trevor DeVore
ScreenSteps - https://www.screensteps.com
LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder
ScreenSteps - https://www.screensteps.com
LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder
Re: Creating LiveCode applications that play well with git
Hi Trevor,
Thanks for the suggestion.
I spent a lot of time a few months back (pre-Levure) trying to get a simulator for my target Android device working satisfactorily. Gave up in the end when I saw how quick & easy it was to test on the real thing using the Test button. The app I'm working on will be used on a specific tablet model (at least for first phase) so using the real thing lets me see exactly how it will look for users.
Thanks for the suggestion.
I spent a lot of time a few months back (pre-Levure) trying to get a simulator for my target Android device working satisfactorily. Gave up in the end when I saw how quick & easy it was to test on the real thing using the Test button. The app I'm working on will be used on a specific tablet model (at least for first phase) so using the real thing lets me see exactly how it will look for users.
Re: Creating LiveCode applications that play well with git
I’m trying to create an Android app similar to the stack here, only in Levure:
http://forums.livecode.com/viewtopic.ph ... 15#p158077
This uses some javascript to display a PDF file in the same folder. I’ve tested it works on Android.
With Levure I can get a test file I put in <levureAppFolder()>/assets/pdfjs/web/ to display in the browser.
I can also get an empty PDF reader to show by setting the browser URL to <levureAppFolder()>/assets/pdfjs/web/viewer.html
However, in the last case, the default test PDF file that should be loaded from viewer.js in the same folder doesn’t appear in the PDF reader.
Any idea why?
http://forums.livecode.com/viewtopic.ph ... 15#p158077
This uses some javascript to display a PDF file in the same folder. I’ve tested it works on Android.
With Levure I can get a test file I put in <levureAppFolder()>/assets/pdfjs/web/ to display in the browser.
I can also get an empty PDF reader to show by setting the browser URL to <levureAppFolder()>/assets/pdfjs/web/viewer.html
However, in the last case, the default test PDF file that should be loaded from viewer.js in the same folder doesn’t appear in the PDF reader.
Any idea why?
-
- VIP Livecode Opensource Backer
- Posts: 1005
- Joined: Sat Apr 08, 2006 3:06 pm
- Location: Overland Park, Kansas
- Contact:
Re: Creating LiveCode applications that play well with git
@jim1001 Sorry, I don't. I would suggest making a more detailed description of the setup that works (full folder names of all files being loaded, etc.) and the setup that doesn't work. Then we could compare to see where the differences are and determine where things are going wrong.
Trevor DeVore
ScreenSteps - https://www.screensteps.com
LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder
ScreenSteps - https://www.screensteps.com
LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder
-
- VIP Livecode Opensource Backer
- Posts: 1005
- Joined: Sat Apr 08, 2006 3:06 pm
- Location: Overland Park, Kansas
- Contact:
Re: Creating LiveCode applications that play well with git
I wonder if this could be related? Spaces in the filename affect PDF loading in browser widget:
http://quality.livecode.com/show_bug.cgi?id=19226
http://quality.livecode.com/show_bug.cgi?id=19226
Trevor DeVore
ScreenSteps - https://www.screensteps.com
LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder
ScreenSteps - https://www.screensteps.com
LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder