Page 1 of 1

Submitting for Both iPhone and iPad

Posted: Thu Jul 07, 2011 12:59 am
by Brittgriscom
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.

Re: Submitting for Both iPhone and iPad

Posted: Thu Jul 07, 2011 1:43 am
by Jellicle
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

Re: Submitting for Both iPhone and iPad

Posted: Tue Jul 12, 2011 12:08 am
by Brittgriscom
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.

Re: Submitting for Both iPhone and iPad

Posted: Wed Jul 13, 2011 2:43 am
by scotttyang
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?

Re: Submitting for Both iPhone and iPad

Posted: Wed Jul 13, 2011 2:45 pm
by Klaus
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

Re: Submitting for Both iPhone and iPad

Posted: Fri Jul 15, 2011 12:37 am
by andyh1234
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

Re: Submitting for Both iPhone and iPad

Posted: Fri Jul 15, 2011 5:24 am
by Brittgriscom
Great. Thanks.

Re: Submitting for Both iPhone and iPad

Posted: Wed Sep 12, 2012 8:32 pm
by jlally
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

Re: Submitting for Both iPhone and iPad

Posted: Wed Sep 12, 2012 9:42 pm
by Klaus
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

Re: Submitting for Both iPhone and iPad

Posted: Thu Sep 13, 2012 12:05 am
by jlally
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.)

Re: Submitting for Both iPhone and iPad

Posted: Thu Sep 13, 2012 4:47 am
by jacque
Do either of your substacks have their own substacks? You can't do that.

Re: Submitting for Both iPhone and iPad

Posted: Thu Sep 13, 2012 6:03 am
by jlally
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

Re: Submitting for Both iPhone and iPad

Posted: Thu Sep 13, 2012 6:42 pm
by jacque
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.

Re: Submitting for Both iPhone and iPad

Posted: Thu Sep 13, 2012 9:18 pm
by jlally
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