MyPage is a personalized page based on your interests.The page is customized to help you to find content that matters you the most.


I'm not curious

10 Tips To Ace Cordova App Development

Published on 05 October 16
1
1
10 Tips To Ace Cordova App Development - Image 1

Nothing can bring more agility, simplicity and precision in the mobile app development discipline than Apache Cordova or PhoneGap, an open-source mobile development framework. Pursuing Cordova app development model has its own merits: (a) It broadens the scope of development as web developers with a sound knowledge of HTML5, CSS3, and JavaScript can also make their presence felt here; (b) Building apps targeting a single operating system or multiple operating systems has become easier; (c) Delivering native experience is no more a challenge as applications execute within the native wrappers on the targeted devices; and (d) Building engaging apps with extended features has also got much easier as a Cordova developer can make their app to communicate with the device’s components including sensors, data, network, etc. effortlessly.


Apparently, everything sounds great for an outsider. But the roadmap of being great is not without pain. Being part of Cordova development, you might have confronted, sometimes, with this harsh reality. This post 10 Tips To Ace Cordova App Development by Root Info Solutions is aimed at alleviating those hassles.


1. Use a task runner on top of Cordova


Cordova development is not just confined to building the app and running its builds; in fact, it’s more than that. A developer has to minify the application’s CSS and JavaScript, switch code between production and development mode, run tests and take care of the miscellaneous maintenance tasks that may arise. Managing simultaneously everything is a difficult task, however, a slip anywhere is not at all acceptable as that would spoil the reputation of the developer or the development comapny.


Hence, to catch with all, it’s highly recommended to use a reliable task runner like Grunt or Gulp. With this in place, you don’t need to build and configure your code before running with the emulator or device.


2. Scaffold Cordova in your build process


A Cordova project directory comprises of a good deal of files and those files also get interchanged between the CLI and platform versions. To make those files work amicably and cohesively, a PhoneGap developer also needs to add or remove or update plugins. Hence, maintaining the Cordova project directory is a tedious job and any non-compliance would result into build errors. Certainly, this is a time killer. At Root Info Solutions, we got a remedy of it by automating the scaffolding process using grunt and grunt-cordovacli by calling Cordova from our Gruntfile. After scaffolding, the configuration and build hooks are copied into the project folder. Streamlining the plugin or file update, meeting deadlines has become easier than ever before.


3. Use hooks to perform any modifications to the generated project files


In the app development process, the best is sometimes obtained through a trial-n-error methodology. File modification is an endless process and it continues till the final build gets delivered. But modifying files at different places, whether to stay up to the expectation of the client or to meet the compliances of a regulator is easier said than done.


Eureka! Here comes a remedy for the pain: Cordova build hooks that run from nodejs and have access to any NPM packages. Resorting to them, a Cordova developer can execute Javascript scripts at any stage of the build process. The hooks attach itself to the config.xml file and have full access to the Cordova CLI API. Thus, augmentation of a build process becomes easier and faster. The build hooks can easily assist with configuring all basics and essential Xcode bells and whistles.


4. Use native remote debugging or weinre


Remote debug the WebView of the build in Chrome or Safari. Interestingly, remote debugging works with Android or iOS akin to any ordinary web page. YOu get access to a whole range of developer tools, both on the emulator and on real devices connected via USB to perform your task.


However, the old WebViews are not supported by the Chrome remote debugging tool. Hence, if your app build targets older versions of Android, use weinre or something similar. Execute the weinre server on your local machine and load a script in your application. The script presents a host of developer tools, however, bestowed with limited capabilities. The debugging is not at par with the JavaScript debugging but still you can inspect inspect the DOM, debug CSS, analyze network activity.


5. Get familiar with the native tools


No doubt, Apache Cordova brings in features and capabilities corresponding to different native platforms at your disposal but it can’t present the right substitute for every native resource or component. Despite being an avid disciple of Cordova app development, you have to acquaint the expertise, including installing the SDK components, connecting to devices, viewing device logs and code-signing for release. Knowledge of third-party plugins, Java and Objective-C skills is also desirable.

6. Test on as many devices as possible, use emulators


An app interacts with the operating system as well as the device. And the better it does, the better becomes the user experience. Hence, make sure that your app build is compatible with both. Hence, before going for the app release, run and test your app across different devices running different versions of the target operating system. This will help you to avoid any minor and major glitches.


7. Use Crosswalk for Android


Think of Crosswalk when you are destined not to serve to a user-base below Android 4.0. Crosswalk exhibits a portable WebVew based on Chrome and helps in bypassing WebView fragmentation. How to get it? Just install the corresponding plugin and the system WebView in your app will get replaced automatically. Crosswalk brings HTML5 support, remote debugging and, most importantly, a consistent and dependable runtime environment across all Android versions. On the higher Android version, Crosswalk helps with resisting unforseen changes introduced by automatically deployed updates to the system WebView. However, it’s likely to increase the build size of the app by 25MB.


8. Be wary of buggy plugins


Core plugins offered with Cordova play a vital role in ascertaining a smooth connectivity between Cordova and the native operating system. They also rope in the device’s capabilities like sensor, network, data, camera, etc., thereby, make the app more purposeful and engaging. Hence, Cordova developers are recommended to use only proven plugins. Strain from using plugins derived from untrusted sources.


9. Don’t be afraid to create your own plugins


If you are at home with Java and Objective-C, don’t be scared of innovating plugins of your own. At Root Info Solutions, we have created many smart plugins that add value to the user-experience. Developed plugins can be injected easily in the app directory by using CLI plugin-add command.


10. Familiarize yourself with the deployment process


Before making an app available to the target audience through App Store or Google Play, it’s a must for a developer to review the the quality as well as the marketing parameters enforced by them. App Store wants its developers to adhere to the iOS Human Interface Guidelines and App Store Review Guidelines. Likewise, Developer Policy Center of Google, lays out the necessary guidelines for those who target the Android. In no way, a developer or company should resort to misleading marketing methods, doing so is an offence. Remember, everything that has been laid down in the book are to make sure that users get the exceptional experience through the app you built.

This blog is listed under Open Source , Development & Implementations and Mobility Community

View Comment (1)
Post a Comment

Please notify me the replies via email.

Important:
  • We hope the conversations that take place on MyTechLogy.com will be constructive and thought-provoking.
  • To ensure the quality of the discussion, our moderators may review/edit the comments for clarity and relevance.
  • Comments that are promotional, mean-spirited, or off-topic may be deleted per the moderators' judgment.
  1. 06 October 16
    0

    Thank you for the Tips. If you have some tutorials on plug-in development, could you please share.

You may also be interested in
 
Awards & Accolades for MyTechLogy
Winner of
REDHERRING
Top 100 Asia
Finalist at SiTF Awards 2014 under the category Best Social & Community Product
Finalist at HR Vendor of the Year 2015 Awards under the category Best Learning Management System
Finalist at HR Vendor of the Year 2015 Awards under the category Best Talent Management Software
Hidden Image Url

Back to Top