Remote stack (via internet) on Android?

The place to discuss anything and everything about running your LiveCode on Android

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
EssoAir
Posts: 52
Joined: Thu Feb 20, 2014 7:53 pm

Remote stack (via internet) on Android?

Post by EssoAir » Mon Mar 31, 2014 5:04 pm

Can I load an external stack from a server to an Android or iOS standalone?

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

Re: Remote stack (via internet) on Android?

Post by Simon » Fri Apr 04, 2014 3:16 am

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

Klaus
Posts: 13824
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Remote stack (via internet) on Android?

Post by Klaus » Fri Apr 04, 2014 11:45 am

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

EssoAir
Posts: 52
Joined: Thu Feb 20, 2014 7:53 pm

Re: Remote stack (via internet) on Android?

Post by EssoAir » Thu Apr 17, 2014 2:25 am

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

Klaus
Posts: 13824
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Remote stack (via internet) on Android?

Post by Klaus » Thu Apr 17, 2014 10:23 am

EssoAir wrote:But what if Apple didn't know this is how it worked?
Come on! 8)

EssoAir
Posts: 52
Joined: Thu Feb 20, 2014 7:53 pm

Re: Remote stack (via internet) on Android?

Post by EssoAir » Thu Apr 17, 2014 3:17 pm

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?

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9823
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Remote stack (via internet) on Android?

Post by FourthWorld » Thu Apr 17, 2014 3:44 pm

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.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9823
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Remote stack (via internet) on Android?

Post by FourthWorld » Thu Apr 17, 2014 3:47 pm

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.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

EssoAir
Posts: 52
Joined: Thu Feb 20, 2014 7:53 pm

Re: Remote stack (via internet) on Android?

Post by EssoAir » Thu Apr 17, 2014 4:39 pm

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?

EssoAir
Posts: 52
Joined: Thu Feb 20, 2014 7:53 pm

Re: Remote stack (via internet) on Android?

Post by EssoAir » Thu Apr 17, 2014 4:43 pm

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.

Klaus
Posts: 13824
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Remote stack (via internet) on Android?

Post by Klaus » Thu Apr 17, 2014 6:06 pm

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

EssoAir
Posts: 52
Joined: Thu Feb 20, 2014 7:53 pm

Re: Remote stack (via internet) on Android?

Post by EssoAir » Thu Apr 17, 2014 6:13 pm

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!

EssoAir
Posts: 52
Joined: Thu Feb 20, 2014 7:53 pm

Re: Remote stack (via internet) on Android?

Post by EssoAir » Thu Apr 17, 2014 6:51 pm

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?

Post Reply

Return to “Android Deployment”