Search code examples
javascriptandroidiostitaniumtitanium-mobile

Can Titanium code runs in browsers?


I understand that not all the code and functionality are available. However, I am currently in the planing of a new project and there are no document to be found on this aspect.

I want to know once I code in Titanium, is it possible to make a web version for mobile without the application with limited feature and the same code base? (something like touch.facebook.com vs Facebook app)

Thank you very much


Solution

  • Of course, Titanium could do that since it also supports MobileWeb. Titanium features:

    Develop native applications for iOS, Android, BlackBerry, Windows, and mobile web through a single code base.

    With their Titanium Studio, you can easily build and package your app for MobileWeb.

    enter image description here

    But there are a lot of things to consider on developing titanium apps. Here are the few things I've learned along the way:

    • Don't use ImageView. Use View with backgroundImage. If it's an icon, you can make a font for your app. See how to create an icon font using IcoMoon.
    • Memory management
    • Never use borderRadius, borderWidth, borderColor in components within components, as for example a ScrollableView.
    • Minimize calling Ti.Platform.[property_name]. Example: instead of always calling Ti.Platform.osname to your controllers, you could have put it on you commonjs var osname = Ti.Platform.osname, then exports.getPlatformName = function() { return osname; };

    Here are some few references: