Page 1 of 1

Remote stack (via internet) on Android?

Posted: Mon Mar 31, 2014 5:04 pm
by EssoAir
Can I load an external stack from a server to an Android or iOS standalone?

Re: Remote stack (via internet) on Android?

Posted: Fri Apr 04, 2014 3:16 am
by Simon
Hi EssoAir,
I just tried;

Code: Select all

on mouseUp
   go stack URL "http://www.mysite.com/myStack.livecode"
end mouseUp
on my Android device and it is working, even after I turned off "Allow installation from unknown .." (after I loaded the test stack).

I don't know what Apple thinks of doing this, they may see it a bad.

Simon

Re: Remote stack (via internet) on Android?

Posted: Fri Apr 04, 2014 11:45 am
by Klaus
Hi guys,

I am afraid that this will be seen as "loading external code"***, which is strictly prohibited on iOS! :(
*** Even if the remote stack does not contain any scripts!


Best

Klaus

Re: Remote stack (via internet) on Android?

Posted: Thu Apr 17, 2014 2:25 am
by EssoAir
Klaus wrote:Hi guys,

I am afraid that this will be seen as "loading external code"***, which is strictly prohibited on iOS! :(
*** Even if the remote stack does not contain any scripts!


Best

Klaus
But what if Apple didn't know this is how it worked? Is there a way I can run a command from a variable such as

Code: Select all

put "go stack url" into tCommand
execute code from tCommand

Re: Remote stack (via internet) on Android?

Posted: Thu Apr 17, 2014 10:23 am
by Klaus
EssoAir wrote:But what if Apple didn't know this is how it worked?
Come on! 8)

Re: Remote stack (via internet) on Android?

Posted: Thu Apr 17, 2014 3:17 pm
by EssoAir
Klaus wrote:
EssoAir wrote:But what if Apple didn't know this is how it worked?
Come on! 8)

Ok ok i know its a long shot, but can you load a command as a string in to a variable and excecute it? Can this be done on desktop?

Like, for example, can I have a user enter a command into a text field and have that command be run by the stack?

Re: Remote stack (via internet) on Android?

Posted: Thu Apr 17, 2014 3:44 pm
by FourthWorld
If a stack file is merely a media container and includes no code at all, it may be viewed as compliant with Apple's terms.

However, even then it's possible with just property settings to alter the execution path of an app, and in such cases it may be seen as a violation.

If one were sufficiently motivated to test Apple's boundaries I suppose an experimental app could be made to see what we can get away with. But personally, I wouldn't risk having my company permanently banned from the Apple store; trying to trick one of the world's most powerful multinationals seems unlikely to turn out favorably, esp. in an area that they regard as related to end-user security.

It may be simpler to just do as Apple's license terms appear to suggest: if you want to freely share executable code modules over HTTP, ignore iOS and deploy exclusively for Android.

Re: Remote stack (via internet) on Android?

Posted: Thu Apr 17, 2014 3:47 pm
by FourthWorld
EssoAir wrote:
Klaus wrote:
EssoAir wrote:But what if Apple didn't know this is how it worked?
Come on! 8)

Ok ok i know its a long shot, but can you load a command as a string in to a variable and excecute it? Can this be done on desktop?

Like, for example, can I have a user enter a command into a text field and have that command be run by the stack?
I don't believe Apple still has any prohibition against user-generated code executing locally. Indeed, I believe there's at least one BASIC app available in their app store.

The restriction, as I understand it, is against sharing executable code, allowing others to execute code they didn't write and wasn't reviewed by Apple's release process.

Re: Remote stack (via internet) on Android?

Posted: Thu Apr 17, 2014 4:39 pm
by EssoAir
FourthWorld wrote:If a stack file is merely a media container and includes no code at all, it may be viewed as compliant with Apple's terms.

However, even then it's possible with just property settings to alter the execution path of an app, and in such cases it may be seen as a violation.

If one were sufficiently motivated to test Apple's boundaries I suppose an experimental app could be made to see what we can get away with. But personally, I wouldn't risk having my company permanently banned from the Apple store; trying to trick one of the world's most powerful multinationals seems unlikely to turn out favorably, esp. in an area that they regard as related to end-user security.

It may be simpler to just do as Apple's license terms appear to suggest: if you want to freely share executable code modules over HTTP, ignore iOS and deploy exclusively for Android.
I get that and understand it, but do you know the answer to the question? Can a command be executed from a string variable such that on a desktop standalone one could make a strange web-console type thing where the user enters LiveCode commands that are executed by the stack?

Re: Remote stack (via internet) on Android?

Posted: Thu Apr 17, 2014 4:43 pm
by EssoAir
tl;dr I get you all have concerns but I'd really appreciate it if you let me deal with the apple review process and instead just help me out with the question at hand, that being: Can a command be run from a string variable?

For clarity, I'm working on an app. It will be an easy to use application for all platforms supported by LiveCode where the standalone itself is just a container where the user enters a URL and from that URL a simple "go stack url tURL" command is executed. The purpose of this in my mind is so that I can more easily develop apps and test them on all platforms without having to build a new standalone for every small code change I make. I already did this once back in my HTML5 phonegap days and it works perfectly, now I simply want to bring that same idea over to livecode. It seems rather doable, but my current issue is iOS. There are tons of downloader apps in the appstore so it would be easy to disguise it as one of those and have this feature almost implemented as a backdoor or sorts. Simple making an if(tURL contains ".livecode"){go stack url tUrl;}. But I think that would get caught by the apple review process. So instead I can make it more complex and confusing. I can have messages flying all over the place, making it very messy, by if and only if the user enters a valid url that ends in .livecode, then it will go to that stack.

Re: Remote stack (via internet) on Android?

Posted: Thu Apr 17, 2014 6:06 pm
by Klaus
Hi Esso,
EssoAir wrote:Can a command be run from a string variable?
Yes, you could use the "DO" command for example, Mr. Thrillseeker :D


Best

Klaus

Re: Remote stack (via internet) on Android?

Posted: Thu Apr 17, 2014 6:13 pm
by EssoAir
Klaus wrote:Hi Esso,
EssoAir wrote:Can a command be run from a string variable?
Yes, you could use the "DO" command for example, Mr. Thrillseeker :D


Best

Klaus
Wow i feel stupid! I saw "do" in the revdocs and assumed it was a do-while loop like in most programming languages.

Thank you good sir!

Re: Remote stack (via internet) on Android?

Posted: Thu Apr 17, 2014 6:51 pm
by EssoAir
I need to do some more obscuring work, but here is the basic thing I got going

Code: Select all

//Within the card

on openCard
   if the environment <> "mobile" then exit openCard
   mobileControlCreate "input", "urlBar"
   mobileControlSet "urlBar", "visible", true
   put the rect of control "urlBarRect" into iRect  //urlBarRect is just a rectangle 
   mobileControlSet "urlBar", "rect", iRect           //placed where i want the input
end openCard                                                   //field to go


//Inside the button
on mouseUp
   mobileControlDelete "urlBar"
   put mobileControlGet "urlBar", "text" into urlText 
   if urlText contains ".livecode" then //it assumes that you wrote the entire command into the line so that it
      do urlText                                  //would only actually run if you wrote the folloing:
   else                                              // go stack url "http://yourserver.com/path/to/file/Example.livecode"
      mobileControlCreate "browser", "urlBrowser"
      put the rect of control "urlBrowserRect" into tRect
      mobileControlSet "rect", "urlBrowser", tRect
      mobileControlSet "urlBrowser", "visible", "true"
      mobileControlSet "urlBrowser", "url", urlText
   end if
end mouseUp
What do you think?