Skip to main content

Cordova Issues For Developers




For developers who have an understanding of how to use the Cordova CLI and make use of plugins, there are a few things you may want to consider researching next to build better, more performant Cordova applications.


Best Practices
1) SPA Is Your Friend
First and foremost - your Cordova applications should adopt the SPA (Single Page Application) design. Loosely defined, a SPA is a client-side application that is run from one request of a web page. The user loads an initial set of resources (HTML, CSS, and JavaScript) and further updates (showing a new view, loading data) is done via AJAX. SPAs are commonly used for more complex client-side applications.
Example : GMail is a great example of this.
Examples of SPA libraries you can use in your Cordova applications are:
And many, many, more.

2) Performance Considerations

One of the biggest mistakes a new Cordova developer can make is to assume that the performance they get on a desktop machine is the same they will get on a mobile device. While our mobile devices have gotten more powerful every year, they still lack the power and performance of a desktop. Mobile devices typically have much less RAM and a GPU that is a far cry from their desktop (or even laptop) brethren.


1.Click versus Touch
2.CSS Transitions versus DOM Manipulation
3.Networks Suck


3) Recognize and Handle Offline Status


Not only can you be on a slow network, it is entirely possible for your application to be completely offline.

Handling Upgrades


1)Upgrading Cordova Projects


If your existing project was created using Cordova 3.x, you can upgrade the project by issuing the following:
cordova platform update platform-name ios, android, etc.
2)Plugin Upgrades


cordova plugin rm com.some.plugin
cordova plugin add com.some.plugin

User Interface

Building a Cordova application that looks nice on mobile can be a challenge, especially for developers. Many people chose to use a UI framework to make this easier. Here is a short list of options you may want to consider.
  • jQuery Mobile - jQuery Mobile automatically enhances your layout for mobile optimization. It also handles creating a SPA for you automatically.
  • ionic - This powerful UI framework actually has its own CLI to handle project creation.
  • Ratchet - Brought to you by the people who created Bootstrap.
  • Kendo UI - Open source UI and application framework from Telerik.

Comments

Popular posts from this blog

File Upload & Download With ng-cordova File Transfer Plugin In Ionic Framework

Using the AngularJS extension set , ngCordova , with Ionic Framework and the Apache Cordova File Transfer plugin, you can easily upload files to a remote server and download files from a remote server. 1.Create the project ionic start Test blank cd Test ionic platform add android 2.Add Plugin org.apache.cordova.file-transfer https://github.com/apache/cordova-plugin-file-transfer This plugin allows you to upload and download files. This plugin defines global FileTransfer, FileUploadOptions Constructors. Although in the global scope, they are not available until after the deviceready event . Installation cordova plugin add cordova plugin add cordova-plugin-file-transfer     2.    org.apache.cordova.file             https://github.com/apache/cordova-plugin-file             This plugin implements a Fi...

What exactly means MVW design pattern ?

What is a MVW framework? The abbreviation stands for 'Model - View - Whatever'.  Well there are many different JavaScript frameworks available , all invented for the same purpose. They all try to separate the presentation logic from the business logic where JavaScript holds the model and logic, and html the presentation layer. Quick overview : You can change the model without changing the view and vice-versa Unit testing is easy These are the core benefits of using such a framework. By separating presentation and business logic changes to the code are easier to implement and take less time. Another benefit is that code can be reused from a controller thus saving more time. Angularjs makes the code also shorter in comparison to other frameworks, which improves code stability. Less code means minor potential for bugs. For several years +AngularJS was closer to MVC (or rather one of its client-side variants), but over time and thanks to many refactorings...

WooCommerce REST API with Ionic Framework

Step 1 : Enabling REST API To enable the REST API within WooCommerce, visit the WooCommerce > Settings > API tab and tick the Enable REST API checkbox. Step 2 : Generating API keys The WooCommerce REST API works on a key system to control access. These keys are linked to WordPress users on your website. To create or manage keys for a specific WordPress user, go to WooCommerce > Settings > API > Keys/Apps. To get started, select Add Key. Select the User you would like to generate a key for in the User field and add a Description. Choose the level of access for this API key, which can be Read access, Write access or Read/Write access. Then select the Generate API Key button and WooCommerce will generate API keys for that user. Now that keys have been generated, you should see two new keys, a QRCode, and a Revoke API Key button. These two keys are your Consumer Key and Consumer Secret. Place your consu...