Submitting for Both iPhone and iPad

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Brittgriscom
Posts: 95
Joined: Wed Mar 30, 2011 10:15 am

Submitting for Both iPhone and iPad

Post by Brittgriscom » Thu Jul 07, 2011 12:59 am

How do you submit for both iPhone and iPad, since LiveCode only asks for one icon size, and iTunes requires different icon sizes for ipad and the iphone?

I could just submit two apps, one for the iphone and one for the ipad, but then they would have different names.

Jellicle
Posts: 453
Joined: Thu Feb 24, 2011 11:07 am

Re: Submitting for Both iPhone and iPad

Post by Jellicle » Thu Jul 07, 2011 1:43 am

Couple of ways:

1
Make 2 stacks, one for each size of screen you want to support, duplicating all your controls, fields etc. in the right positions and at the right sizes for each screen size. Those are your target stacks.
Make a start up stack with the target stacks listed in the Copy Files part of the standalone settings for your app. Compile the start up stack when you make your iOS standalone.
The first time your app is launched on the device/simulator, run a script in the startup stack to copy the other stacks to the Documents folder on the device/simulator.
On the first and subsequent launches, go to the appropriate target stack for the device.

2
Make one stack, and use re-sizing and repositioning code to change its size, and move and switch all your controls etc, depending on which device the app finds itself running on.

I've done both, and there are pros and cons to each, depending on each circumstance.

Good luck :)

Gerry
14" MacBook Pro
Former LiveCode developer.
Now recovering.

Brittgriscom
Posts: 95
Joined: Wed Mar 30, 2011 10:15 am

Re: Submitting for Both iPhone and iPad

Post by Brittgriscom » Tue Jul 12, 2011 12:08 am

I mean when submitting for the app store. Apple requires icons of different sizes for ipad vs iphone apps, while livecode only gives you a place to input one icon size.

scotttyang
Posts: 125
Joined: Sat Jan 31, 2009 12:01 am

Re: Submitting for Both iPhone and iPad

Post by scotttyang » Wed Jul 13, 2011 2:43 am

Can one of you elaborate. I have prepared two stacks, one for iPad and one for the iphone/ipod. I made a mainstack that is invisible to open up either the iPad version or the iPhone version. Both stacks are in the "Copy File" of the standalone settings. When I put the app on the iPad, I only get a black screen.

on preOpenStack
set the visible of this stack to false
end preOpenStack

on openStack
if the environment is "mobile" then
if item 1 of iphoneDeviceResolution() = "640" then go to stack "spanish"
if item 1 of iphoneDeviceResolution() = "320" then go to stack "spanish"
if item 1 of iphoneDeviceResolution() = "768" then go to stack "spanishipad"
end if
end openStack[/color]

Where am I going wrong here?

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

Re: Submitting for Both iPhone and iPad

Post by Klaus » Wed Jul 13, 2011 2:45 pm

Hi Scotty,

from the "iOS Release Notes" about "iphoneDeviceResolution()":
## This will return a string in the form width, height – with the values being given in pixels.

The iPad has a resolution of 1024*768!
So it looks like you are just quering the wrong value!

Do the other conditons work?
I'm not sure about the iPhone resolutions.


Best

Klaus

andyh1234
Posts: 476
Joined: Mon Aug 13, 2007 4:44 pm
Contact:

Re: Submitting for Both iPhone and iPad

Post by andyh1234 » Fri Jul 15, 2011 12:37 am

Brittgriscom wrote:I mean when submitting for the app store. Apple requires icons of different sizes for ipad vs iphone apps, while livecode only gives you a place to input one icon size.
Although Livecode only asks you to specify the 57x57 icon path, it also looks for other icons and includes these if they are in the same folder as you 57x57 icon.

If your basic 57x57 icon is called 'icon.png' then you want to create the following icons for other devices...

icon.png (57x57 for iPhone original)
icon-72.png (72x72 for iPad)
icon-114.png (114x114 for iPhone Retina)

You just point live code at the icon.png file, and as long as the others are in the same folder it will do the rest.

Andy

Brittgriscom
Posts: 95
Joined: Wed Mar 30, 2011 10:15 am

Re: Submitting for Both iPhone and iPad

Post by Brittgriscom » Fri Jul 15, 2011 5:24 am

Great. Thanks.

jlally
Posts: 33
Joined: Wed Mar 21, 2012 6:48 pm
Contact:

Re: Submitting for Both iPhone and iPad

Post by jlally » Wed Sep 12, 2012 8:32 pm

Hello -

I'm trying out the "three stack" method listed in this thread (i.e. using a main stack with two substacks for iPad and iPhone), and am having trouble getting my substacks to retain their "Main Stack" property.

Here is an example of my workflow:

1) Open up myMainStack and myiPadSubStack simultaneously
2) Change the "Main Stack" property of myiPadSubStack to "myMainStack"
3) Save the changes to each stack

So far so good, but...

When I return focus to myiPadSubstack after saving, I find that myiPadSubstack's "Main Stack" property has changed itself back to "myiPadSubStack". (The same holds true when I try this with myiPhoneSubStack.) :P

Does anyone have ideas on what I might be doing wrong? Thanks in advance for any suggestions!
--John
Last edited by jlally on Thu Sep 13, 2012 12:57 am, edited 1 time in total.
Lodestone Animation, Inc.
Macaroni Art for iOS

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

Re: Submitting for Both iPhone and iPad

Post by Klaus » Wed Sep 12, 2012 9:42 pm

Hi John,

in cases like this you should always:
...
4. Quit and restart Livecode!
This will solve the problem most of the time 8)

If the problem still exists we will check what's going wrong, if it works, well, fine :D


Best

Klaus

jlally
Posts: 33
Joined: Wed Mar 21, 2012 6:48 pm
Contact:

Re: Submitting for Both iPhone and iPad

Post by jlally » Thu Sep 13, 2012 12:05 am

Hello, Klaus -

I quit LiveCode and ran steps 1-3 again as was suggested, but still no luck! I must have a couple of stubborn substacks. :p
Is there another way (through code, maybe) to change the Main Stack property?

Thanks again for your help!
--John

***Edit***
I've also tried setting the "Main Stack" property of "myiPhoneSubStack" via the message box, using this line of code:

set the mainStack of this stack to "myMainStack"

However, the message box throws this (not very descriptive) error:

Script compile error:
Error description:

(BTW, both "myiPhoneSubStack" and ""myiPadSubStack" will launch independently without error on both the physical and the virtual iPhone & iPad.)
Lodestone Animation, Inc.
Macaroni Art for iOS

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7389
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Submitting for Both iPhone and iPad

Post by jacque » Thu Sep 13, 2012 4:47 am

Do either of your substacks have their own substacks? You can't do that.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

jlally
Posts: 33
Joined: Wed Mar 21, 2012 6:48 pm
Contact:

Re: Submitting for Both iPhone and iPad

Post by jlally » Thu Sep 13, 2012 6:03 am

Hi, jacque -

Does a Data Grid Template count as a substack? If it does, then yes - I do. :P
I don't suppose there is a workaround for this...?

Cheers,
John
Lodestone Animation, Inc.
Macaroni Art for iOS

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7389
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Submitting for Both iPhone and iPad

Post by jacque » Thu Sep 13, 2012 6:42 pm

That would explain it then. The easiest way to deal with it is to just leave the stacks as independent files. Include them in the Stacks pane of the standalone settings and they should be found okay when your script wants to open them.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

jlally
Posts: 33
Joined: Wed Mar 21, 2012 6:48 pm
Contact:

Re: Submitting for Both iPhone and iPad

Post by jlally » Thu Sep 13, 2012 9:18 pm

Hi, jacque -

Thanks again for your quick reply. I took your suggestion and left my iPhone & iPad versions as independent stacks, adding them to my "Launcher" stack via the standalone pane. (For anyone else following, I also had to add a "Data Grid Templates Dud" substack so LiveCode would know to pull in the required data grid elements; See lesson here: http://lessons.runrev.com/s/lessons/m/d ... -data-grid).

The good news is - it now works in both the iPhone and in the iPad simulators! :)

The bad news, however, is that it does not work on the physical devices. I suspect the reason for this is that while the simulators are able to find the other stacks on my Mac, that my physical iPhone and iPad have no idea where those files are.

So my questions is: if my iPhone and iPad stacks can't be added as substacks to my Launcher (since they contain data grids), and my physical devices can't find them as independent stacks (since they live on my Mac and apparently aren't being copied), do I need to specify these stacks as files to be copied over in the "Copy Files" pane? The "Copy Files" pane specifically says that it is for copying non-stack files, so I'm not sure this will even work. :P

Thanks to all for any advice!
--John
Lodestone Animation, Inc.
Macaroni Art for iOS

Post Reply