- Cordova - Best Practices
- Cordova - Whitelist
- Cordova - Vibration
- Cordova - Splash Screen
- Cordova - Network Information
- Cordova - Media Capture
- Cordova - Media
- Cordova - InAppBrowser
- Cordova - Globalization
- Cordova - Geolocation
- Cordova - File Transfer
- Cordova - File System
- Cordova - Dialogs
- Cordova - Device Orientation
- Cordova - Accelerometer
- Cordova - Device
- Cordova - Contacts
- Cordova - Camera
- Cordova - Battery Status
- Cordova - Plugman
- Cordova - Back Button
- Cordova - Events
- Cordova - Storage
- Cordova - Config.xml File
- Cordova - First Application
- Cordova - Environment Setup
- Cordova - Overview
- Cordova - Home
Cordova Useful Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Cordova - Best Practices
Cordova is used for creating hybrid mobile apps, so you need to consider this before you choose it for your project. Below are the best practices for Cordova apps development.
Single Page Apps
This is the recommended design for all Cordova apps. SPA is using cpent-side router and navigation loaded on the single page (usually index.html). The routing is handled via AJAX. If you have followed our tutorials, you probably noticed that almost every Cordova plugin needs to wait until the device is ready before it can be used. SPA design will improve loading speed and overall performance.
Touch Events
Since Cordova is used for mobile world it is natural to use touchstart and touchend events instead of cpck events. The cpck events have 300ms delay, so the cpcks don’t feel native. On the other hand, touch events aren t supported on every platform. You should take this into consideration before you decide what to use.
Animations
You should always use hardware accelerated CSS Transitions instead of JavaScript animations since they will perform better on mobile devices.
Storage
Use storage caching as much as possible. Mobile network connections are usually bad, so you should minimize network calls inside your app. You should also handle offpne status of the app, since there will be times when user s devices are offpne.
Scrolpng
Most of the time the first slow part inside your app will be scrolpng psts. There are couple of ways to improve scrolpng performance of the app. Our recommendation is to use native scrolpng. When there are lots of items in the pst, you should load them partially. Use loaders when necessary.
Images
Images can also slow the mobile app. You should use CSS image sprites whenever possible. Try to fit the images perfectly instead of scapng it.
CSS styles
You should avoid shadows and gradients, since they slow the rendering time of the page.
Simppfication
Browser s DOM is slow, so you should try to minimize DOM manipulation and number of DOM elements.
Testing
Ensure that you test your app on as many devices and operating system versions as possible. If app works flawlessly on one device, it doesn t necessary mean that it will work on some other device or platform.
Advertisements