Android test and standalone seem to ignore plugins[SOLVED]

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
hilton
Posts: 35
Joined: Sat Dec 13, 2014 11:16 am

Android test and standalone seem to ignore plugins[SOLVED]

Post by hilton » Fri Jan 30, 2015 11:09 am

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

Code: Select all

answer the openStacks with "ok"
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.
Last edited by hilton on Sat Jan 31, 2015 10:49 am, edited 1 time in total.

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

Re: Android test and standalone seem to ignore plugins

Post by Klaus » Fri Jan 30, 2015 2:35 pm

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

hilton
Posts: 35
Joined: Sat Dec 13, 2014 11:16 am

Re: Android test and standalone seem to ignore plugins

Post by hilton » Fri Jan 30, 2015 8:57 pm

Hi Klaus,

Yes - and they are set to load automatically when the ide starts.

Hilton.

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

Re: Android test and standalone seem to ignore plugins

Post by Simon » Fri Jan 30, 2015 9:35 pm

Hi Hilton,
Was the IDE open when you ran the standalone?

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

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

Re: Android test and standalone seem to ignore plugins

Post by Klaus » Sat Jan 31, 2015 1:43 am

Hi Hilton,

short, but maybe important hint:
The "plug-in mechanism" is only available in the IDE and NOT in your standalone!


Best

Klaus

hilton
Posts: 35
Joined: Sat Dec 13, 2014 11:16 am

Re: Android test and standalone seem to ignore plugins

Post by hilton » Sat Jan 31, 2015 7:57 am

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.

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

Re: Android test and standalone seem to ignore plugins

Post by Simon » Sat Jan 31, 2015 9:48 am

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
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

hilton
Posts: 35
Joined: Sat Dec 13, 2014 11:16 am

Re: Android test and standalone seem to ignore plugins

Post by hilton » Sat Jan 31, 2015 10:27 am

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.

hilton
Posts: 35
Joined: Sat Dec 13, 2014 11:16 am

[SOLVED]Re: Android test and standalone seem to ignore plugi

Post by hilton » Sat Jan 31, 2015 10:47 am

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.

SparkOut
Posts: 2947
Joined: Sun Sep 23, 2007 4:58 pm

Re: Android test and standalone seem to ignore plugins[SOLVE

Post by SparkOut » Sat Jan 31, 2015 11:12 am

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

hilton
Posts: 35
Joined: Sat Dec 13, 2014 11:16 am

Re: Android test and standalone seem to ignore plugins[SOLVE

Post by hilton » Sat Jan 31, 2015 12:02 pm

Thank you very much SparkOut,
Hilton.

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

Re: Android test and standalone seem to ignore plugins[SOLVE

Post by Klaus » Sat Jan 31, 2015 1:47 pm

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

hilton
Posts: 35
Joined: Sat Dec 13, 2014 11:16 am

Re: Android test and standalone seem to ignore plugins[SOLVE

Post by hilton » Sun Feb 01, 2015 6:06 am

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.

Post Reply