Page 1 of 1
Android test and standalone seem to ignore plugins[SOLVED]
Posted: Fri Jan 30, 2015 11:09 am
by hilton
Hi folks,
(livecode 7.0.0-rc-2 build 10016)
Everything has worked ok until I decided to remove 2 substacks from an app and turn them into plugins. The plugins are generally used so the stacks are automatically loaded into the ide. I have included the code
Code: Select all
on preOpenStack
start using this stack
end preOpenStack
on the first card of each plugin stack.
When running in the ide all is fine.
When creating a windows standalone everything still works.
When testing Android or creating an Android standalone the functionality of the 2 plugin stacks is missing.
I also tried to list openstacks with
however, this did not work on Android - it worked fine in the ide.
I can revert to making the stacks subStacks, but would prefer not to.
Any ideas?
Thanks Hilton.
Re: Android test and standalone seem to ignore plugins
Posted: Fri Jan 30, 2015 2:35 pm
by Klaus
Hi Hilton,
hilton wrote:...I decided to remove 2 substacks from an app and turn them into plugins.
do you mean a plug-in like you can access in menu "Development: Plugins:..."?
Best
Klaus
Re: Android test and standalone seem to ignore plugins
Posted: Fri Jan 30, 2015 8:57 pm
by hilton
Hi Klaus,
Yes - and they are set to load automatically when the ide starts.
Hilton.
Re: Android test and standalone seem to ignore plugins
Posted: Fri Jan 30, 2015 9:35 pm
by Simon
Hi Hilton,
Was the IDE open when you ran the standalone?
Simon
Re: Android test and standalone seem to ignore plugins
Posted: Sat Jan 31, 2015 1:43 am
by Klaus
Hi Hilton,
short, but maybe important hint:
The "plug-in mechanism" is only available in the IDE and NOT in your standalone!
Best
Klaus
Re: Android test and standalone seem to ignore plugins
Posted: Sat Jan 31, 2015 7:57 am
by hilton
Hi Klaus and Simon,
Simon:
I think the ide was open when I ran the standalone, so I have run the Windows standalone with the ide open AND with the ide closed and the result is the same. My Calendar plugin works fine - it will not work on an Android phone though.
Klaus:
Your comment is interesting as I have just run the Windows standalone as mentioned above and the plugin Calendar works fine.
Thanks for your interest,
Hilton.
Re: Android test and standalone seem to ignore plugins
Posted: Sat Jan 31, 2015 9:48 am
by Simon
Hi Hilton,
Sorry have to say nope.
Plugins are not copied to standalones.
Not sure what you are seeing and question why moving a substack there is needed?
Simon
Re: Android test and standalone seem to ignore plugins
Posted: Sat Jan 31, 2015 10:27 am
by hilton
Hi Simon,
Thanks for your comments, and yes I am sure you could ask all sorts of legitimate questions!
It seems to me that the ide I am using v7.0 rc-2 is a bit unstable or I am just too new with my Livecode learning. The project has become corrupted a couple of times and some stuff simply SEEMED to disappear. I then thought that it would be good to create three stacks to contain things like: General Functions, a Calendar and a date Picker(I do not want to wait for the Android bug with the date and time pickers to be fixed - the app crashes if you cancel the pickers(bug 14438)). The main thought being that if anything got corrupted, I would not lose it all (I now backup regularly during my sessions at the computer).
I then found a recipe on how to create a plugins and tried them. In my ignorance I may have misinformed you as I am still coming to grips all the new terminology. What I am doing is copying a group from the plugin as follows
Code: Select all
--copy calendar to this card
if exists(group "grpCalOuter") then
remove group "grpCalOuter" from this card
end if
copy group "grpCalOuter" of card "cardCalendar" of stack "Calendar" to this card
set the visible of group "grpCalOuter" to false
When you say that plugins are not copied I now understand what you and Klaus were getting at.
For some reason doing the above works fine in standalone windows but not in Android. The good thing about having problems is that I am learning a lot and am quite happy about that. If you have a suggestion for taking another approach, I would be pleased to hear them.
Thanks again,
Hilton.
[SOLVED]Re: Android test and standalone seem to ignore plugi
Posted: Sat Jan 31, 2015 10:47 am
by hilton
Hi Klaus and Simon,
I have figured out what is happening and it is all my fault due to many misunderstandings. The code in my previous message is fine during development, but before creating the standalone it needs to be changed to not try to copy anything. I changed the code and all is now working. Is there a way that I can tell in code if it is a standalone that is running as opposed to in the IDE?
**Just realised that I can test for the presence of the plugin stack to know if it is a standalone or in IDE.***
Thanks for allowing me to bounce things off you - it helped me think a bit more clearly about what was happening,
Hilton.
Re: Android test and standalone seem to ignore plugins[SOLVE
Posted: Sat Jan 31, 2015 11:12 am
by SparkOut
if the environment is "development" then
-- you know you are working in the IDE
end if
Check out the dictionary entry for the environment for details of the possibles
Re: Android test and standalone seem to ignore plugins[SOLVE
Posted: Sat Jan 31, 2015 12:02 pm
by hilton
Thank you very much SparkOut,
Hilton.
Re: Android test and standalone seem to ignore plugins[SOLVE
Posted: Sat Jan 31, 2015 1:47 pm
by Klaus
Hi Hilton,
if you want to "load" these stacks in your standalone just like a "plug-in", then do this:
1. Add your 2 (or more) stacks to the standalone via the "Copy files..." tab in the standalonebuilder.
All these files can be located in the standalone here -> specialfolderpath("engine")
Lets say they are named:
mylib1.livecode
mylib2.livecode
2. Add this script to your standalone stack:
Code: Select all
on preopenstack
put specialfolderpath("engine") & "/mylib1.livecode" into tLib1
put specialfolderpath("engine") & "/mylib2.livecode" into tLib2
start using stack tLib1
start using stack tLib2
## Done! :-)
## your preopenstack-stuff here...
end preopenstack
Best
Klaus
Re: Android test and standalone seem to ignore plugins[SOLVE
Posted: Sun Feb 01, 2015 6:06 am
by hilton
Hi Klaus,
Thanks for that and thanks to all who took an interest in my dilemma. I now have my date and time pickers working fine in Android. Being a learner, I will over the next few months contemplate what I have done with a view to improving the code, comments and naming conventions.
Bye,
Hilton.