Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

iPhone and iPad in one app?

Hi!
With Apple's native tools it's possible to build apps that run on both the iPhone and the iPad, with one app.
While it currently is possible to build either an iPhone or an iPad app with Titanium, AFAIK it currently isn't possible to build one app that runs on both platforms.
2 questions:
1: Maybe I'm missing something, and this currently is actually possible? If, so, how?
2: Is this planned for a later version? When?

— asked May 13th 2010 by Martijn Pannevis
  • apple
  • ipad
  • iphone
  • mobile
  • sdk
0 Comments

7 Answers

  • Hey panman, good to see more Dutchies around here :)

    You could, in essence, cross-copy the code from one app to the other, but you would still have to compile each and submit both separately to the AppStore which is not what you desire I would assume.

    Another option is to simply build an iPhone app and have it run on the iPad as well by means of pixel-doubling. This would, however, result in funny looking apps that are not heavily graphics based but consist mostly of input fields and other text controls.

    As a thought, you could potentially use Titanium.Platform.DisplayCaps to figure out if you are running on the iPhone or the iPad and load different graphics based on that, possibly even alter all the other parts like input field heights and fontsizes…

    — answered May 13th 2010 by Kerim Satirli
    permalink
    0 Comments
  • You could have one code base by detecting the size of the screen and have different UI elements (graphics images, etc.) to use depending on the screen size but….. that means your single on app will have extra stuff to pack, making it bigger in size.

    — answered May 14th 2010 by Peter Lum
    permalink
    0 Comments
  • Kerim: I would prefer to not have 2 projects (and 2 apps in the store), but using one app wich detects resolution, as Peter descibes. However, I don't know how to config titanium to do that.

    — answered May 15th 2010 by Martijn Pannevis
    permalink
    0 Comments
  • Martijn,

    looks like the Appcelerator team is working on getting Universal support in there:

    Quoting Kevin Whinnery from over here:

    It's on our to do list, but no, we don't currently have universal binary support.

    — answered May 19th 2010 by Kerim Satirli
    permalink
    0 Comments
  • But which SDK would I choose, and which platform? Currently, I have to choose iPad or Mobile, and for iPad 3.2.

    — answered May 14th 2010 by Martijn Pannevis
    permalink
    0 Comments
  • Martijn,

    I think you'd still have to set up two projects and just cross-copy the code from one repository to the other every time before yo compile.

    — answered May 14th 2010 by Kerim Satirli
    permalink
    0 Comments
  • Has anyone actually achieved this using Kerim's or Peter's recommendation?

    — answered December 22nd 2011 by Dario Marcelino
    permalink
    1 Comment
    • Nevermind, I can see Universal Binaries support was introduced in 1.7.

      — commented December 22nd 2011 by Dario Marcelino
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.