Environment: which applies when?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Environment: which applies when?
I’d like to understand when the different environments operate: e.g., consider “development”, “standalone application”, and “mobile”. Which one applies when:
i) testing using the iOS simulator on Mac
ii) testing with iOS device connected to the Mac
iii) standalone installed on the iOS device
Thanks,
Sri
i) testing using the iOS simulator on Mac
ii) testing with iOS device connected to the Mac
iii) standalone installed on the iOS device
Thanks,
Sri
Re: Environment: which applies when?
Hi Sri,
for all three BOTH applies:
the environment = "standalone application" AND the environment = "mobile"
Best
Klaus
for all three BOTH applies:
the environment = "standalone application" AND the environment = "mobile"
Best
Klaus
Re: Environment: which applies when?
Heya Sri,
*If* your sure you don't mean 'engine', you can stick in somewhere (probably openCard) something like
...which will tell you exactly where your program is working in.
*If* your sure you don't mean 'engine', you can stick in somewhere (probably openCard) something like
Code: Select all
answer the environment
Re: Environment: which applies when?
May be I wasn't clear about my confusion!
Suppose I want to play a video in an iOS app, being developed on a Mac.
The code might be
Would it be appropriate to use "mobile" if I am testing on a simulator? or would the program consider the environment to be "development", as we are not really testing it on an iOS device?
Are "standalone" and "mobile" interchangeable in the above example?
Thanks,
Sri
Suppose I want to play a video in an iOS app, being developed on a Mac.
The code might be
Code: Select all
if the environment is "development" then
show player 1
start player 1
else if the environment is "mobile" then
play video tVideoURL
end if
Are "standalone" and "mobile" interchangeable in the above example?
Thanks,
Sri
Re: Environment: which applies when?
OH!
Sorry, I sure don't know much about the simulators and how they work, but, you certainly could still find out what environment the simulator is using with what I posted.
*IF* the answer is mobile, then try the tUrl code. How long could it take to test? (Again, I have no idea how the simulators work! I suppose it could take hours )
...But, I know a few who don't use the simulators at all for testing, and I suppose that if you really wanted it to be a 'mobile' environment, you could test directly on the device itself (did I mention I don't develop on mobile?_)
Sorry, I sure don't know much about the simulators and how they work, but, you certainly could still find out what environment the simulator is using with what I posted.
*IF* the answer is mobile, then try the tUrl code. How long could it take to test? (Again, I have no idea how the simulators work! I suppose it could take hours )
...But, I know a few who don't use the simulators at all for testing, and I suppose that if you really wanted it to be a 'mobile' environment, you could test directly on the device itself (did I mention I don't develop on mobile?_)
Re: Environment: which applies when?
Ah, OK, if the environment = "mobile" it CANNOT be "development" at the same time.
And the simulator should report "mobile".
Is that what you mean?
And the simulator should report "mobile".
Is that what you mean?
Re: Environment: which applies when?
Klaus:
It is not "development" and "mobile" at the same time!
See, "play video" works only on mobile, where it plays a video fullscreen.
"Player" object works only on desktop OS.
So, while developing I put in "if the environment is ...." clause, so it works on both (while testing).
If the simulator considers its environment as "mobile", then "play video" should run on the simulator, resulting in a fullscreen (i.e., stack size) video.
So, my question was both practical and conceptual. I wondered when I would use "standalone" instead of "mobile". I guess "standalone" is to be used for desktop standalone. (The environment options seem to be a mishmash of OSs and device types. I don't see a function for determining the OS. There is only a systemVersion)
Regards,
Sri
It is not "development" and "mobile" at the same time!
See, "play video" works only on mobile, where it plays a video fullscreen.
"Player" object works only on desktop OS.
So, while developing I put in "if the environment is ...." clause, so it works on both (while testing).
If the simulator considers its environment as "mobile", then "play video" should run on the simulator, resulting in a fullscreen (i.e., stack size) video.
So, my question was both practical and conceptual. I wondered when I would use "standalone" instead of "mobile". I guess "standalone" is to be used for desktop standalone. (The environment options seem to be a mishmash of OSs and device types. I don't see a function for determining the OS. There is only a systemVersion)
Regards,
Sri
-
- VIP Livecode Opensource Backer
- Posts: 7235
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Environment: which applies when?
The OS is returned in "the platform".
Only the IDE is considered "development", the mobile environment is anything that is running the mobile version of the OS whether it's a phone, simulator, or emulator.
Note that the iOS simulator finds files using the same paths as the IDE (that is, the Mac Finder locations) where a real phone uses a different internal path. The best way to build a file path is to use the specialFolderPath function which will sort out the differences for you. In particular, use specialFolderPath("resources") to find videos and keep the videos in the same folder, or a subfolder, of the mainstack.
Only the IDE is considered "development", the mobile environment is anything that is running the mobile version of the OS whether it's a phone, simulator, or emulator.
Note that the iOS simulator finds files using the same paths as the IDE (that is, the Mac Finder locations) where a real phone uses a different internal path. The best way to build a file path is to use the specialFolderPath function which will sort out the differences for you. In particular, use specialFolderPath("resources") to find videos and keep the videos in the same folder, or a subfolder, of the mainstack.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
Re: Environment: which applies when?
Hi Sri,
if not "mobile" then it must be desktop, so this should do the job:
Best
Klaus
if not "mobile" then it must be desktop, so this should do the job:
Code: Select all
...
if the environment = "mobile" then
play video tVideoURL
else
## Desktop: IDE or Standalone
show player 1
start player 1
end if
...
Klaus
Re: Environment: which applies when?
The dictionary says, "On iOS systems, only create files in the "documents", "cache" and "temporary" folders. Be careful not to change or add any files within the application bundle. The application bundle is digitally signed when it is built, and any changes after this point will invalidate the signature and prevent it from launching."
If my app is designed to periodically add videos and text files that are part of program resources (as opposed to user-created files), where would I put them? Evidently, not in "resources" folder (due to signature invalidation, above). Keeping it in "documents" folder doesn't make sense, as I wouldn't want the user to be able to access them outside of the app.
Thanks,
Sri
-
- VIP Livecode Opensource Backer
- Posts: 7235
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Environment: which applies when?
On mobile the documents folder is not available to anyone (or any other app) because it's inside the app sandbox. To share resources outside the sandbox you'd use specialFolderPath("external documents"). Files in documents are safe unless the user has rooted the android device or jailbroken the iPhone, unless the user is very focused on cracking your particular app and has the skills to do so. There's no failsafe way around that for any app.
I'd store the files in documents if you want to be sure they are permanently available. If they are intended only for the current session then cache or temporary are a good choice.
I'd store the files in documents if you want to be sure they are permanently available. If they are intended only for the current session then cache or temporary are a good choice.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
Re: Environment: which applies when?
That helps. (Although there is still a great deal of iOS fog in my mind!)
Thank you.
Sri.
Thank you.
Sri.
Re: Environment: which applies when?
I am sorry to bring this up again, but
in the case of a standalone application running on iOS
what would the function environment() return?
"standalone application" or "mobile" ?
Why?
(I am assuming the function returns only one result).
Thanks,
Sri
in the case of a standalone application running on iOS
what would the function environment() return?
"standalone application" or "mobile" ?
Why?
(I am assuming the function returns only one result).
Thanks,
Sri
-
- VIP Livecode Opensource Backer
- Posts: 2718
- Joined: Sat Dec 22, 2007 5:35 pm
- Location: Genève
- Contact:
Re: Environment: which applies when?
Hi Sri,
Best
Jean-Marc
it should be "mobile"what would the function environment() return?
"standalone application" or "mobile" ?
Best
Jean-Marc
https://alternatic.ch
-
- VIP Livecode Opensource Backer
- Posts: 7235
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Environment: which applies when?
The reason is that originally LC only produced desktop standalones. When mobile was added we needed a new term to differentiate.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com