<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Andi Pavllo on Medium]]></title>
        <description><![CDATA[Stories by Andi Pavllo on Medium]]></description>
        <link>https://medium.com/@andi.pavllo?source=rss-e639ea26b32e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*VYO-LIN9CS9MeTbF.</url>
            <title>Stories by Andi Pavllo on Medium</title>
            <link>https://medium.com/@andi.pavllo?source=rss-e639ea26b32e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 12:14:23 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@andi.pavllo/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Choosing the Right Front-End Framework for Your Vue App]]></title>
            <link>https://medium.com/the-web-tub/choosing-the-right-front-end-framework-for-your-vue-app-4448bac12ce7?source=rss-e639ea26b32e------2</link>
            <guid isPermaLink="false">https://medium.com/p/4448bac12ce7</guid>
            <category><![CDATA[quasarframework]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[bootstrap]]></category>
            <category><![CDATA[vuejs]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Andi Pavllo]]></dc:creator>
            <pubDate>Wed, 19 Sep 2018 07:13:06 GMT</pubDate>
            <atom:updated>2018-09-19T07:13:06.402Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*UM71bNf3aXGjbP9BZ2wLWA.png" /></figure><p>Vue.js is one of the most popular JavaScript frameworks and is being adopted by many web and hybrid-mobile developers for their personal and working projects.</p><p>Unfortunately, Vue.js mainly focuses on the application logic and not on its appearance. It is usually a good idea to use it in combination with a front-end UI framework to enrich the user interface.</p><p>In this article, we will analyze some of the most popular front-end frameworks currently available for Vue. We will compare their strengths and weaknesses to help to choose the most appropriate one, depending on the use cases.</p><h3>Vuetify.js — The Best Material Design Framework</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6KXQ0J8xAOke-A2GhjkgFg.png" /><figcaption>Login form example implemented with Vuetify</figcaption></figure><p>If you want to create an application that follows the Material Design standard, <a href="https://vuetifyjs.com/">Vuetify.js</a> is probably the best choice.<br>Vuetify is a reusable semantic component framework for Vue.js that aims to provide clean, semantic and reusable components. It supports all the modern browsers and is compatible with Vue CLI-3. It also offers basic templates for Simple HTML, Webpack, NUXT, PWA, Electron, A La Carte, Apache Cordova.</p><p>Unfortunately, the documentation is just average. All of the numerous components are documented, but some are missing details and examples here and there. This may sometimes be frustrating as you may need to spend more time trying to understand how a certain component works. Luckily, it’s not a widespread issue but it’s advised to check it out if it meets your expectation, before starting the project development.</p><p>Vuetify’s Material Design implementation is very strict, which brings advantages for what concerns style standardization and components reusability. On the other hand, it doesn’t allow too much freedom for the style customization: changing the default element’s style is troublesome, but that has to be accepted as it’s not one of the goals of Vuetify. Unfortunately, if Material Design is not your thing and you want your app to look more iOS-like, or need a custom design, Vuetify.js usage should be avoided. If you are into Material Design or need to use it, Vuetify is hard to beat.</p><h3>Quasar Framework — A Powerful and Stable Choice</h3><p>If you are looking to build a stable and fully customizable application, <a href="https://quasar-framework.org/">Quasar Framework</a> is probably one of the most robust solutions currently available.</p><blockquote>Quasar is a open-source framework that helps web developers create responsive++ websites/apps</blockquote><p>The officially supported platforms are:</p><ul><li>SPAs (Single Page App)</li><li>SSR (Server-side Rendered App) (+ optional PWA client takeover)</li><li>PWAs (Progressive Web App)</li><li>Mobile Apps (Android, iOS, …) through Apache Cordova</li><li>Multi-platform Desktop Apps (Electron)</li></ul><p>While the supported platforms are similar to what Vuetify.js supports, Quasar also allows the developer to customize their applications with the iOS native theme style. Google Material design is also available. Both themes implementation does not strictly follow the official guidelines so it would be good to check some examples before choosing to use this framework for your next project.</p><p>Not only does Quasar support modern browsers, but also Windows Phone and Blackberry platforms, even if outdated. A powerful feature is the ability to progressively migrate your existing projects thanks to UMD (Unified Module Definition) version. To do so, Quasar allows developers to add a CSS and JS HTML tag into their existing project, making them ready to use without requiring a building operation.<br>Moreover, not only the components are fast and complete, but it also offers additional features to facilitate Cordova and Electron deployment process. With the `quasar.conf.js` file simplifies Webpack configuration. Additionally, there is an easy and powerful template generator to help you get started.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vyKUjkot-9-G42lb5ad5Ng.png" /><figcaption>An overview of Quasar’s documentation</figcaption></figure><p>Unfortunately, while documentation offers a lot of examples, it may lack some comprehensive explanation. An experienced developer should not have issues with it, but a beginner may find difficulties that should be accounted for.<br>If your objective is to have full control, customization and performance, Quasar is definitely one of the best choices.</p><h3>Element UI — Focused on Web and Desktop Apps</h3><p><a href="https://element.eleme.io/#/en-US">Element UI </a>is a Desktop UI toolkit for Vue.js. Its components are not numerous like the ones that can be found in Vuetify or Quasar, but are all very well implemented and easy to use.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*w8LwrV2UOFJLMXEk" /><figcaption>A dashboard implemented with Element UI</figcaption></figure><p>Element UI is not focused on Mobile development, mainly because it lacks responsiveness on mobile WebViews. It has been build to be used for Web and Desktop apps, where usually the local machine performance is not an issue as it is on a Mobile environment. For example, if you are planning to build an Electron application, Element UI would definitely be a good choice.</p><p>While the project’s original documentation is mainly in Chinese language, it has been completely translated into English and it’s very well written and organized. To be more specific, it easily guides the developer step by step and provides simple but complete examples of all the available components.<br>Unfortunately, Element UI does not yet support Vue3, so you should carefully consider its usage before making your choice.</p><h3>Bootstrap + Vue — Flexible and Well Documented</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*vhB7Zp2IsZzXNbZvu5IPqQ.gif" /><figcaption>Bootstrap + Vue Carousel implementation</figcaption></figure><p>Many developers already have experience in using Bootstrap, or have at least heard about it. Bootstrap is probably the world’s most popular front-end CSS library, allowing to build responsive mobile and web applications.<br>Luckily, there is a project called <a href="https://bootstrap-vue.js.org/">Bootstrap + Vue</a> that, as the name says, combines the two technologies to offer maximum flexibility for your app development. To be more specific</p><blockquote>Bootstrap-Vue provides one of the most comprehensive implementations of Bootstrap V4 components and grid system available for Vue.js 2.4+, complete with extensive and automated WAI-ARIA accessibility markup.</blockquote><p>The supported platforms are pretty much the same as all the other frameworks. There are currently two `vue-cli` templates available:</p><ul><li>webpack-simple: a quick scaffold for a proof of concept or small app</li><li>webpack: a larger, production-ready template with more options</li></ul><p>The components and directives availability look quite exhaustive moreover a specific component or a set of components can be singularly imported, based on the developer’s needs. There are three ways to do so:</p><ol><li>Cherry pick the component/directive by importing it in the file where it’s being used and adding its definition to your own component definition.</li><li>Register them globally.</li><li>Import components groups and directives as Vue plugins. Depending on the target components/directives, all subcomponents and related directives are imported as well.</li></ol><p>The documentation is very extensive and well organized, making Bootstrap-Vue a strong choice for both beginners and experienced developers.<br>While frameworks like Vuetify try to strictly follow the official Material Design specifications, Bootstrap-Vue offers more freedom and space for creativity while following the original Bootstrap’s core goal of allowing the quickest possible HTML markup.</p><h3>Conclusion</h3><p>We have analyzed some of the most popular, currently available front-end frameworks for Vue. Hopefully, this article gave you some useful insight about which framework may be suitable for your next project.<br>It’s good to keep in mind that these frameworks are in constant evolution and some of the opinions written at the time the article has been published may become questionable in the future. There are a lot of other really good front-end UI frameworks for Vue out there, so I invite you to be curious and try them out.</p><p>To conclude, we would also love to hear what’s your favorite front-end framework/library for Vue and why?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4448bac12ce7" width="1" height="1" alt=""><hr><p><a href="https://medium.com/the-web-tub/choosing-the-right-front-end-framework-for-your-vue-app-4448bac12ce7">Choosing the Right Front-End Framework for Your Vue App</a> was originally published in <a href="https://medium.com/the-web-tub">The Web Tub</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Choosing the right Map Integration for your Cordova App]]></title>
            <link>https://medium.com/the-web-tub/choosing-the-right-map-integration-for-your-cordova-app-78c2a8f75d50?source=rss-e639ea26b32e------2</link>
            <guid isPermaLink="false">https://medium.com/p/78c2a8f75d50</guid>
            <category><![CDATA[google-maps]]></category>
            <category><![CDATA[monaca]]></category>
            <category><![CDATA[openstreetmap]]></category>
            <category><![CDATA[mapbox]]></category>
            <category><![CDATA[cordova]]></category>
            <dc:creator><![CDATA[Andi Pavllo]]></dc:creator>
            <pubDate>Wed, 15 Nov 2017 06:39:47 GMT</pubDate>
            <atom:updated>2017-11-15T20:01:18.731Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*xaIegHRUU_5QszEuYO_LHg.gif" /></figure><p>While developing a mobile app, you may find yourself in a position where you need to integrate a map into it. Choosing the right solution can not only enhance the user experience but also provides extra perks like revenue increase, product image improvement etc., depending on the target audience and the app scope.</p><p>There are many factors to consider for the best solution. For example:</p><ul><li><strong>Private/Open Source</strong>: while maps provided by private services, like <a href="https://www.google.com/maps">Google Maps</a>, may provide a good accuracy and details, but at the same time they may lack the customization that Open Source maps, like <a href="https://www.openstreetmap.org/">OpenStreetMap</a>,<strong> </strong>provide (advanced toponymy modifications for example).</li><li><strong>Performance: </strong>each map may provide different optimization and APIs for specific OS and devices. That’s why it’s a good idea to always have in mind the target audience, use cases and integration plan.</li><li><strong>Pricing: </strong>while most services provide some free quota, you’ll likely need to switch to a paid plan when the app generates high traffic or needs to integrate advanced functionalities. It is definitely advisable to think about the usage expectation prior to choosing a map service.</li><li><strong>Features: </strong>while everybody’s got the basic features, the most advanced ones may only be provided by some of them.</li><li><strong>Updates: </strong>as the world topography is in constant evolution, maps need to adapt accordingly. Plus, they are not the only part that requires updates. Choosing a service that also provides a good support to new mobile and mapping technologies, like the recently introduced Galileo global navigation satellite system, may be a wise choice.</li></ul><p>In addition to above points, when you are considering which map to integrate into your Cordova App, one of the most critical steps is to <strong>choose between a Cordova Plugin or a JavaScript API implementation</strong>.</p><p>That’s exactly what we will talk about in this article: an analysis of pros and cons of different map integration services, provided through Cordova Plugins and JavaScript APIs, in order to understand which one is more suitable for your Cordova application.</p><h3>Map Service Teardowns — via Cordova Plugins and JavaScript APIs</h3><h3>Testing Method</h3><p>To compare these two approaches, I pick both private and open source solutions, and mainly focus on the performance rather than the features, as they may be very subjective. For the private maps service, the choice clearly went to Google Maps, while for the Open Source one I tried to find a successful service based on OpenStreetMap. After taking a look at a dozen of services, I decided to try Mapbox GL, which provides great features and uses WebGL to render interactive maps from <a href="https://www.mapbox.com/vector-tiles/">Vector Tiles</a> and customizable styles. Nevertheless, keep in mind that there are dozens of great services out there, so you may want to research a little bit more on your own after reading this article.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*rZbUVTjxEcbv3dJoiHxDJg.png" /></figure><p>After defining my choice, I decided to make a quick sample Cordova app using the Cordova Plugins and JS API provided for both solutions. Unfortunately, it seems that there are no official Cordova Plugins for these two services, so I decided to use the most famous ones developed by third-parties. To be more specific, I used <a href="https://github.com/mapsplugin/cordova-plugin-googlemaps"><strong>cordova-plugin-googlemaps</strong></a><strong> </strong>v2.0.11 and <a href="https://github.com/Telerik-Verified-Plugins/Mapbox"><strong>cordova-plugin-mapbox</strong></a><strong> </strong>v1.2.3. For the JS implementation, I used officially provided <a href="https://developers.google.com/maps/documentation/javascript/"><strong>Google Maps JavaScript API v3</strong></a><strong> </strong>and <a href="https://www.mapbox.com/mapbox-gl-js/api/"><strong>Mapbox GL JS v0.41.0</strong></a>.</p><p>To develop the sample app, I used <a href="https://monaca.io/"><strong>Monaca</strong></a><strong> </strong>because it offers an immediate feedback during the development through its <a href="https://monaca.io/debugger.html"><strong>Live Debugger</strong></a>.<strong> </strong>(Full disclosure: I’m one of the developers at Monaca :-). Nevertheless, feel free to use any service you like or the standard Cordova SDK if you feel more comfortable doing so. You can find this sample app in this <a href="https://github.com/andipavllo/cordova-maps-comparison"><strong>GitHub repository</strong></a><strong> </strong>or import it directly into Monaca by clicking the image below.</p><figure><a href="https://monaca.mobi/directimport?pid=5a0be390e78885d86b8b4567"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CFoT_9foXVZzlmn20XM9JA.png" /></a></figure><p>If you just want to check it out, just perform the initial configuration as follows a little bit below and you are ready to go!</p><h3>Expectations</h3><p>Generally, I expect the Cordova Plugin implementation to be smoother and more performant, rendering the map faster than the pure JS approach and making use of all the features available in the native SDK. On the other hand, I expect the JS API solution to be easier to implement and maintain, and also work flawlessly on mobile devices as well as on web browsers.</p><h3>Initial Configuration</h3><p>First of all, to be able to use both services you need to have an API key for each one. While Mapbox requires just one key, Google Maps distinguishes between JS API key and Mobile API Key. The latter one is not actually just a single key, but one key per platform. This means that if you want to run the plugin in both iOS and Android you need to generate an API for each platform. The instructions can be found in the plugin’s documentation or on the related service website. I found that the Mapbox configuration is a lot more immediate and intuitive, while the Google Maps ‘getting started’ is a bit tedious, making it easy to get lost in the documentation.</p><p>At this point, if you want to follow the procedure I performed by using Monaca, keep reading this section, otherwise take a look at the official documentation once again in order to understand how to import the API keys in your sample app and jump to the next section.</p><p>Open <a href="https://monaca.mobi/en/dashboard"><strong>Monaca Dashboard</strong></a><strong> </strong>and create a new <em>Onsen UI V2 JS Tabbar </em>template, go to config -&gt; Manage Cordova Plugins and import the two previously downloaded plugins. Once done, click Configure in each of them and add the previously generated API keys as follows:</p><ul><li>ACCESS_TOKEN=xxxxxxx for the Mapbox plugin.</li><li>API_KEY_FOR_ANDROID=xxxxxxx and API_KEY_FOR_IOS=xxxxxxx for Google Maps. Note that only target platform API key is required. For example, if you just want to build for Android you don’t need to add the iOS API key.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*27MFX3Kh4VESVkDf39RklA.png" /></figure><p>Now you can create a Custom Debugger which includes the two Plugins and allows you to check your app development result in real-time. For example, if you want to build the Android Custom Debugger, go to Build -&gt; Build App for Android and select Custom Debugger . Once built, you just need to install it on your device and you are ready to live debug your code, fetching the new changes each time a save operation has been performed.</p><h3>Sample App Development</h3><p>All the initial setup has been performed and we are ready to start developing the sample app. While the Cordova Plugins API keys have already been setup, the JS API keys need to be specified in the code itself. Open www/index.html and add the following content:</p><pre>&lt;link href=&#39;<a href="https://api.tiles.mapbox.com/mapbox-gl-js/v0.41.0/mapbox-gl.css">https://api.tiles.mapbox.com/mapbox-gl-js/v0.41.0/mapbox-gl.css</a><a href="https://api.mapbox.com/mapbox.js/v3.1.1/mapbox.css&#39;">&#39;</a> rel=&#39;stylesheet&#39; /&gt;<br>&lt;script src=&#39;<a href="https://api.tiles.mapbox.com/mapbox-gl-js/v0.41.0/mapbox-gl.js&#39;">https://api.tiles.mapbox.com/mapbox-gl-js/v0.41.0/mapbox-gl.js&#39;</a><a href="https://api.mapbox.com/mapbox.js/v3.1.1/mapbox.js&#39;">&#39;</a>&gt;&lt;/script&gt;<br>&lt;script async defer src=&quot;<a href="https://maps.googleapis.com/maps/api/js?key=AIzaSyC1QHkxaIF_9HkJDi4sSTm7W0jj4glXkeg&amp;callback=initJsMap">https://maps.googleapis.com/maps/api/js?key=YOUR_GOOGLE_MAPS_KEY&amp;callback=initGoogleMap</a>sJS&quot;&gt;<br>&lt;/script&gt;</pre><pre>&lt;script&gt;<br>    ons.ready(function() {<br>      // Provide your access token<br>      L.mapbox.accessToken = &#39;YOUR_MAPBOX_KEY&#39;;<br>    });<br>&lt;/script&gt;</pre><p>Now the app has completely been configured and we can start adding the maps to the app. I chose the <a href="https://docs.monaca.io/en/sampleapp/samples/onsen_ui_tabbar_navigator/">Onsen UI Tab Bar template</a> because my idea was to render each map in a separate tab, making it easier to switch between and test the performance. Unfortunately, here I encountered the first main issue. It looks like the Cordova Plugin for Mapbox does not support the map rendering into a specific container, as reported in this <a href="https://github.com/Telerik-Verified-Plugins/Mapbox/issues/37"><strong>GitHub issue</strong></a>. This is a real deal breaker as it greatly limits the map integration into the app as it does not allow an easy navigation. For this reason, I decided to drop it and continue the test with the remaining three alternatives.</p><p>The Cordova Google Maps plugin integration was quite easy to perform, with one exception. Because the generated map is a native view, and not an HTML element, it’s being added under the HTML content itself. This means that the view in which you are planning to display the map should have a transparent background in order to be able to see the map content. Onsen UI, and probably other UI frameworks as well, don’t always have a white background so it is good to keep in mind that a CSS modification may be required. Except for that, I haven’t encountered any other issue during the implementation.</p><p>The two JS map integrations were even smoother. I just had to define the container where I wanted to display the map and specify it during the map initialization.</p><h3>User Experience</h3><p>At this point, all I wanted to do was to check the map performance and user experience. All three implementations took approximately the same time to render the map once the app has been opened. While switching between the two JS implementation, the transition appears to be very smooth and linear. The Cordova plugin implementation generates a small flickering once its container is being displayed, not something that could greatly compromise the general user experience however. The map navigation to a new location feels smoother on the Cordova plugin implementation as it seems that being able to use the native OS SDK allows the map to be always pre-rendered, while the information are being fetched progressively. The touch actions appear to be very responsive in the two JS API implementations, while the Cordova plugin map seems sometimes missing some gestures recognition, pinch-to-zoom specifically.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*xaIegHRUU_5QszEuYO_LHg.gif" /></figure><p>From what I could notice, neither solution had an automatic cache management, which would surely be useful to reduce the loading time if the app is being frequently opened and closed. It is still possible to implement the cache manually for the Vector Tiles, which is available only in Google Maps Cordova and Mapbox GL JS API. Moreover, both these implementations offer animations support while the Google Maps JS API does not. For example, a specific point on the map could be zoomed in/out progressively at the specified speed. I played a little bit with this feature, as it looked like a good way to (partially) test the smoothness of the map rendering. By implementing two zoom in/out features, I noticed that both Google Maps Cordova and Mapbox GL JS API were handling the task very well, providing a nice effect while rendering.</p><h3>Conclusion</h3><p>After trying various solutions, I feel that no one is strictly superior to the other. All have their peculiarities and all provide the basic features needed by the most developers. Nevertheless, there are some points that need to be considered very carefully.</p><p>First of all, choosing between a JS API or a native SDK (accessible through Cordova plugin) may produce very different results. While the JS API offers more compatibility, easy integration and maintainability, it may lack in performance and integration with the mobile device hardware and services. On the other hand, a Cordova Plugin integration may provide great performance by taking advantage of the hardware and OS integration but that’s not always guaranteed and may have very different results depending by the OS or the hardware in which it runs and the developer’s implementation.</p><p>Another big thing to consider is if the solution has been made available directly by the service provider or by a third party. For example, neither Mapbox and Google Maps provide an official Cordova plugin. While the tested Google Maps plugin seems to be well implemented, it may be hard to constantly keep it up to date with all the official features and offer compatibility with the new native SDKs. At the moment, going for the JS APIs seems to be the safer way to have continuous support and updates, along with good performance.</p><p>The way the Tiles are implemented is also something that should be carefully considered. If an advanced personalization is required, Vector Tiles are surely the way to go as they offer great customization and features, like caching, scaling and 3D views. The classic Image Tiles are more than fine in the case where the map does not need to be heavily customized and the necessary information is already integrated.</p><p>Personally, I liked the Mapbox GL service for its potential and performance, but I definitely did not dislike the two Google Maps alternatives, which are still more than enough for most use cases and offer a complete integration with a huge set of points of interest mapped by Google itself.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=78c2a8f75d50" width="1" height="1" alt=""><hr><p><a href="https://medium.com/the-web-tub/choosing-the-right-map-integration-for-your-cordova-app-78c2a8f75d50">Choosing the right Map Integration for your Cordova App</a> was originally published in <a href="https://medium.com/the-web-tub">The Web Tub</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Tutorial: Create a Instagram Gallery App with Onsen UI + React]]></title>
            <link>https://medium.com/the-web-tub/tutorial-create-a-instagram-gallery-app-with-onsen-ui-react-aa546993ed00?source=rss-e639ea26b32e------2</link>
            <guid isPermaLink="false">https://medium.com/p/aa546993ed00</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[onsen-ui]]></category>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[material-design]]></category>
            <dc:creator><![CDATA[Andi Pavllo]]></dc:creator>
            <pubDate>Tue, 29 Sep 2015 12:00:00 GMT</pubDate>
            <atom:updated>2017-09-26T02:56:23.287Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*cX--bXuh9lD0H4vH.png" /></figure><p>As you probably already know, Onsen UI is based on AngularJS. Nevertheless, many of our users asked if it’s possible to use it with other frameworks, especially React. In this tutorial, we will show you how to develop a very simple Instagram app by using Onsen UI and React. We will create a simple gallery using React and Onsen UI!</p><p>Although the current stable version of Onsen UI is 1.3.11, we will be using the development version of Onsen UI 2.0. We are getting close to releasing the alpha version and it is already quite stable. Onsen UI 2.0 is framework agnostic. It is no longer dependent on Angular, which means it integrates a lot better with other frameworks.</p><p>For more info about the new and features of the upcoming Onsen UI 2.0 please take a look at these links:</p><ul><li><a href="http://onsen.io/blog/onsen-ui-roadmap-new-release-onsen-2-0/">Onsen UI Roadmap: New release and Onsen 2.0</a></li><li><a href="http://onsen.io/blog/material-design-onsen-ui/">Material Design in Onsen UI</a></li></ul><p>For those that never heard about it, React (sometimes styled React.js or ReactJS) is an open-source JavaScript library for building performant user interfaces. It is created and maintained by Facebook with the collaboration of Instagram and a community of individual developers and corporations. React is intended to help developers build large scale applications that use data that changes over time. Its goal is to be simple, declarative and composable.</p><p>To achieve this goal, React makes use of a Virtual DOM and a patching mechanism, which allow React to only update relevant portions of the application, rather than having to re-render the entire site on each change. This mechanism makes React one of the more performant JavaScript frameworks.</p><blockquote><strong>Disclaimer</strong>: The images are randomly retrieved from Instagram API, we don’t take any responsibility for the content.</blockquote><p>https://argelius.github.io/OnsenUI-React-SampleApp/www/index.html</p><h3>Prerequisites</h3><p>Before starting the development process, there are a few prerequisites. You can download the full project from this <a href="https://github.com/argelius/OnsenUI-React-SampleApp">GitHub repository</a>.</p><h4>Libraries</h4><p>In this tutorial we will be using React and Onsen UI. You can download the React libraries from <a href="http://facebook.github.io/react/">this link</a>. To implement this sample app we have used the dev version from <a href="https://github.com/facebook/react">React’s GitHub repository</a> but the stable release should work fine.</p><p>We are using the development version of Onsen UI which will soon be released as Onsen UI 2.0. In Onsen UI 2.0 we have removed the AngularJS dependency and are instead using Web Components to implement the UI components.</p><p>In order to use the development version you can clone the <a href="https://github.com/OnsenUI/OnsenUI">Onsen UI repository</a> and build from source. The build process is very simple and can he found <a href="https://github.com/OnsenUI/OnsenUI#how-to-build">here</a>. Another way is to download the <a href="http://onsen.io/download.html#latest-build">latest build</a> from our website.</p><h4>Documentation</h4><p>We invite you to take a look at the <a href="http://onsen.io/docs.html">Onsen UI</a> and <a href="https://facebook.github.io/react/docs/getting-started.html">React</a> documentation in case some concepts are not clear.</p><p>Once all the prerequisites have been satisfied, we can start with the development process.</p><h3>Development</h3><p>First of all, we need to include the libraries in the project. So start by creating an index.html file and import the following libraries:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ec5bcce4304255bff0407b00078eaaa2/href">https://medium.com/media/ec5bcce4304255bff0407b00078eaaa2/href</a></iframe><p>We are only importing ons-core.js instead of the onsenui.js file. The ons-core.js file contains everything we need while the onsenui.js file contains Angular bindings which are not required in this app.</p><p>JSXTransformer.js is a library already included in the React package. JSX is a JavaScript syntax extension that looks similar to XML. You can use a simple JSX syntactic transform with React. Even if you are still allowed to use plain JS with React, it’s recommended that you use JSX because it is more concise.</p><p>jQuery is just there to make AJAX calls. We could have used pure JavaScript to do this, but jQuery makes the code a bit cleaner.</p><p>We also need to import the Onsen UI stylesheets so the app displays correctly:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/43947af9d21f2047319e8beb6e1f66b2/href">https://medium.com/media/43947af9d21f2047319e8beb6e1f66b2/href</a></iframe><p>We also define some custom CSS to make the images and buttons display nicely:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b4e4358bfb45284f37a0c86196fd8262/href">https://medium.com/media/b4e4358bfb45284f37a0c86196fd8262/href</a></iframe><h4>HTML</h4><p>The HTML is very simple because almost all the content will be generated by React.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9d07c9d29764a05029e6425b24a6f43d/href">https://medium.com/media/9d07c9d29764a05029e6425b24a6f43d/href</a></iframe><p>We are just mentioning it because the div element will be the mounting point, to which all the dynamic content will be appended to.</p><h4>JS</h4><p>Let’s now take a look at the heart of our app: the React code. First of all, we need to identify the React components to implement. Instances of a React components are created internally in React when rendering. These instances are reused in subsequent renders, and can be accessed in your component methods as this. The only way to get a handle to a React component instance outside of React is by storing the return value of React.render.</p><p>In our case, just one component is enough: a PictureList component.</p><p><strong>PictureList Component</strong></p><p>This is the code that implements the picture list. It will render a &lt;ons-carousel&gt; which is a swipeable carousel element. The component will fetch a list of images from the Instagram API and render them as a list of &lt;ons-carousel-item&gt; elements so the user can browse through them by swiping. When the list of images changes it will automatically refresh the carousel.</p><p>We will also add some buttons to enable refreshing the list of images and going back and forth.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/68295c2c867592344dcbda91518a149e/href">https://medium.com/media/68295c2c867592344dcbda91518a149e/href</a></iframe><p>Before entering in the details of the component, we need to explain its lifecycle, which is defined in three states:</p><ul><li><strong>getInitialState</strong>: Invoked once before the component is mounted. The return value will be used as the initial value of this.state.</li><li><strong>componentDidMount</strong>: Invoked once, immediately after the initial rendering occurs. At this point in the lifecycle, the component has a DOM representation. The componentDidMount() method of child components is invoked before the ones of parent components.</li><li><strong>componentDidUpdate</strong>: Invoked immediately after the component’s updates are flushed to the DOM. This method is not called for the initial render.</li></ul><p>During getInitialState(), we just define an empty state called pictures and a boolean called loading. A state is just an internal data-set which affects the rendering of components. By defining a state, we are telling to the component which values should be available from the first render cycle until the state values are changed. A state should never be used without first declaring it in this manner.</p><p>In componentDidMount, we call the refresh() method which retrieves the data from the Instagram API. To access the API key parameter, we use this.props.apiKey. this.props contains all the properties of the component, which can be sent as parameters or be internally defined.</p><p>A JSON request will be made and the result, in case of success, will be put in the pictures variable. To conclude, we need to update the pictures state by executing self.setState({ pictures: pictures });.</p><p>At this point the state got updated, which means that it will also be rendered. It’s good to notice that this is not the first time that our state has been rendered, also after the creation a rendering event has occurred. We need to render each image contained into the pictures state as an ons-carousel item component. To do that we will use a map function, which is not a React function but it’s already included in JavaScript. The map() function just creates a new array with the results of calling a provided function on every element in this array.</p><p>In React, when children are shuffled around or if new components are added onto the front of the list, the identity and state of each child must be maintained across render passes. That’s why we have to uniquely identify each child by assigning it a key, in this case this.state.pictures.id.</p><p><strong>Final Rendering</strong></p><p>At this point, we are almost at the end of the sample app development. We have already rendered internally all the content but how to also render it inside the DOM structure? By using another rendering function, of course!</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/dd2b5a0e2bd3e4278a795810915eacbc/href">https://medium.com/media/dd2b5a0e2bd3e4278a795810915eacbc/href</a></iframe><p>This time we are rendering the Carousel component, which contains the PictureList component inside the DOM. The second parameter specifies the mounting point, in this case the element with content id.</p><h3>Conclusion</h3><p>In this tutorial you have seen how to create a sample Instagram gallery app by using Onsen UI and React. Now you have a basic layout to customize and enrich as you wish. Show us what you are able to do! The idea for this tutorial comes from Tutorialzine’s article <a href="http://tutorialzine.com/2014/07/5-practical-examples-for-learning-facebooks-react-framework/">5 Practical Examples For Learning The React Framework</a>.</p><p>As always, we want to remind you that Onsen UI is an open source project and a community effort. There is nothing that makes us happier than getting contributions from the community.</p><p>A good place to start is the <a href="https://github.com/OnsenUI/OnsenUI/issues">GitHub issues page</a>. If there’s an issue that you would like to solve, go ahead and fork the repository and make a Pull request. We also appreciate new features. Upon receiving a pull request, we will review it as soon as possible.</p><p>Another way to contribute is by helping other users on <a href="https://gitter.im/OnsenUI/OnsenUI">Gitter</a> or <a href="http://stackoverflow.com/questions/tagged/onsen-ui">Stack Overflow</a>.</p><p><em>Originally published at </em><a href="http://onsen.io/blog/tutorial-create-instagram-gallery-app-with-onsenui-react/"><em>onsen.io</em></a><em> on September 29, 2015.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aa546993ed00" width="1" height="1" alt=""><hr><p><a href="https://medium.com/the-web-tub/tutorial-create-a-instagram-gallery-app-with-onsen-ui-react-aa546993ed00">Tutorial: Create a Instagram Gallery App with Onsen UI + React</a> was originally published in <a href="https://medium.com/the-web-tub">The Web Tub</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Follow Onsen UI at Angular U Conference!]]></title>
            <link>https://medium.com/the-web-tub/follow-onsen-ui-at-angular-u-conference-aef60333ec97?source=rss-e639ea26b32e------2</link>
            <guid isPermaLink="false">https://medium.com/p/aef60333ec97</guid>
            <category><![CDATA[angularjs]]></category>
            <category><![CDATA[conference]]></category>
            <category><![CDATA[onsen-ui]]></category>
            <dc:creator><![CDATA[Andi Pavllo]]></dc:creator>
            <pubDate>Mon, 22 Jun 2015 12:00:00 GMT</pubDate>
            <atom:updated>2017-09-26T03:14:15.856Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/694/0*Kw0eTfa8hI70mViz.png" /></figure><p>Dear followers, as many of you probably already know, this week, in San Francisco, the <a href="https://angularu.com/ng/">Angular U Conference 2015</a> will be held. For those of you who never heard of it, Angular U is an Angular conference covering Angular 1.x, 2, TypeScript, ECMAScript 6, Web Components and more. That’s why we couldn’t miss this event!</p><p><a href="https://angularu.com/ng/speaker/2015sf/andreas-argelius-32414">Andreas Argelius</a>, core developer on Onsen UI and Monaca, will attend the event and talk about “Angular + Cordova + Monaca = Killer mobile app development”!</p><p>From June 22 to 25, at Hyatt Regency, close to San Francisco Airport, AngularJS developers and enthusiasts will meet to discuss the recent technological trends for what concerns Angular and, most in general, web and mobile development.</p><p>Andreas talk will be on Tuesday 23 June, from 3:00 PM to 3:25 PM (GMT-7), at _BALLROOM ABC Room (a live feed stream will be available on the event’s website).</p><p>Here is a short preview about what Andreas will talk about:</p><p>Hybrid apps are mobile apps built using technologies we all love: HTML, CSS and JavaScript. They can be deployed on several different platforms while still sharing most of the code base. In this talk, some awesome tools for building, packaging and publishing your hybrid apps will be presented. We will also look into efficient ways of debugging your code on actual mobile devices and how to create a performant and beautiful user interfaces with AngularJS and reusable UI components.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*UTyGK9e-z6GC88y9.png" /></figure><p>Apart from Andreas, many other developers will take part in the Convention and give a talk about their work, experience and passion. Between them we will be able to see none other then members of the AngularJS team, like <a href="https://angularu.com/ng/speaker/2015sf/igor-minar-31683">Igor Minar</a>, <a href="https://angularu.com/ng/speaker/2015sf/misko-hevery-31682">Misko Hevery</a> and <a href="https://angularu.com/ng/speaker/2015sf/brad-green-31684">Brad Green</a>, or <a href="https://angularu.com/ng/speaker/2015sf/douglas-crockford-1124">Douglas Crockford</a>, one of the “Guru” of JavaScript.</p><p>What are you waiting for? Come to meet us and let us know what do you think about developing Hybrid Cordova Apps with Monaca and Onsen UI!</p><p><em>Originally published at </em><a href="http://onsen.io/blog/follow-onsen-ui-at-angular-u-conference/"><em>onsen.io</em></a><em> on June 22, 2015.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aef60333ec97" width="1" height="1" alt=""><hr><p><a href="https://medium.com/the-web-tub/follow-onsen-ui-at-angular-u-conference-aef60333ec97">Follow Onsen UI at Angular U Conference!</a> was originally published in <a href="https://medium.com/the-web-tub">The Web Tub</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Tutorial: Todo App with Onsen UI and Azure]]></title>
            <link>https://medium.com/the-web-tub/tutorial-todo-app-with-onsen-ui-and-azure-21f7e28a3521?source=rss-e639ea26b32e------2</link>
            <guid isPermaLink="false">https://medium.com/p/21f7e28a3521</guid>
            <category><![CDATA[azure]]></category>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[onsen-ui]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[to-do-list-app]]></category>
            <dc:creator><![CDATA[Andi Pavllo]]></dc:creator>
            <pubDate>Sat, 23 May 2015 12:00:00 GMT</pubDate>
            <atom:updated>2017-09-26T03:15:34.479Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*dTiGzHD-rADW3w3F.png" /></figure><p>After having introduced how to <a href="http://onsen.io/blog/windows-phone-8-1-tutorial/">create a Simple App for Windows Phone 8.1 using Onsen UI</a>, it’s time to demonstrate the potentialities of our framework with a new tutorial! This time we will create a Todo App with Onsen UI, using the services provided by <a href="http://azure.microsoft.com/">Azure</a>, to host our data, and the new <a href="http://onsen.io/blog/tutorial-todo-app-with-onsen-ui-and-azure/Onsen%20UI%20Templates%20for%20Visual%20Studio%20working%20on%20Windows%20Phone">Onsen UI Templates</a> for Visual Studio 2015.</p><p>For those that have never heard about it, <a href="http://azure.microsoft.com/">Azure</a> is Microsoft’s Cloud platform: a growing collection of services, storage, data and networking. Azure offers a wide range of tools, but we are just interested in suitable tools for the development of hybrid apps.</p><p>That’s why, during this tutorial, we will only implement a cloud-based backend service, using <a href="http://azure.microsoft.com/en-in/services/app-service/mobile/">Azure Mobile Services</a>. This will allow us to host our data in an easy and intuitive way, regardless of the mobile platform in which the app will be executed.</p><p>A full working Sample App is available on this <a href="https://github.com/andipavllo/Onsen-UI-Todo-App-with-Azure">GitHub repository</a>, we invite you to take a look at it before starting!</p><h3>Prerequisites</h3><p>In order to develop Cordova Apps with Visual Studio, you need to have Windows 8.1 installed. Before starting, there are some prerequisites:</p><p><strong>Install Apache Ant</strong></p><p>Download Apache Ant from the <a href="https://ant.apache.org/bindownload.cgi">official website</a>. Once installed, test if you can run ant --version command through Windows Terminal (cmd.exe). If not, just add the Apache Ant directory into the Windows environment variables.</p><p><strong>Install Node.js</strong></p><p>Download Node.js from the <a href="https://nodejs.org/download/">official website</a>. It gives you access to a program called npm, a package manager for Node.js. Once installed, test if you can run node --version command through Windows Terminal. If not, just add the Node.js directory into the Windows environment variables.</p><p><strong>Install Cordova</strong></p><p>Once Node.js and Apache Ant have been successfully installed, you can proceed with Cordova installation. You can download it from <a href="https://nodejs.org/">here</a>.</p><pre>npm install -g cordova</pre><p>For more details, about how to use Cordova tool, please refer to <a href="https://cordova.apache.org/docs/en/edge/index.html">Cordova documentation</a>.</p><p><strong>Install Microsoft Visual Studio 2015 RC</strong></p><p>In this tutorial, we have used Microsoft Visual Studio 2015 RC Enterprise, which can be downloaded <a href="https://www.visualstudio.com/en-us/downloads/visual-studio-2015-downloads-vs.aspx">here</a>. Before the installation, remember to select all the options related with Azure and Cordova Tools.</p><p><strong>Download Onsen UI Templates for Visual Studio 2015</strong></p><p>As announced recently, we have release Onsen UI Templates for Visual Studio 2015. As previously mentioned, we will use those templates in order to build our Todo App. You can download them at <a href="https://visualstudiogallery.msdn.microsoft.com/8968a18d-cc94-4ebf-8183-ed0e1f6247f3">this link</a>.</p><p><strong>Subscribe Azure Free Trial</strong></p><p>In order to be able to use Azure Services, you need an active subscription. In case you don’t have it, you can register for free and join the trial program, which lasts 30 days, at <a href="http://azure.microsoft.com/en-us/pricing/free-trial/">this link</a>. Once the trial period has expired, you will not lose your data, but you will not be able to insert new data into the cloud storage.</p><h3>Development</h3><p>After all the prerequisites have been satisfied, it’s time to start the app development!</p><p>First of all, open Visual Studio 2015 and create a new project. After opening the new project menu, on the top right side, you can find a search box to find the desired template. Write Onsen and selecti the Onsen Tab Bar template. This template will be the base of our Todo App: it will quickly be expanded with new elements and functionalities.</p><p>In order to better understand what we are trying to build, you can try this sample, linked directly with the project’s <a href="https://github.com/andipavllo/Onsen-UI-Todo-App-with-Azure">GitHub repository</a>.</p><p><a href="https://andipavllo.github.io/Onsen-UI-Todo-App-with-Azure/Azure%20TODO%20App/www/index.html">Onsen UI Azure App</a></p><p>At this point, we need to link an Azure mobile service to our app. To do that, open the Server Explorer Menu (View-&gt;Server Explorer), select Azure and connect with your account. It should load the services that are available for your subscription. Right click on Mobile Services and create a new service. A new window will appear and you’ll be asked configure your mobile service. We called it TodoOnsenUI so, from now on, we’ll refer to it when we talk about the mobile service that we are using.</p><p>After the mobile service is created, a reference to the Mobile Services client library is added to the project and your project source code is updated. More specifically, a new folder called services will be created and, in one of its subfolders, a file called todoOnsen.js will be generated. It will contain the information needed to connect to the mobile service, like URL and app key. Now it’s time to create a table where to host our data. Right click on TodoOnsenUI and select Create Table、I called it TodoItem.</p><p>Now we have a table where to host our data, but we still need to customize it, adding new attributes. Unfortunately, it’s not possible to do it directly from Visual Studio, so we need to access the Azure portal. We can do it in two ways:</p><ul><li><em>Browser</em>: navigate to the portal address (<a href="http://manage.windowsazure.com/">http://manage.windowsazure.com/</a>).</li><li><em>Visual Studio</em>: open the Service Explorer, right click on the mobile service name and select Open in Management Portal.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*SRpSyjqRTJlYuiTO.png" /></figure><p>Once the portal has been opened, navigate into the TodoOnsenUI service, go in DATA and select TodoItem table. You’ll notice that it’s still empty, but some attributes have already been created. They are mainly related with the ID of the records and the creation/modification timestamp. We need to add three new attributes: the title, the content and the active status of our item. To do it, just select COLUMNS from the menu and add the first two attributes as strings and the active attribute as boolean. This operation can be also done automatically the first time that we insert the data inside the database but, to be sure about the attributes type, it’s recommended to create them manually. You can also modify the database permissions in order to increase its security. As default, the access is allowed to all the users that have the key but an authentication process can be implemented. In this app, we haven’t implemented it, but if you are interested, take a look at <a href="http://azure.microsoft.com/en-us/documentation/articles/mobile-services-windows-store-javascript-get-started-users/">this link</a>.</p><p>Let’s start with the HTML and AngularJS controller!</p><h4>HTML</h4><p>To realize this Todo App, we have hosted all the HTML content inside a single HTML page: index.html. But you should notice that, inside it, we have hosted different pages by using the ons-template element. We chose this approach because the content of our app is very limited but, in case you want to expand it, we suggest you to create different HTML files.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/de821992adcc2bd973797ff9d52e3329/href">https://medium.com/media/de821992adcc2bd973797ff9d52e3329/href</a></iframe><p>Once the DOM has been fully loaded, an ons.ready() function, inside the controller, will load the view content. First of all we need to modify the default ons-tabbar element, linking it to the main pages of our app:</p><p><strong>list.html</strong></p><p>It contains all the Todo items. All its content is included inside ons-navigator element, which offers a more intuitive page navigation than ons-tabbar. From the ons-toolbar element, we can open addMemo.html, which will allow to add a new memo to the Todo list.</p><p>The list content is displayed in an ons-list element. With ng-repeat=&quot;stuff in items track by $index&quot; we are able to get the content from the $scope.items array declared inside the AngularJS controller, which will be analyzed soon. We’ll use ng-class=&quot;{completed: stuff.completed}&quot; to change dynamically the appereance of the ons-list-item: if stuff.completed is true, then the .completed class will be applied.</p><p>The content of the list has been saved inside a template HTML page, called template.html, because of its use in different HTML pages. To add it inside our list element, we have used ng-include=&quot;&#39;template.html&#39;&quot;</p><p><strong>template.html</strong></p><p>As previously mentioned, this page contains the content of the ons-list-item element. More specifically, it contains a checkbox, two attributes of the $scope.items array and a button.</p><p>The checkbox element is used to mark a specific Todo item as completed. It’s bound with $scope.items.completed variable by using ng-model=&quot;stuff.completed&quot;. That means that every time one of the two elements will be modified, also the other one will automatically get modified in the same way.</p><p>Once the checkbox status changes, the toggleCompleted($index) will be executed. It will modify the status of the item in active or completed, and update its record inside the cloud storage.</p><p>The two attributes of the $scope.items array, that will be displayed, are the title and the content of the Todo item. To conclude, there is an ons-button element which, when clicked, will delete the list element from the cloud storage and from the local object array.</p><p><strong>addMemo.html</strong></p><p>This page contains two input fields where the user can insert the Todo item title and content. These two fields are bound with two different variables inside the controller, by using ng-model directive. For space reasons, in this sample app we have limited their size respectively to 10 and 20 characters.</p><p>Once the form has been compiled, it can be submitted by pressing an ons-button, which will call a function that will save the Todo item inside the cloud storage and the local object array. Using ng-disable directive, we can keep the submit button disabled until the form content is considered valid.</p><p><strong>active.html — completed.html</strong></p><p>These two pages contain, respectively, the Todo items that are marked as completed and still active. The HTML content is almost the same as list.html, the only difference are the ng-show and ng-hide directives which, while bound with stuff.completed, will display the completed or the hidden items.</p><h4>CSS</h4><p>In addition to the standard Onsen UI template, there are a couple of new classes that have been added to the CSS, in order to display some elements.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0589d00232ba774caafd8217a0d24d92/href">https://medium.com/media/0589d00232ba774caafd8217a0d24d92/href</a></iframe><p>The .completed class will be applied dynamically, using ng-class to an ons-list-item element which contains the relative Todo item, in case the completed value of that item is true. It will just add a line-through effect to the text and change its color, to make the Todo item appears like completed.</p><p>The .destroy class is applied to the ons-button which, once clicked, will delete the memo from the cloud storage.</p><h4>Mobile Service Javascript file</h4><p>This file has been automatically generated once the Azure mobile service has been linked with the app, using Visual Studio. It can be found inside www/services/... folder and contains the connection URL of the mobile service and the key needed to authenticate. The content should be like this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4125eff370d3f9572a6cfc8335c51a73/href">https://medium.com/media/4125eff370d3f9572a6cfc8335c51a73/href</a></iframe><p>In case it differs, because of the default platform choose during the mobile service creation, we invite you to edit the file in this way.</p><h4>Controller</h4><p>The controller contains all the business logic of our app and it’s linked directly with the index.html page. We will now analyze some of the functions that characterize the app behavior.</p><p><strong>ons.ready()</strong></p><p>As mentioned inside the <a href="http://onsen.io/guide/overview.html#onsreadyfunction">Onsen UI documentation</a>, this function is called when Onsen UI initialization is done. If the app is running under Cordova or PhoneGap, it will also wait for its initialization (ondeviceready event).</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d4ad93c4302485708d1ec7ac41baa259/href">https://medium.com/media/d4ad93c4302485708d1ec7ac41baa259/href</a></iframe><p>Once the function is executed, the data are retrieved from the TodoItem table, hosted inside Azure cloud storage. If the operation succeeds, the content will be saved in a local object array. Because this array will contain the element that will be displayed inside the ons-list, we need to execute $scope.$apply to update the view content.</p><p><strong>$scope.addMemo()</strong></p><p>The purpose of this function is to add a new element inside the cloud storage and the local object array. This function is executed when the save memo button is pressed.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7b4e3a4e873313c6c2c9e29c8f5bb7cd/href">https://medium.com/media/7b4e3a4e873313c6c2c9e29c8f5bb7cd/href</a></iframe><p>First of all, the save button is disabled, to avoid undesired user behavior, and a new memo object is created, based on the values of the two fields compiled by the user, inside addMemo.html page. Afterward, the new item will be sent to the cloud storage. The callback function will return the information about the item that was previously saved. The most important information is the id, which has been automatically created by the backend service and which is necessary for saving the element once it’ll be edited. In case the operation succeeds, the information will be added inside the local object array, the input fields will be clean, the list content view will be updated and the user will be redirected to the main Todo list page. In case of failure, the save button will be enabled, to allow another try, and an error message will be displayed.</p><p><strong>$scope.deleteMemo()</strong></p><p>This function’s purpose is to delete a Todo element from the cloud storage and the local object array. This function is executed when the delete button is pressed, inside the ons-list-item element. It takes as input the index of the element that the user wants to delete.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/fabe69935f608a87868a67f68ca24d84/href">https://medium.com/media/fabe69935f608a87868a67f68ca24d84/href</a></iframe><p>Once the delete button is pressed, an ons-notification-confirm elements appears and asks for a confirmation. Once the user approves the operation, the desired item will be removed from the cloud storage. If the operation succeeds, the item will be also removed from the local object array, and the list content view will be updated. Furthermore, the user will be informed about the success of the procedure by an ons-notification-alert element. In case of failure, an error log will be displayed.</p><p><strong>$scope.toggleCompleted()</strong></p><p>Once a checkbox element state changes, the relative Todo item is marked as completed or active. Every time this event happens, we need to save it in a permanent way inside the cloud storage and reflect the changes on the view.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a06e9a28bf238ad4bd5e132a65bc216e/href">https://medium.com/media/a06e9a28bf238ad4bd5e132a65bc216e/href</a></iframe><p>The function that updates the values, inside the cloud storage, will take as input the ID of the element that we want to modify, and the modified attribute, in this case completed. If the operation succeeds, no instruction will be executed because the changes are already reflected on the view. Otherwise, if the operation fails the completed attribute will be restored to its previous status and the view will be updated.</p><h3>Deployment</h3><p>Once our application is ready, we can deploy it on our device (or emulator) in two ways:</p><h4>Using Microsoft Visual Studio</h4><p>This is the easiest solution. We just need to select the platform, the target device and to switch the Debug option to Release. We can also, optionally, choose the CPU for wich your app will be compatible. At this point, just by launching the procedure, the app will be automatically installed on the target device.</p><h4>Using command line</h4><p>Open the terminal and navigate in the root directory of the <em>Cordova</em> project, then execute:</p><pre>cordova platform add &#39;platform name&#39;</pre><p>In case you have executed the app, with Visual Studio, on a platform, you can skip this step. That’s because the platform has already been added the first time the app has been executed.</p><p>In case you’ll experience crashes at the app’s startup or errors, we suggest you to install Cordova 4.3.0 (we had problems with Cordova 5.0.0), remove the platform and add it by command line. That’s because not always Visual Studio Apache Tools for Cordova is updated to the last version.</p><p>To change Cordova platform and remove the platform from the project just execute:</p><pre>npm install cordova@4.3.0 <br>cordova platform rm &#39;platform name&#39;</pre><p>Also take a look at Azure Mobile Service plugin for Cordova at this <a href="https://github.com/Azure/azure-mobile-services-cordova">GitHub repository</a>, for new updates. We have used this version of the library, instead of the one autogenerated during the mobile service initialization.</p><p>To deploy the app we can use, depending by the platform and the target, these commands (you can find a full list of them on <a href="https://cordova.apache.org/docs/en/4.0.0/guide_cli_index.md.html">Cordova documentation</a>).</p><pre>cordova run android --device <br>cordova run ios --device <br>cordova run windows --device -- --phone</pre><h3>Conclusion</h3><p>Another tutorial is over, we hope that you have enjoyed it learned about Onsen UI and Azure mobile service. Now you are ready to expand your app with new functionalities, maybe using the other features available from Azure, which offers a huge set of development tools able to satisfy even the most exigent developers.</p><p>We would invite you to let us know your experience with Onsen UI and how can we improve it, from your point of view. Moreover, let us know if there is any other tutorial that you would like to see on our blog, we would make the possible to satisfy your requests.</p><p>Continue to follow us and don’t forget to star our <a href="https://github.com/OnsenUI/OnsenUI">GitHub repository</a>!</p><p><em>Originally published at </em><a href="http://onsen.io/blog/tutorial-todo-app-with-onsen-ui-and-azure/"><em>onsen.io</em></a><em> on May 23, 2015.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=21f7e28a3521" width="1" height="1" alt=""><hr><p><a href="https://medium.com/the-web-tub/tutorial-todo-app-with-onsen-ui-and-azure-21f7e28a3521">Tutorial: Todo App with Onsen UI and Azure</a> was originally published in <a href="https://medium.com/the-web-tub">The Web Tub</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Tutorial: Customizing Onsen UI Themes]]></title>
            <link>https://medium.com/the-web-tub/tutorial-customizing-onsen-ui-themes-fb2380b53da5?source=rss-e639ea26b32e------2</link>
            <guid isPermaLink="false">https://medium.com/p/fb2380b53da5</guid>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[onsen-ui]]></category>
            <dc:creator><![CDATA[Andi Pavllo]]></dc:creator>
            <pubDate>Thu, 23 Apr 2015 12:00:00 GMT</pubDate>
            <atom:updated>2017-09-26T03:36:37.868Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/646/0*w29GWFIrrKN6Y95q.png" /></figure><p>Onsen UI has a wide set of premade themes, which cover a rich set of color combinations. Although the default colors look good, when creating an app with Onsen UI we recommend customizing the theme to give the app a personal touch. Branding is important since it differentiates your app from others and makes it easily recognizable.</p><p>How can the developer modify these themes, to give the Onsen UI components the desired colors? There are two ways to accomplish this.</p><p>The first one is to use our <a href="http://comptnents.onsen.io/">Theme Roller Tool</a>, which provides, thanks to an intuitive graphical interface, an easy way to customize Onsen UI themes.</p><p>The second way to customize themes is by modifying and compiling the <a href="https://learnboost.github.io/stylus/">Stylus</a> files. Using an automated <a href="http://gulpjs.com/">gulp</a> task and live reloading this approach also powerful and easier to integrate into a normal developer workflow.</p><h3>Why should I modify themes manually?</h3><p>If you have already took a look at <a href="http://onsen.io/blog/introducing-onsen-css-components/">this tutorial</a>, you probably noticed that the Onsen UI Theme Roller Tool not only allows you to customize themes, but also provides the functionality to export them, making your new themes ready to be imported into the app’s project. This approach has some limitations: the theme will be limited to the current version of Onsen UI. In case of future structure changes, it could not be compatible anymore with the new framework releases.</p><p>The dynamic customization of the themes is the solution of this kind of problems. Onsen UI themes are codified as Stylus, providing an efficient, dynamic, and expressive way to generate CSS.</p><p>Using the .styl file extension, Stylus accepts the standard CSS syntax, but it also accepts some other variations where brackets, colons, and semi-colons are all optional.</p><p>Let’s see how to modify the Stylus themes and how to verify the changes in real time.</p><h3>Prerequisites</h3><p>If you already have gulp installed you can skip this.</p><p>You will need Node.js in this tutorial. Please download it from the <a href="https://nodejs.org/">official website</a>. After Node.js is installed you will have access to a program called npm which is a package manager for Node.js, it allows you to easily install Node.js modules.</p><p>We now need to install gulp, which is a task runner for Node.js. In a terminal run the following command:</p><pre>$ sudo npm install -g gulp</pre><p>If you’re on Windows you can omit the “sudo”. This will install gulp globally so you have access to it everywhere.</p><h3>Let’s start!</h3><p>First of all, download one of the Onsen UI templates at <a href="http://onsen.io/download.html#download-templates">this page</a> (any template is fine), extract it and navigate to the root folder.</p><p>We now need to install some dependencies, so we run:</p><pre>$ npm install</pre><p>After that is done we can start serving the project:</p><pre>$ gulp serve</pre><p>This starts a web server and the output should look something like this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/779082f7810d7228d2ff88ad19375ff7/href">https://medium.com/media/779082f7810d7228d2ff88ad19375ff7/href</a></iframe><p>Normally a browser will open automatically but if it doesn’t (or you accidentally close it) you can find the URL in the output.</p><p>Now open www/index.html in a text editor. We can see what theme is currently used near the top of the file:</p><pre>&lt;link rel=&quot;stylesheet&quot; href=&quot;styles/onsen-css-components-blue-basic-theme.css&quot;&gt;</pre><p>This corresponds to the colors defined in www/lib/onsen/stylus/blue-basic-theme.styl. The content of that file will be something like this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/26bb1a6a7ad99d1f7ee2257298467a16/href">https://medium.com/media/26bb1a6a7ad99d1f7ee2257298467a16/href</a></iframe><p>As you can see it contains are the colors for the Onsen UI components. By customizing this file you can add personality to your app.</p><p>Try changing the color of the toolbar by changing the $toolbar-background-color variable. When you save the file the Stylus files will be instantly compiled and the browser reloaded so you can see the changes instantly.</p><p>Keep customizing the variables until you’re satisfied with how your app looks. The colors is just one part of making a successful app but I think most people would agree when I say that it’s darn important!</p><h3>Conclusion</h3><p>Have you seen how easy is to modify an Onsen UI theme? Why don’t you try and share your results with us?! If you have any trouble getting started please ask in the comments and we will do our best to help you.</p><p>Continue to follow our <a href="http://onsen.io/blog/">Blog</a> and take a look at our <a href="https://github.com/OnsenUI/OnsenUI">GitHub page</a> (in case you like it, give us a star, please!). In case you have comments or advice, please let us know. Your opinion matters!</p><p><em>Originally published at </em><a href="http://onsen.io/blog/tutorial-customizing-onsen-ui-themes/"><em>onsen.io</em></a><em> on April 23, 2015.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fb2380b53da5" width="1" height="1" alt=""><hr><p><a href="https://medium.com/the-web-tub/tutorial-customizing-onsen-ui-themes-fb2380b53da5">Tutorial: Customizing Onsen UI Themes</a> was originally published in <a href="https://medium.com/the-web-tub">The Web Tub</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[We are going to O’Reilly Fluent!]]></title>
            <link>https://medium.com/the-web-tub/we-are-going-to-oreilly-fluent-189183ffac7a?source=rss-e639ea26b32e------2</link>
            <guid isPermaLink="false">https://medium.com/p/189183ffac7a</guid>
            <category><![CDATA[onsen-ui]]></category>
            <category><![CDATA[conference]]></category>
            <category><![CDATA[monaca]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Andi Pavllo]]></dc:creator>
            <pubDate>Mon, 20 Apr 2015 12:00:00 GMT</pubDate>
            <atom:updated>2017-09-26T03:36:17.777Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/696/0*KFPqtnl2-Nnwm62i.png" /></figure><p>Dear followers, we are happy to announce that we will attend <a href="http://fluentconf.com/javascript-html-2015">O’Reilly Fluent Conference 2015</a>, this week! For those of you who never heard of it, the O’Reilly Fluent Conference is an event for developers working with JavaScript, HTML5, and other web technologies. Fluent covers the full scope of the Web Platform and its associated technologies, including WebGL, CSS3, mobile APIs, Node.js, AngularJS, ECMAScript 6, and more.</p><p>From April 20 to 22 in San Francisco, representatives of <a href="http://onsen.io/">Onsen UI</a> and <a href="https://monaca.io/">Monaca</a> will introduce you to the latest features of these two products. You’ll have the possibility to test our products and ask all the questions you wish: our staff will be at your disposal anytime!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*fe9V8SO4NvGj7rEQ.jpg" /></figure><p>Here is a list of topics we can discuss together but we can discuss about whatever you want!</p><ul><li>Onsen UI</li><li>Browser-based full IDE</li><li>Add-on for Visual Studio</li><li>Monaca Command Line Interface</li><li>Remote Build for iOS, Android and Windows</li><li>Live Sync Debugging with Inspector</li></ul><p>As reported on O’Reilly Fluent Conference <a href="http://fluentconf.com/javascript-html-2015/public/content/about">website</a>, the event will be subdivided in:</p><ul><li>One day of in-depth workshops</li><li>Two days of keynotes and sessions that explore state-of-the-art, real-world case studies, technology introductions, and best practices</li><li>Networking opportunities with hundreds of other front-end and back-end developers and technologists</li><li>Multiple occasions — including the hallway track, Exhibit Hall, and after-hours events — for attendees, speakers, journalists, and vendors to debate and discuss issues of interest and importance</li></ul><p>What are you waiting for? Come to meet us and let us know what do you think about our products!</p><p><em>Originally published at </em><a href="http://onsen.io/blog/monaca-and-onsen-ui-at-o-reilly-fluent/"><em>onsen.io</em></a><em> on April 20, 2015.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=189183ffac7a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/the-web-tub/we-are-going-to-oreilly-fluent-189183ffac7a">We are going to O’Reilly Fluent!</a> was originally published in <a href="https://medium.com/the-web-tub">The Web Tub</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Tutorial: create a sample app with Windows Phone 8.1 and Onsen UI]]></title>
            <link>https://medium.com/the-web-tub/tutorial-create-a-sample-app-with-windows-phone-8-1-and-onsen-ui-ba6fde7fcb56?source=rss-e639ea26b32e------2</link>
            <guid isPermaLink="false">https://medium.com/p/ba6fde7fcb56</guid>
            <category><![CDATA[visual-studio]]></category>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[windows-phone]]></category>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[onsen-ui]]></category>
            <dc:creator><![CDATA[Andi Pavllo]]></dc:creator>
            <pubDate>Tue, 14 Apr 2015 12:00:00 GMT</pubDate>
            <atom:updated>2017-09-26T03:35:52.471Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/386/0*pfrrGVLc4dWzfDWH.png" /></figure><p>As you know, last week we announced the new version of Onsen UI, which offers Windows Phone support. If you have missed it, take a look <a href="http://onsen.io/blog/onsen-ui-supports-windows-phone/">here</a>. We promised updates and guides about the new tools implemented to develop hybrid applications compatible with Windows Phone 8.1. That’s why, in this tutorial, we will explain how to develop a Cordova app based on Onsen UI and compatible with Windows Universal platform, which includes Windows Phone 8.1.</p><h3>Prerequisites</h3><p>In order to develop Windows Universal applications, you need to have Windows 8.1 installed. Before starting, there are some prerequisites that you should install:</p><p><strong>Install Apache Ant</strong></p><p>Download Apache Ant from the <a href="https://ant.apache.org/bindownload.cgi">official website</a>. Once installed, test if you can run ant --version command through Windows Terminal (cmd.exe). If not, just add the Apache Ant directory into the Windows environment variables.</p><p><strong>Install Node.js</strong></p><p>Download Node.js from the <a href="https://nodejs.org/download/">official website</a>. It gives you access to a program called npm, a package manager for Node.js. Once installed, test if you can run node --version command through Windows Terminal. If not, just add the Node.js directory into the Windows environment variables.</p><p><strong>Install Cordova</strong></p><p>Once Node.js and Apache Ant have been successfully installed, you can proceed with Cordova installation. You can download it from <a href="https://nodejs.org/">here</a>.</p><pre>npm install -g cordova</pre><p>For more details, about how to use Cordova tool, please refer to <a href="https://cordova.apache.org/docs/en/edge/index.html">Cordova documentation</a>.</p><p><strong>Install Onsen UI</strong></p><p>There are several ways to install Onsen UI. You can download Onsen UI from our <a href="http://onsen.io/download.html">download page</a>, clone our <a href="https://github.com/OnsenUI/OnsenUI">GitHub repository</a> or, if you prefer using Bower, by executing the following command:</p><pre>bower install onsenui</pre><p>During this tutorial, we’ll use the Master-Detail template, that can be downloaded <a href="http://onsen.io/OnsenUI/project_templates/onsen_master_detail.zip">here</a> but you are free to use whatever resource you prefer.</p><p><strong>Microsoft Visual Studio</strong></p><p>Microsoft Visual Studio is, for sure, the best software to develop applications for Windows Phone. It offers the only possibility that you have to manipulate the DOM in realtime and to debug a Windows platform application. It also integrates six different Windows Phone 8.1 emulators, which can be useful to test your app, in case you don’t have a Windows Phone 8.1 device.</p><p>The software is available in different versions, some of them free, some not.</p><p>In this tutorial, we have used Microsoft Visual Studio Express 2013 for Windows, which can be downloaded <a href="http://go.microsoft.com/?linkid=9832256">here</a>.</p><p><em>Note</em>: you can use the IDE or text editor that you prefer to write your code but you will lose the possibility manipulate the DOM and to debug your app.</p><h3>Development</h3><p>The development process of a sample app with Windows Phone 8.1 and Onsen UI is very easy. Let’s start!</p><p>Navigate to the the directory where you want to store your project project and create it by executing:</p><pre>cordova create test io.onsen.windowsapp OnsenWindowsTest</pre><p>We just created a project called OnsenWindowsTest, which has id io.onsen.windowsapp, inside the folder test.</p><p>Next step is to add the Windows platform to our project. To do it, just navigate inside the folder test and execute:</p><pre>cordova platform add windows</pre><p>Now we have two ways about how to develop our Cordova app:</p><ul><li><strong>With Microsoft Visual Studio</strong>: go in platforms/windows/ and open the file CordovaApp.sln. It’s the Microsoft Visual Studio project that have been automatically created after we added the platform.</li><li><strong>With another editor</strong>: open the index.html file in the www/ directory.</li></ul><p>In this tutorial, we will use the first way so we suggest you, if it’s the first time that you develop a Cordova app for Windows platform, to do the same.</p><p>The project covers two categories of apps: Windows Phone 8.1 and Windows 8.1 apps. We are just interested in Windows Phone 8.1 development, so all the changes we will make will be applied on CordovaApp.Phone (Windows Phone 8.1). To set it as a target, just right-click on it and select Set as StartUp project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*d-2ecz2_D_p4Tihi.png" /></figure><p>Open the Onsen UI template that you downloaded previously, select the www folder and drag it to CordovaApp.Phone (Windows Phone 8.1). Overwrite the old files, we will not need them anymore in this tutorial. <br> The main page, loaded at the execution of the app, is index.html, situated in the www folder. Opening it, you will notice that it contains our Onsen UI template.</p><p>If we now try to execute the app, we will get the following error:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/559/0*we2rYoSIzawbB7Yp.png" /></figure><p>We can fix this by adding ng-csp=&quot;&quot; in the HTML tag.</p><pre>&lt;html lang=&quot;en&quot; ng-app=&quot;app&quot; ng-csp=&quot;&quot;&gt;</pre><p>The ngCsp directive enables <a href="https://developer.mozilla.org/en-US/docs/Web/Security/CSP">Content Security Policy (CSP)</a> support for AngularJS. <br> Since Windows apps prevent the WebView from using eval or function(string) generated functions, ngCsp will cause Angular to evaluate all expressions.</p><p>Now our Onsen UI sample app compatible with Windows Phone 8.1 is ready! Let’s see how we can debug it.</p><h3>Debugging</h3><p>To debug our app, we just need to select the target, which can be a physical device or an emulator, and simply launch it. The app will be automatically loaded and displayed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Aa0zNc-v_3YsAbuE.png" /></figure><p>The are three main debugging features that we can use to test our application:</p><ul><li><strong>Breakpoints</strong>: we can interrupt the execution of our app at any point and check the resources values.</li><li><strong>JavaScript Console</strong>: we can use the JavaScript Console window to interact with and debug apps built using JavaScript. It can be enabled, once the debug has been executed, from DEBUG-&gt;Windows-&gt;JavaScript Console. For more information about this feature, take a look at <a href="https://msdn.microsoft.com/en-us/library/windows/apps/dn688631.aspx">this page</a>.</li><li><strong>DOM Explorer</strong>: this is probably the killing feature of Microsoft Visual Studio, for what concerns the development of hybrid apps. With the interactive debugging model provided by the DOM inspection tools, we can view and modify the rendered HTML and CSS code, without stopping and restarting the debugger. It can be enabled, once the debug has been executed, from DEBUG-&gt;Windows-&gt;DOM Explorer. For more information about this feature, take a look at <a href="https://msdn.microsoft.com/en-us/library/windows/apps/hh441474.aspx">this page</a>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/0*r4pKRpqA_baZmKKW.png" /></figure><h3>Deployment</h3><p>Once our application is ready, we can deploy it on our device (or emulator) in two ways:</p><ul><li><strong>Using Microsoft Visual Studio</strong>: this is the easiest solution. We just need, as for the debugging, to select the target device and to switch the Debug option in Release. We can also, optionally, choose the CPU for wich your app will be compatible. At this point, just by launching the procedure, the app will be automatically installed on the target device.</li><li><strong>Using command line</strong>: this procedure is recommended in case you have developed your application with another editor. Open the terminal and navigate in the root directory of the project, then execute:</li></ul><pre># deploy app to Windows Phone 8.1 emulator<br>cordova run windows -- --phone <br># deploy app to connected device<br>cordova run windows --device -- --phone</pre><blockquote><strong><em>ATTENTION</em></strong>: if you have developed your app using Microsoft Visual Studio, but you want to deploy it using the command line, copy the content of platforms/windows/www/ inside the www/ folder situated in the root project directory, otherwise all the content will be overwritten once the app is deployed!</blockquote><h3>Conclusion</h3><p>Have you seen how easy is to develop hybrid apps, compatible with Windows Phone 8.1, using Onsen UI?!</p><p>If you are new to Onsen UI, you can take a look at these guides (<a href="http://onsen.io/blog/developing-hybrid-mobile-apps-with-onsen-ui/">link1</a> — <a href="http://onsen.io/blog/onsen-ui-google-maps-javascript-api-v3-angularjs-sample-application/">link2</a>), or at our <a href="http://onsen.io/">website</a> and <a href="http://onsen.io/blog/">blog</a>. These resources will, for sure, help you to expand your app. If you have already used Onsen UI in the past, then, express all your creativity!</p><p>The purpose of this tutorial was to explain all the phases of developing an app compatible with Windows platform, now is your turn to apply your knowledge and create hybrid apps that are compatible with all the major platforms available on the market.</p><p>Show us what you can do, we are always available to support you!</p><p><em>Originally published at </em><a href="http://onsen.io/blog/windows-phone-8-1-tutorial/"><em>onsen.io</em></a><em> on April 14, 2015.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ba6fde7fcb56" width="1" height="1" alt=""><hr><p><a href="https://medium.com/the-web-tub/tutorial-create-a-sample-app-with-windows-phone-8-1-and-onsen-ui-ba6fde7fcb56">Tutorial: create a sample app with Windows Phone 8.1 and Onsen UI</a> was originally published in <a href="https://medium.com/the-web-tub">The Web Tub</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Increase your Productivity with the Onsen UI Extension for Brackets!]]></title>
            <link>https://medium.com/the-web-tub/increase-your-productivity-with-the-onsen-ui-extension-for-brackets-c23cb5292b6b?source=rss-e639ea26b32e------2</link>
            <guid isPermaLink="false">https://medium.com/p/c23cb5292b6b</guid>
            <category><![CDATA[onsen-ui]]></category>
            <category><![CDATA[brackets]]></category>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Andi Pavllo]]></dc:creator>
            <pubDate>Mon, 30 Mar 2015 12:00:00 GMT</pubDate>
            <atom:updated>2017-09-26T03:40:11.837Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/380/0*LRwbM8pyPV3ki5Qb.png" /></figure><p>Onsen UI 1.3 release date is everyday closer. That’s why, while you are waiting for it, we would like to announce that the Onsen UI extension for Brackets is now available and can be downloaded at <a href="http://www.onsenuibrackets.com/">www.onsenuibrackets.com</a>! Thanks to <a href="https://twitter.com/ChrisGriffith">Chris Griffith</a>, the developer of this extension, we now have code hinting for most of the Onsen UI framework attributes and directives.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/625/0*oBl3EiefdAwew4-E.png" /></figure><p>For those that don’t know what <a href="http://brackets.io/">Brackets</a> is, don’t worry, we can give you a fast overview. Brackets is an open source code editor developed by Adobe and released at the end of 2014. Its source code can be found on <a href="https://github.com/adobe/brackets">GitHub</a> and it’s available for Linux, Mac and Windows. Because it’s written in HTML, CSS and JavaScript, it’s totally customizable.</p><p>The two main features of Brackets are:</p><ul><li><strong>Quick Edit</strong></li><li>Enables inline editing of CSS, Color Property, and JavaScript elements for developers. This built-in feature can be applied to multiple functions or properties simultaneously and all updates are applied directly to the file associated with the changed elements.</li><li><strong>Live Preview</strong></li><li>Using it, Brackets pushes code edits instantly to the browser to present an updated page without having to reload.</li></ul><p>So, what are you waiting for?! Try the extension and let us know what do you think about it!</p><p><em>Originally published at </em><a href="http://onsen.io/blog/increase-your-productivity-with-the-onsen-ui-extension-for-brackets/"><em>onsen.io</em></a><em> on March 30, 2015.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c23cb5292b6b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/the-web-tub/increase-your-productivity-with-the-onsen-ui-extension-for-brackets-c23cb5292b6b">Increase your Productivity with the Onsen UI Extension for Brackets!</a> was originally published in <a href="https://medium.com/the-web-tub">The Web Tub</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Creating Google Maps Sample App with AngularJS and Onsen UI]]></title>
            <link>https://medium.com/the-web-tub/creating-google-maps-sample-app-with-angularjs-and-onsen-ui-c1325139781e?source=rss-e639ea26b32e------2</link>
            <guid isPermaLink="false">https://medium.com/p/c1325139781e</guid>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[angularjs]]></category>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[google-maps]]></category>
            <category><![CDATA[onsen-ui]]></category>
            <dc:creator><![CDATA[Andi Pavllo]]></dc:creator>
            <pubDate>Thu, 19 Feb 2015 12:00:00 GMT</pubDate>
            <atom:updated>2017-12-08T00:22:40.856Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/913/0*8LhWk9yGcQUTZFI-.png" /></figure><p>This sample application has the purpose of demonstrating how to combine elements of <a href="http://onsen.io/">Onsen UI</a>, a framework for creating hybrid HTML5 apps, <a href="https://angularjs.org/">AngularJS</a>, a JavaScript framework developed by <a href="https://www.google.com/">Google</a>, and <a href="https://developers.google.com/maps/documentation/javascript/">Google Maps JavaScript API v3</a>.</p><p><em>****Please note that this article was written in 2015. Onsen UI released its version 2 in October 2016 and many things have changed since then. If you are interested in map integration to your cordova app, also check out more recent </em><a href="https://medium.com/the-web-tub/choosing-the-right-map-integration-for-your-cordova-app-78c2a8f75d50"><em>article</em></a><em> by Andi.****</em></p><p>This application has been developed using <a href="https://monaca.io/">Monaca</a>, a cloud based mobile app development environment that supports iOS/Android/Windows 8 hybrid apps in one source. The benefit of using <a href="https://monaca.io/">Monaca</a> to develop this sample application is dictated by the fact that this product provides a native support for <a href="http://onsen.io/">Onsen UI</a>, default templates and user-friendly development environment that allows developers to skip the installation and configuration of the frameworks used in this project.</p><p>The features implemented in this application are quite simple: the purpose is not to create a large application with complicated features, but to create a template which can be extended in the future. That’s why some elements, like the search bar and the settings page, have only been implemented without offering any real functionality, but, at the same time, are ready to be associated with any behaviour the programmer wishes to implement.</p><p><a href="https://andipavllo.github.io/Google-Maps-Onsen-UI-Sample/www/index.html">https://andipavllo.github.io/Google-Maps-Onsen-UI-Sample/www/index.html</a></p><p>The implemented features are:</p><ul><li>Add Marker, via screen long press</li><li>Delete single Marker, via screen press (on the Marker)</li><li>Delete all Markers, via &lt;ons-button&gt;</li><li>Calculate the distance (partial and total) between the Markers, via &lt;ons-button&gt;</li><li>Menu, via &lt;ons-sliding-menu&gt;</li></ul><p>The main interface consists of an &lt;ons-sliding-menu&gt; associated with two pages: map.html and settings.html. The first one will contain the map element and Onsen UI elements like &lt;ons-button&gt;. The user is free to navigate between these two pages using the sliding menu element.</p><p>You can try the app using the sample above, or directly from the browser by clicking <a href="http://andipavllo.github.io/Google-Maps-Onsen-UI-Sample/www/index.html">here</a>. The code is also available on GitHub at this <a href="https://github.com/andipavllo/Google-Maps-Onsen-UI-Sample">link</a>.</p><p>Except the HTML content illustrated above, the application contains two other key elements: controller.js and style.css.</p><h3>Controllers</h3><p>The controllers contain the logic of the application. To build this app we need two controllers, one for the management of the ons-sliding-menu and one for the map interaction. Both controllers can be found in the file controller.js.</p><h4>SlidingMenuController</h4><p>One of the biggest trouble of having a ons-sliding-menu element and a Google Map element is that both have an event associated with the scroll action, in this case the horizontal one. That’s why is it is mandatory for creation of a controller to adapt the behaviour of the sliding menu swipe functionality to the current situation. Adding a listener on the element that controls every time a &#39;postopen&#39; or &#39;postclose&#39; event is triggered is the way to fix this issue. The sliding menu swipe functionality is disabled by default, it will be enabled only after the menu is opened from a ons-toolbar-button click and will be available only until the menu is closed, via swipe or again via ons-toolbar-button. The listener is created after the first time the sliding menu has been opened.</p><h4>MapController</h4><p>This controller contains all the logic related to the map object and the interactions with the Onsen UI elements. The first step is the declaration of the Markers array, which will be used later, and of the map element. To initialize the map we had to use AngularJS’s timer service $timeout and put a delay of <strong>100ms</strong> before the map’s initialization. This step is necessary because AngularJS’s controller initialization occur before the <strong>DOM</strong> is loaded.</p><p>After the map is loaded, it is necessary to add a listener related to the hard press event, which is associated with adding a new Marker. To implement this feature we have used the library <a href="http://hammerjs.github.io/">Hammer.JS</a>, which is natively included in Onsen UI.</p><p>After the map’s initialization occurred, the user is free to perform the basic implemented features that were listed before. Each one of these features is associated with a method, more precisely $scope.addOnClick(), $scope.deleteAllMarkers() and $scope.calculateDistance().</p><p>The first method, $scope.addOnClick(), is associated with the listener that was introduced above. First of all it takes the X and Y value of the hardclicked/hardpressed point on the screen and try to convert it in latitude and longitude coordinates. This step is necessary because the points displayed on <strong>Google Maps</strong> are encoded with this format. To perform this action, we use the function:</p><pre>$scope.overlay.getProjection().fromContainerPixelToLatLng(point);</pre><p>It is important to consider that the coordinates origin will start from the top-left point of the div when the map is contained, and not from the top-left of the device’s screen. That’s why, when we take the Y coordinate, we have to decrease is by (-) 44px, since 44px is the height of the &lt;ons-toolbar&gt; element which is situated on the top of the screen. After the coordinates conversion, our marker is ready to be added in the markers array and to be displayed on the map.</p><p>At this point it is necessary to create a listener associated with the click/press event on one of the markers. If a marker will be pressed, a ons.notification.confirm element will appear, asking the user if he wants to delete the marker. Based on the user’s choice, the relative action will be executed and an ons.notification.alert element will be displayed.</p><p>The method $scope.deleteAllMarkers() is very simple: it just scans the marker’s array and deletes any marker from the map. At the end, it deletes all the elements from the array and initialize the index variable to its initial value.</p><p>The last method is $scope.calculateDistance(), which calculates the distance from two or more markers on the map, using a formula that can easily be found on the web. To perform this operation, we don’t need to perform any conversion, as we did before, because the coordinates are expressed with the same encoding elaborated by the formula. After the elaboration is over, a ons.notification.confirm element will ask the user if he also wants to see the partial distances between the markers. The results of this choice will be again displayed with a ons.notification.alert element.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/104819a7d2d92cd6575b7023061f84f5/href">https://medium.com/media/104819a7d2d92cd6575b7023061f84f5/href</a></iframe><h3>CSS</h3><p>Beyond the default <strong>CSS sheet</strong> provided by Onsen UI, it’s necessary to define new style properties of the <strong>DOM</strong> elements. The content of the CSS can be found in style.css. The main purpose of this sheet is to dispose in a proper way the elements of the Google Maps JavaScript API v3 and of Onsen UI. A full fusion is not possible because of the differences between the two products, that’s why it is necessary to define two layers in which the different elements to display.</p><p>The lower layer will contain the Google Maps elements, like the map and the markers, meanwhile the upper layer will contain Onsen UI elements. This action has been performed mainly thanks to the z-indexproperty: assigning a lower z-index value to the maps elements will push them in a lower level than the Onsen UI elements, which have a higher value.</p><p>It is very important to specify the position of Onsen UI’s elements correctly, as to not overlap them on Google Maps’s ones. It’s also very important to consider the resolution of the screen to position the elements correctly. Also the element’s size is very important, for example a div that is too big will overlay the map, making impossible any interaction with it.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/eba3f76e7aaf08cdea001f96580f4d28/href">https://medium.com/media/eba3f76e7aaf08cdea001f96580f4d28/href</a></iframe><h3>HTML</h3><p>The application is organized into four pages: index.html, menu.html, map.html and settings.html (which will not be described). Each one of these pages is a combination of HTML, Onsen UI and AngularJS elements. The structure of the application is based on Onsen’s Sliding Menu template that can be found as a pre-made template in <a href="https://monaca.io/">Monaca</a>. I chose this template because it seemed to me the most appropriate one, but nothing prohibits you from using another one that adapts better to your idea of the organization of the DOM.</p><h4>index.html</h4><p>This is, of course, the main page of the application, the one loaded by default. Just after the HTML opening tag, we can find ng-app=&quot;myApp&quot;, the directive used to auto-bootstrap an AngularJS application. This directive designates the root element of the application and is typically placed near the root element of the page - e.g. on the &lt;body&gt; or &lt;html&gt; tags.</p><p>After the scripts and css sheets inclusion, we need to include a <strong>Google Map Key Script</strong> in our application, in order to be able to display the map content. To be honest, from the last version of <a href="https://developers.google.com/maps/documentation/javascript/">Google Maps JavaScript API</a>, a key is no more mandatory, but is highly recommended in order to monitor your data usage and purchase additional data quota. You can find additional information about how to obtain a <strong>free Google Maps API Key</strong> at this <a href="https://developers.google.com/maps/documentation/javascript/tutorial#api_key">link</a>.</p><p>The tag to include, in order to display the map, is:</p><pre>&lt;script type=&quot;text/javascript&quot;     <br>        src=&quot;https://maps.googleapis.com/maps/api/js&quot;&gt;<br>&lt;/script&gt;</pre><p>At this point we can analyze the body content. As you can see, inside the body there is only an &lt;ons-sliding-menu&gt; element. It is the root of all the Onsen UI’s elements in the application and is characterized by some attributes as var=&quot;slidingMenu&quot;, which is used for the <strong>two way data binding</strong> inside AngularJS, menu-page=&quot;menu.html&quot; which is the page that contains the HTML of the sliding menu, and main-page=&quot;map.html&quot;, which is the main page displayed by default. Furthermore, the menu, as explained before, is set by default as unswipeable by the attribute swipeable=&quot;false&quot;.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/87e10924f6d0f1089889906fdd913aa0/href">https://medium.com/media/87e10924f6d0f1089889906fdd913aa0/href</a></iframe><h4>menu.html</h4><p>This page contains the auto generated code for the &lt;ons-sliding-menu&gt; element. Inside we can find a &lt;ons-list&gt; with two &lt;ons-list-item&gt; which contain the redirect at map.html and settings.html. In case you want to add more pages inside the application, it’s necessary to create new items to permit an easy navigation of the app content.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2e1b1c8ac7bb4f7389eca80a085f4dea/href">https://medium.com/media/2e1b1c8ac7bb4f7389eca80a085f4dea/href</a></iframe><h4>map.html</h4><p>This is probably the most important page of the application, the one that contains the map and most of the Onsen UI’s elements. At the top of it, we can find the declaration of the controller ng-controller=&quot;MapController&quot;. Considering that the controller is declared on the root element, its visibility will be extended to each element of the page.</p><p>Immediately above it, we can find a &lt;ons-toolbar&gt; element, which contains the title of the page and an &lt;ons-toolbar-button&gt; which is designed to open and close the sliding menu. For this reason, inside the &lt;ons-toolbar&gt; is placed another controller declaration, precisely ng-controller=&quot;SlidingMenuController&quot;.</p><p>The rest of the code is the one that displays the map, the search bar and the two &lt;ons-button&gt;.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/31d045a42f78fe2043a93ab1ede55a51/href">https://medium.com/media/31d045a42f78fe2043a93ab1ede55a51/href</a></iframe><h3>Conclusion</h3><p>In this tutorial, you have learned how to create an application using Onsen UI, Google Maps JavaScript API v3 and AngularJS. You now have a basic layout to customize as you wish. Just remember that a lot of features are already provided by Google Maps API, so check them out before trying to implement all by yourself.</p><p><em>Originally published at </em><a href="http://onsen.io/blog/onsen-ui-google-maps-javascript-api-v3-angularjs-sample-application/"><em>onsen.io</em></a><em> on February 19, 2015.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c1325139781e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/the-web-tub/creating-google-maps-sample-app-with-angularjs-and-onsen-ui-c1325139781e">Creating Google Maps Sample App with AngularJS and Onsen UI</a> was originally published in <a href="https://medium.com/the-web-tub">The Web Tub</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>