Titanium Community Questions & Answer Archive

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

iPad app approved, and on app store!

Yayy!

Swarm SG was approved and is now available on the app store.

  • Web: http://SwarmSG.com
  • Itunes: http://bit.ly/d2b18u

After uploading it, it took 6 days to move from "Waiting For Review" status into "In Review" status.

Once it switched to "In Review" it was approved and live within 24 hours.

Not sure why it was approved 1st time round but I did pay special attention to things like making sure the app opened in the same state it was closed in, along with trying to keep a fairly sensible UI.

The app is almost 100% HTML/JavaScript and uses one webview.

This is what the app.js looks like

var webView = Titanium.UI.createWebView({url:'index.html', 
backgroundColor : '#000000', height : 1024.0, width: 768.0});
var appWin = Titanium.UI.createWindow({fullscreen: true , 
backgroundColor : '#000000', height : 1024.0, width: 768.0});
appWin.orientationModes = [
    Titanium.UI.PORTRAIT
];

appWin.add(webView);

setTimeout(function()
{
    appWin.open();
},2000);

/*
* LIBS & EVENTS
* Titanium.API.info('Trace Something');
*/

Ti.App.addEventListener('saveAppState', function(appState) 
{
    Titanium.App.Properties.setString("appState",JSON.stringify(appState));
});

Ti.App.addEventListener('loadAppState', function() 
{
    var appState = Titanium.App.Properties.getString("appState");
    if ( appState != null )
    {
        webView.evalJS("var savedState = JSON.parse('"+appState+"');");
    }
});

function trace(str)
{
    webView.evalJS("trace('"+str+"')");
}

I've used Titanium to save the app state by passing a global vars javascript object by firing an event from .js inside the webview


The other trick to making an HTML app work fast has been NOT to use native html/javascript binding and links. Instead by using apples addEventListener it work wayyyy faster to do things like button clicks etc.

this.addEventListener('touchstart', function(e) { ..etc.. }, false);}

The setTimeout 2000 is in there so that the splash screen displays for a little longer.

— asked June 18th 2010 by Justin Vincent
  • ipad
  • swarm
0 Comments

7 Answers

  • Great news … and thank you for posting the lessons learned and app.js.

    I've been playing with Appcelerator for a month here and there and seeing your final product is amazing (almost inspirational to get me off goofing around and writing something).

    Thanks!

    — answered June 18th 2010 by Vikram Pant
    permalink
    1 Comment
    • Awesome! That is exactly the kind of thing I was hoping for! Let me know when you get that app out the door :)

      — commented June 18th 2010 by Justin Vincent
  • Congrats :)
    And thanks for sharing your tricks.

    — answered June 18th 2010 by Dan Tamas
    permalink
    0 Comments
  • Awesome! Going to go tweet it now. Would you be willing to e-mail some contact info to kwhinnery at appcelerator dot com? Would love to get some background on you and the app, possibly do a feature on the blog…

    — answered June 18th 2010 by Kevin Whinnery
    permalink
    0 Comments
  • fantastic!

    — answered June 18th 2010 by Peter Lum
    permalink
    0 Comments
  • Sold 9 copies of Swarm in the App store on the first day. $31.50 no' bad

    — answered June 19th 2010 by Justin Vincent
    permalink
    0 Comments
  • Excellent news, hope it does really well for you :D

    — answered June 20th 2010 by James Becker
    permalink
    0 Comments
  • Man wow, I'm thoroughly impressed with that game! Very very cool, I can't wait to grab it and play it with my brother in between bouts of hair pulling and fun appcelerator development haha!

    — answered July 28th 2010 by Ken Hanson
    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.