{"id":597,"date":"2016-07-15T05:32:58","date_gmt":"2016-07-15T05:32:58","guid":{"rendered":"https:\/\/admin.qltech.com.au\/?post_type=knowledgehub&#038;p=597"},"modified":"2019-11-07T11:58:00","modified_gmt":"2019-11-07T11:58:00","slug":"9-common-mistakes-ionic-developers-make","status":"publish","type":"post","link":"https:\/\/steamlinedesign.com\/qltech\/new\/2016\/07\/15\/9-common-mistakes-ionic-developers-make\/","title":{"rendered":"The 9 Most Common Mistakes That Ionic Developers Make"},"content":{"rendered":"\n<p>Are you an&nbsp;<a href=\"https:\/\/ionicframework.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">ionic developer<\/a>? Are you facing setbacks despite apparently doing everything right? Do you want to learn from the mistakes made by your peers? Or do you, as a computer geek, wish to gobble up anything and everything on the subject? If you fall in any of the above categories, then you should be aware of the mobile app framework, Ionic. For the rest of us, the lesser mortals, we will first understand what Ionic is and then we will look into the 9 most common errors than Ionic developers make.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"636\" height=\"231\" src=\"https:\/\/admin.qltech.com.au\/wp-content\/uploads\/2016\/07\/Ionic-Developers-2-2.png\" alt=\"\" class=\"wp-image-2730\" srcset=\"https:\/\/steamlinedesign.com\/qltech\/new\/wp-content\/uploads\/2016\/07\/Ionic-Developers-2-2.png 636w, https:\/\/steamlinedesign.com\/qltech\/new\/wp-content\/uploads\/2016\/07\/Ionic-Developers-2-2-300x109.png 300w\" sizes=\"auto, (max-width: 636px) 100vw, 636px\" \/><\/figure><\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>So, what is Ionic?<\/strong><\/h2>\n\n\n\n<p>Ionic is an open-source source-development-kit used for&nbsp;developing mobile apps. It was released in 2013 and has become a global platform in just 3 years. It is extremely popular and has been instrumental in the development of more than a million apps. There have been significantly updated releases after the initial launch and web technology has since then evolved significantly.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Why this list?<\/strong><\/h3>\n\n\n\n<p>This list is to place emphasis on the common mistakes which act as ready reckoners for developers which one can refer to and avoid the fundamental problems that hinder the building of a robust and scalable framework.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Common Mistake#1: Forgetting to enable Native scrolling<\/strong><\/h3>\n\n\n\n<p>Native scrolling enabled the use of infinite rolling and pull to refresh features without JavaScript scrolling. It also allows the framework to listen to scrolling events on supported web-views. It made a remarkable difference in the performance and user experience of the application.<\/p>\n\n\n\n<p>Native Scrolling is enabled by default on Android since Ionic 1.2. Unfortunately, in the absence of events on iOS the \u201cnative scrolling\u201d is not functional for the previous versions of the platform yet.<\/p>\n\n\n\n<p>If you are using a version prior to 1.2, do not forget to enable Native Scrolling for Android using&nbsp;the Ionic Config Provider:<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>&lt;pre&gt;&lt;code class=&#8221;language-js hljs&#8221;&gt;&lt;span class=&#8221;hljs-comment&#8221;&gt;\/\/ Enable Native Scrolling on Android&lt;\/span&gt;<br>$ionicConfigProvider. platform.android.scrolling .jsScrolling(&lt;span class=&#8221;hljs-literal&#8221;&gt;false&lt;\/span&gt;);&lt;\/code&gt;&lt;\/pre&gt;<\/p><\/blockquote>\n\n\n\n<p>If you wish to enable\/disable native scrolling on one particular page, just use the following directive<\/p>\n\n\n\n<p>in ion-content:<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>&lt;pre&gt;&lt;code class=&#8221;language-html hljs&#8221;&gt;&lt;span class=&#8221;hljs-comment&#8221;&gt;&lt;!\u2013 Disable Native Scrolling on this page only \u2013&gt;&lt;\/span&gt;<br>&lt;span class=&#8221;hljs-tag&#8221;&gt;&lt;&lt;span class=&#8221;hljs-title&#8221;&gt;ion-content&lt;\/span&gt; &lt;span class=&#8221;hljs-attribute&#8221;&gt;overflow-scroll&lt;\/span&gt;=&lt;span class=&#8221;hljs-value&#8221;&gt;\u201dfalse\u201d&lt;\/span&gt;&gt;&lt;\/span&gt;&lt;\/code&gt;&lt;\/pre&gt;<\/p><\/blockquote>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Common Mistake #2: Missing out on the Ionic CLI<\/strong><\/h4>\n\n\n\n<p>Iconic CLI has great features like, platform and plugin preference, which it adds to Cordova CLI.&nbsp; The problem with Cordova CLI is that the features are machine specific and while sharing the same environment, platforms, and plugins, it is difficult to keep the project in sync between the systems. Iconic CLI helps to resolve these issues by helping the machines to remain synchronised.<\/p>\n\n\n\n<p>Platforms and plugins are stored in Cordova platforms and&nbsp;<a rel=\"noreferrer noopener\" href=\"https:\/\/cordova.apache.org\/plugins\/\" target=\"_blank\">cordova Plugins<\/a>&nbsp;properties like this:<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>&lt;pre&gt;&lt;code class=&#8221;language-json hljs&#8221;&gt;&lt;span class=&#8221;hljs-string&#8221;&gt;&#8221;cordovaPlugins&#8221;&lt;\/span&gt;: [<br>&lt;span class=&#8221;hljs-string&#8221;&gt;&#8221;cordova-plugin-whitelist@1.0.0&#8243;&lt;\/span&gt;,<br>&lt;span class=&#8221;hljs-string&#8221;&gt;&#8221;cordova-plugin-inappbrowser@1.0.1&#8243;&lt;\/span&gt;,<br>&lt;span class=&#8221;hljs-string&#8221;&gt;&#8221;cordova-plugin-splashscreen@2.1.0&#8243;&lt;\/span&gt;<br>],<br>&lt;span class=&#8221;hljs-string&#8221;&gt;&#8221;cordovaPlatforms&#8221;&lt;\/span&gt;: [<br>&lt;span class=&#8221;hljs-string&#8221;&gt;&#8221;android&#8221;&lt;\/span&gt;,<br>&lt;span class=&#8221;hljs-string&#8221;&gt;&#8221;ios&#8221;&lt;\/span&gt;<br>]<br>&lt;\/code&gt;<\/p><\/blockquote>\n\n\n\n<p><strong>Common Mistake #3: Thinking Performance can be an issue<\/strong><\/p>\n\n\n\n<p>Ionic is based on&nbsp;<a href=\"https:\/\/angularjs.org\/\" target=\"_blank\" rel=\"noreferrer noopener\">AngularJS<\/a>, and performance is always a doubt. However, we think that is a myth and very good performance can be achieved through Ionic.<\/p>\n\n\n\n<p>Several successful Apps have been developed through Ionic, some of which has a 9M+ user base, 7M+ downloads and an average of 4.5 stars on Google Play.<\/p>\n\n\n\n<p>One can use $Watch and Track By to get better performance.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Common Mistake #4: Confusions with \u2018View Cache\u2019 logic<\/strong><\/h4>\n\n\n\n<p>Does your app create cache? It is a very difficult question to answer for the novice developers. With Ionic, 10 pages are cached by default. This helpful feature can be of trouble to us if we are unable to understand the dynamic of cache pages.<\/p>\n\n\n\n<p>The problem is that when the user returns to a cached page, the controller is not re-instantiated again, and everything is like the same as when you left that page. You can update the cache by using these particular lines of code, which can be both for global as well as per platform basis:<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>&lt;pre&gt;&lt;code&gt;\/\/ Globally<br>$ionicConfigProvider. views.maxCache(5);<\/p><\/blockquote>\n\n\n\n<p>\/\/ Per platforms<br>$ionicConfigProvider. platform.android.views. maxCache(5);<br>$ionicConfigProvider. platform.ios.views. maxCache(5);&lt;\/code&gt;&lt;\/pre&gt;<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Common Mistake #5: Not knowing the capabilities of Crosswalk<\/strong><\/h4>\n\n\n\n<p>Every Android version runs a different WebView. The performance of the OS varies from one device to another. In order to resolve the issue and deliver a similar performance on any of these versions, you can install Crosswalk. It works to create a sync between the working of your application and the latest Chromium browser. The crosswalk can be installed simply using Ionic CLI or Cordova CLI.<\/p>\n\n\n\n<p>You can install Crosswalk simply using Ionic CLI or Cordova CLI:<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>&lt;pre&gt;&lt;code class=&#8221;language-bash hljs&#8221;&gt;ionic plugin add cordova-plugin-crosswalk-webview&lt;\/code&gt;&lt;\/pre&gt;<br><\/p><\/blockquote>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Common Mistake #6: Running Cordova plugins inside the browser<\/strong><\/h4>\n\n\n\n<p>Most of the developers out there create Apps to run on iOS or Android. However, they make the elementary mistake of testing the same on the web browser. Well, you could, but only after you install the proper browser platform. It is not compatible with all plugins. One can debug very easily in Android remotely.<\/p>\n\n\n\n<p><strong>Common Mistake #7: Mismatching the Architecture and Application scale<\/strong><\/p>\n\n\n\n<p>Most people make the critical mistake of using a basic architecture in developing advanced applications. People face scalability issues which are not easily modifiable.<\/p>\n\n\n\n<p><strong>Common Mistake #8: Binding Events t<\/strong>on<em> sc<\/em><strong><em>roll<\/em>, and Forgetting About&nbsp;<em>requestAnimationFrame<\/em><\/strong><\/p>\n\n\n\n<p>One should be very careful while selecting or writing codes, the codes usually make or break an App. One should take care that anything that triggers a digest loop should be deferred and not triggered together with heavy painting, which also is the effect of scrolling.<\/p>\n\n\n\n<p>Many things that can be achieved by binding to scroll events, can also be developed using a different method. Behold&nbsp;requestAnimationFrame<\/p>\n\n\n\n<p><strong>Common Mistake #9: Using Ionic Applications frameworks mechanically<\/strong><\/p>\n\n\n\n<p>There are several options available to developers like, Ionic Creator, which has a very helpful drag and drop feature, which can help reduce development time greatly. We should be using them rather than doing everything manually.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Conclusion<\/h3>\n\n\n\n<p>Ionic has changed the way\u00a0<a href=\"https:\/\/www.qltech.com.au\/services\/android-apps\/\"><strong>mobile app development<\/strong><\/a>\u00a0was done. It has brought about revolutionary changes and is still evolving. While adapting to different platforms will always be a challenge, the ability to function across environments is slowly becoming a prerequisite. However, this journey can be much less daunting if one accesses the plethora of resources available online. We hope that this post has removed some of the obstacles you are facing while working on Ionic.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Are you an&nbsp;ionic developer? Are you facing setbacks despite apparently doing everything right? Do you want to learn from the mistakes made by your peers? Or do you, as a computer geek, wish to gobble up anything and everything on the subject? If you fall in any of the above categories, then you should be [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"lbn_published_stage":false,"lbn_published_production":false,"footnotes":""},"categories":[1935],"tags":[1750,1748,1749],"yst_prominent_words":[144,140,132,141,126,134,136,129,133,137,131,127,143,145,128,138,142,135,139,130],"class_list":["post-597","post","type-post","status-publish","format-standard","hentry","category-mobile-apps","tag-ionic-common-mistakes","tag-ionic-developer","tag-open-source-development"],"yoast":{"focuskw":"Ionic","title":"The 9 Most Common Mistakes That Ionic Developers Make","metadesc":"A reference for the common mistakes that an Ionic developer usually makes. Read on to know how to avoid these!","linkdex":"70","metakeywords":"","meta-robots-noindex":"","meta-robots-nofollow":"","meta-robots-adv":"","canonical":"","redirect":"","opengraph-title":"","opengraph-description":"","opengraph-image":"","twitter-title":"","twitter-description":"","twitter-image":""},"acf":{"img":false,"long_descrpition":"","written_by":"","feature_image":"https:\/\/steamlinedesign.com\/qltech\/new\/wp-content\/uploads\/2016\/07\/ionic-framework-developer-2.jpg","posted_by":"QL Tech","is_featured":"0:Non Featured","knowledge_hub_featured_image":false,"short_description":"","icon":false,"service_slider":false},"_links":{"self":[{"href":"https:\/\/steamlinedesign.com\/qltech\/new\/wp-json\/wp\/v2\/posts\/597","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/steamlinedesign.com\/qltech\/new\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/steamlinedesign.com\/qltech\/new\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/steamlinedesign.com\/qltech\/new\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/steamlinedesign.com\/qltech\/new\/wp-json\/wp\/v2\/comments?post=597"}],"version-history":[{"count":6,"href":"https:\/\/steamlinedesign.com\/qltech\/new\/wp-json\/wp\/v2\/posts\/597\/revisions"}],"predecessor-version":[{"id":2731,"href":"https:\/\/steamlinedesign.com\/qltech\/new\/wp-json\/wp\/v2\/posts\/597\/revisions\/2731"}],"wp:attachment":[{"href":"https:\/\/steamlinedesign.com\/qltech\/new\/wp-json\/wp\/v2\/media?parent=597"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/steamlinedesign.com\/qltech\/new\/wp-json\/wp\/v2\/categories?post=597"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/steamlinedesign.com\/qltech\/new\/wp-json\/wp\/v2\/tags?post=597"},{"taxonomy":"yst_prominent_words","embeddable":true,"href":"https:\/\/steamlinedesign.com\/qltech\/new\/wp-json\/wp\/v2\/yst_prominent_words?post=597"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}