Titanium Community Questions & Answer Archive

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

app.js in desktop app?

I have written an app for the ipad. Is there a way to use the app.js instead of index.html in a desktop application?

— asked June 1st 2010 by John Hass
  • app.js
  • desktop
  • ipad
0 Comments

2 Answers

  • At current, Titanium Desktop requires an HTML file—there's no way to run an app with no windows. As a workaround, you can make your initial window invisible in tiapp.xml:

    <ti:app xmlns:ti='http://ti.appcelerator.org'>
        ...
        <window>
            <id>initial</id>
            <visible>false</visible>
            ...
        </window>
    </ti:app>
    

    Include your app.js in that window, and you've got yourself a pretty similar setup. Just be careful to make sure you call Titanium.App.exit() to close the application when all visible windows are closed on Windows and Linux (you may or may not want to do this on OS X since many Mac apps are designed to stay open even with no visible windows).

    — answered June 2nd 2010 by Rob Brackett
    permalink
    1 Comment
    • So I tried adding &lt;visible&gt;false&lt;&#x2F;visible&gt; to my tiapp.xml. That made it so no window opens. I then added &lt;script src=&quot;app.js&quot;&gt;&lt;&#x2F;script&gt; to my index.html, but still no window. Is this what you meant by your post or am I missing something?

      — commented June 2nd 2010 by John Hass
  • Although it is possible, as stated by Rob, please keep in mind, if you have any iPad specific API calls or interface objects that are not included with the Desktop API, you are going to have some problems.

    — answered August 7th 2010 by Jonathan Bardi
    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.