Titanium Community Questions & Answer Archive

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

High Level Appcelerator Question

I'm trying to figure out if I'm properly understanding how Appcelerator works. Using the appcelerator API if I develop an application on Windows for Android what will I need to do to make it work on iPhone? Just move the source to a MAC and recompile?

— asked November 23rd 2010 by Frank A
  • android
  • iphone
  • windows
0 Comments

4 Answers

  • Accepted Answer

    As Chris said, you'll need a mac. So you're right, you'll need to move/copy your code to the mac and recompile. Ultimately, though, the process is fairly complex.

    I've found lots of little differences in the way my app runs on android & iOS. For example, omitting height/width values for a view on android implies an '100%' value so the view will fill the screen. On iPhone, the missing values are interpreted as '0' values, so the view is invisible.

    You'll need to deal with device & UI convention differences. For example, iPhones don't have a back button. So, your UI needs to include one–and to get approved by Apple, your app is going to need to follow Apple's UI guidelines for navigation bars, button placements, etc. On Android, you'll have to add event listeners for the back button so that your app closes, or doesn't close, as you intend when users tap that button.

    There are the operational differences caused by Apple's tight control over distribution. You can just plug in your android phone and install your app. You can even email someone the apk file to have them test your app. You'll need to register (and pay) with Apple to get a developer certificate. Then, you'll need to register each iPhone with them in order to test your app on a real device. IMO, the Apple process is unnecessarily cumbersome. But, you have no choice but to deal with it.

    My first app has been out for over a month for android. I'm still struggling to get it to work the same on iOS. I tried for a long time to maintain a single code base with if/then statements. Over time, the code got so complex and slow that I created separate versions.

    I've learned a lot. In fact, I should probably just scrap my entire code and start over. My second app will be cleaner, code-wise. YMMV

    — answered November 24th 2010 by Tim Poulsen
    permalink
    0 Comments
  • Hi Frank,

    In order to build your app for iP|hone you'll need the iPhone SDK. This only exists for OSX (Mac).

    The code you write sits in a 'resources' directory.

    When Titanium Developer installs it checks for the presence of the Android and iPhone SDKs. So to port to iPhone you'd need a Mac OS (a VM 'may' work) with the iPhone SDK installed and create a 'blank' mobile project there in Titanium Developer.

    You can then paste the resources folder across.

    Hope that helps a bit.

    Cheers,
    Chris.

    — answered November 24th 2010 by Chris Reed
    permalink
    1 Comment
    • If you plan on deploying your iOS app you need to follow the Apple ToS and therefore you will need to have an Intel Mac, running Snow Leopard at this point.

      — commented November 24th 2010 by Don Thorp
  • How do you install the iPhone SDK on windows?

    — answered November 24th 2010 by Frank A
    permalink
    0 Comments
  • No, you don't need to move the source to MAC. You can compile for iphone on windows also. However, you would then need to create a new project for iphone, copy all the files there and change the code which will utilise the iphone sdk.

    — answered November 24th 2010 by Gaurav Chandra
    permalink
    0 Comments
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.