Mobile Web Limitations
Titanium Mobile Web apps run within the browser environment on the user's handset or tablet. Because of this, your Mobile Web apps are unavoidably limited by the environments provided by those browsers. The following limitations are a mix of Titanium limitations and a larger collection of general limitations for any web app.
Overall
-
You cannot use as variable names any words that exist in the JavaScript environment of the browser. So words like window, document, navigator, debugger, class, and so forth. In other words, you can't use any name that exists in the HTML DOM or JavaScript language as variable names. See for example http://developer.mozilla.org/en/JavaScript/Reserved_Words
Files and Local Storage
-
Many browsers limit the amount of data (usually around 5MB) we can store in the browser's local storage. This limits the data, file storage, and database storage that can be used by your app. These are some of the components that consume that local storage:
-
Analytics system - Stores the machine id (mid)
-
Loader system - Caches modules and static resources (caching such resources is optional, though)
-
Ti.App.Properties - Stores all properties, including those from the tiapp.xml
-
Ti.Filesystem - Any file storage your app might perform
-
Ti.UI.Clipboard - Temporary storage of data placed on the clipboard
-
-
Ti.Filesystem can see all files in the Resources (web root) folder on the web server except index.html and titanium/filesystem.registry.
-
If Ti.Filesystem.getFile() is called with a relative path (i.e. "myimage.jpg"), the Resource directory path is automatically prepended to the path.
-
Files with a mime type application/* image/*, audio/*, or video/* are automatically handled as "binary" where the data internally is stored Base64 encoded.
Loader
-
Module IDs must NOT begin with a forward slash (so require('foo') not require('/foo')). Paths are relative to the app's Resources directory.
-
Modules including Titanium APIs cannot be named "require", "exports", or "module"
-
Titanium APIs must NOT contain properties named "constructor", "properties", "constants", or "declaredClass"
-
You cannot call Ti.include() with a relative path from an async/callback function
Media, Blobs, and Codec
-
With a Ti.Blob containing an image, the width and height are zero until the image is loaded which happens after a reflow. Either wait for a reflow or set a timeout with a callback before using the width and height.
-
With Ti.Codec, all buffers are treated as little endian. Furthermore, the "position" argument for encodeNumber() and decodeNumber() is unsupported
-
Video and audio codec support varies by browser
Geolocation
-
Using Ti.Geolocation requires a browser that implements the Geolocation API.
-
Ti.Geolocation requires the end-user to allow browser to locate the user.
Ti.Gesture
-
Requires a device with an accelerometer plus a browser that implements an API for access to sensor data.
-
Requires a device with a gyroscope plus a browser that implements an API for access to sensor data.
Networking
-
Uses the navigator.online flag to detect state of connectivity.
-
Determining the network type is supported only on Android.
-
You can access cross-domain resources by either:
-
Enabling CORS header support on the remote web server
-
Configuring a proxy and defining a custom Ti.Network.httpURLFormatter.
-
Ti.Platform
-
Several read-only properties are unavailable:
-
address
-
architecture
-
availableMemory
-
macaddress
-
model
-
netmask
-
processorCount
-
username
-
Ti.UI
-
Radial background gradients do not support an end point.
Ti.UI.EmailDialog
-
Some browsers limit the maximum size of a mailto: URL to 2000 characters which includes all email addresses, subject, and body
-
In our testing, this works fine with the Android web browser and iPhone's Safari on iPhone/iPad. It also works fine on desktop Firefox, Chrome, and Safari.
-
-
Some e-mail clients do not properly unescape HTML entities:
-
True for Outlook, Mozilla Thunderbird, and Android mail app.
-
iPhone and iPad work as expected.
-
We recommend either leave "html" parameter false or only true for iPhone/iPad.
-
-
There is no way to detect failure or cancelling of sending an email.
Ti.UI.WebView
-
The following do NOT work for cross-domain URLs:
-
evalJS()
-
goBack()
-
goForward()
-
Ti.API.* and Ti.App.* bridge
-
"beforeload" event
-
-
There is no way to detect if a page fails to load in the WebView, so the "error" event is never fired.
-
The stopLoading() function generally does not work:
-
In some browsers, it will stop all WebViews from loading, which shouldn't be a huge deal.
-
Use stopLoading(true) to do a hard reset to force the WebView to be destroyed.
-
-
Touch events are generally ignored.
-
You will never be able to load a cross-domain resource that returns the HTTP header X-Frame-Options with the value SAMEORIGIN.
-
When setting the contents of the WebView via the html or data properties, the onload event will never fire since the WebView is loaded prior to injecting the new content.