Meta

Subscribe

Choosing the best cross platform mobile framework is the first task before any one starts developing cross platform mobile applications. More or less it all depends on your target platforms, the type of application and your trade off capacity, so we could say that the selection of some cross platform framework is a game of best match to your requirements, though each of the available frameworks provide some unique features as well.

I have looked at Titanuim, Rhodes , PhoneGap & MoSync, and opted to use “Appcelerator Titanium” as my cross platform mobile development framework, and listed the reasons below why I have done so.

It maps the Javascript to native code, which means your application has the real native UI instead of a web page which is presented in a native makeup (as in PhoneGap or Rhodes). This ensures much better user experience.

No added effort is required to make your application more native looking (which is required in case of PhoneGap & Rhodes some how).

It invokes the actual native code, so its faster than other web page based UIs.

As the native APIs have WebView component available, so we can still code some application parts in html if needed.

It can be extended to add any native feature, as it allows custom plug-ins using native code per platform (Java/Android, Objective C/iPhone).

It has very large library of APIs for all kinds of activities and data access, and it supports Ruby, Python, and PHP scripts for broad developer coverage.

Good example documentation and video tutorials for quick start development.

It has an IDE which allows you to create and run projects (you don’t need to open a terminal).

You can stay away from learning Java, Objective-C, C++ and other SDK specific languages.

HTML5s offline application cache can store your HTML, CSS, and JavaScript on the device. After the first load (effectively an install), it’ll launch without an Internet connection, just like a native app.

If local storage isn’t enough, there’s a full-fledged SQLite database built into WebKit.

As the mobile application development is continue to expand, its becoming a challenging job to publish your apps. for all major mobile platforms. At this point you have to choose some mobile platforms and to leave some of them from your plans. In this situation cross platform mobile apps. development frameworks could help you, the idea is to write once and run anywhere without learning five or six major SDKs. Though they are not the perfect answer to all of your needs, but still they are pretty good to manage a big share of your requirements.

Here are four mostly used cross-platform development frameworks which are used to deliver “write once and run anywhere” experience to the developers.

PhoneGap
PhoneGap is an HTML5 app platform that allows you to author native applications with web technologies and get access to APIs and app stores.

Writing an application is an easy task but its performance tuning and the optimization is a bit tricky job. To make it bit more simple I have listed few concrete options below:

Do not take every thing as granted.

Use buffering where possible specially in i/o operations.

Use batches for bulk db operations.

Avoid object creation in loops if possible.

Synchronization should be minimized where possible.

Put only non-avoidable data inside sessions, and remove them right after their usage.

Choose the best fit XML parser, like if you have no need to load full document then DOM based parsers could be avoided.

Remove unnecessary layers of your application, here you need good architectural skills to decide what should be removed.

Remove unnecessary libraries and relevant code could be copied to your app if its really small. This could be helpful in avoiding PermGen errors.

Make smart selection of collections. Like hashing based collections are the best candidate for implementing caching.

Use of caches could improve the response time.

Use standard implementation of caching instead of implementing your own, but of course it depends on your requirement. Like ORM mapping tools accompany standard caching options.

Use of appropriate design patterns could also optimize your code, like java.io uses decorator pattern to provide added functionality (like buffering etc.) on demand basis, instead of making every thing available either needed or not.

Fetch what is required, instead of loading every thing relevant or irrelevant.

Move db intensive operations into the database stored procedure, but it has a portability concerns which needs to be prioritize.

Make use of paging when you are working with large data sets, this could also improve the response time.

Joins using correct indexes could speed up performance.

Set appropriate size of heap memory, like using a default heap memory size is non-sense for the application having hundreds of hibernate mapping files and lot of xml parsing functionality etc.

Choose right application server based on your application requirements, if you can live with Tomcat then why WAS.

Carefully set the size of connection pool, based on your application usage.

Table Indexes should be added.

De normalization could also be an option, but this needs to be decided carefully.

This is not you who is always wrong, check your third party libraries if they are causing performance/memory issues, normally such issues are fixed in the new versions.