26
Introduction to Hybrid Application Development Presented by: Kunjan Thakkar

Introduction to hybrid application development

Embed Size (px)

Citation preview

Page 1: Introduction to hybrid application development

Introduction to Hybrid Application

Development

Presented by: Kunjan Thakkar

Page 2: Introduction to hybrid application development

Who am I?

• Sr. Developer @ Synerzip Softech• 5+ years of development experience

• Mobile Application development in Android, J2ME, Blackberry

• Web development using Javascript, HTML5, AngularJS, Polymer

• Current interests: Hybrid application development• Contact

[email protected]• LinkedIn https://in.linkedin.com/in/kunjan-thakkar-

4199b129

Page 3: Introduction to hybrid application development

What are hybrid applications?

• A hybrid application is basically a native application with embedded HTML

• It has all the benefits of native apps like full access to APIs, app-store presence, etc.

• Selected portions of the app are written using web technologies.

Page 4: Introduction to hybrid application development

Skills needed for hybrid apps

All hybrid applications are based on javascript. They might be based on some specific javascript technologies like jquery/angularjs

Page 5: Introduction to hybrid application development

Are native apps not good enough?

Page 6: Introduction to hybrid application development

They bring the best of native and web apps

Page 7: Introduction to hybrid application development

Few of the many hybrid app frameworks

Page 8: Introduction to hybrid application development

What have we explored so far?

Page 9: Introduction to hybrid application development

Phonegap

• Phonegap is a mobile application development framework. It enables developers to build applications for mobile devices using Javascript, HTML5 and CSS3 instead of relying on platform specific APIs in IOS/Android/Windows Phone.

• Although the applications are developed using HTML, CSS and Javascript, the end product is a binary that can be distributed through the respective ecosystems.

• Phonegap was created by Nitobi and Adobe acquired it in 2011.

Page 10: Introduction to hybrid application development

Cordova

• The core engine for Phonegap is 100% open source under the Apache Cordova project.

• Cordova is the engine that powers Phonegap. It bridges the gap between Javascript, HTML5 and native.

• The hybrid application would run in a web browser view that takes up 100% device height and 100% device width.

• The web view used by the application is the same web view used by the native operating system.   • On iOS, this is the Objective-C UIWebView class• On Android, this is android.webkit.WebView.

Page 11: Introduction to hybrid application development

Cordova

• When an application is created using cordova, it creates a skeleton for the native app

• For eg: For an android application, it would create a manifest file and a main activity to launch the application. The main activity would then initialize the WebView class where your javascript loads

• This means you get access to the generated code base in native as well. You could add any special permissions that you want for a particular platform, in case they are unavailable through config.xml

Page 12: Introduction to hybrid application development

Jquery Mobile

• Build on popular jquery library and uses cordova• Easy access to DOM• Shallower learning curve as compared to other

hybrid frameworks• Several built-in widgets like page, panel, etc• You can create your own theme using theme

roller.• AJAX calls are made automatically to load

dynamic content.• Rich set of third party plugins• [Demo]

Page 13: Introduction to hybrid application development

Mobile angular UI

• Based on AngularJS and Bootstrap. Uses cordova• Several built-in components like switches,

overlays, sidebars, absolute positioned navigation bars.

• Works seamlessly from mobile to desktop and back

• No dependencies on jquery or bootstrap.js• Internally uses bootstrap to provide

responsiveness• Font awesome ions are included by default in

place of glyphicons• [Demo]

Page 14: Introduction to hybrid application development

Ionic

• Built with Sass and optimized for AngularJS. Uses cordova

• Built-in app templates help you get started in minutes

• Its native focussed - same code but renders differently on different OS giving the application a more native feel

• Uses templating which reduces code bloat. • Minimal DOM manipulation• No dependencies on jquery• Hardware accelerated transitions• [Demo]

Page 15: Introduction to hybrid application development

Introduction to Appery.io

• Appery.io is a cloud-based platform that provides UI development tools and integrated backend services.

• It uses bootstrap for responsiveness and cordova for building the application

• It gives you a choice of the UI framework you want to work with. You could create an application using Jquery mobile/mobile angular UI/Ionic

• Appery has built in support for backend/databases/push notifications.

• The created application has some commonly used cordova plugins like google analytics pre-installed. Also you can install any other cordova plugin easily.

Page 16: Introduction to hybrid application development

Appery.io framework

Page 17: Introduction to hybrid application development

How does the hybrid application work?

Page 18: Introduction to hybrid application development

What if I need to access some native functionality

thats not currently supported?

• A plugin is a bit of add-on code that provides JavaScript interface to native components.

• It allows the Cordova webview within which the app renders to communicate with the native platform on which it runs.

• These are some plugins created by developers - http://cordova.apache.org/plugins/

Page 19: Introduction to hybrid application development

Plugin.xml

Page 20: Introduction to hybrid application development

Why I should I go for a hybrid application(I)?

• One code runs everywhere - all mobile platforms as well desktops. Hybrid applications are cross-platform, which saves you money and time (which saves you even more money ;))

• Time to market is comparatively less• Consistent UI throughout all platforms which is tricky

to achieve with native apps.• CSS is powerful! You can customize almost anything

right from headers to switches to transitions. Several UI frameworks now have built-in transitions which are hardware accelerated giving your users a smooth experience.

Page 21: Introduction to hybrid application development

Why I should I go for a hybrid application(II)?

• Need to access some native APIs? Write a plugin :) Hybrid apps give you benefits of javascript and native both. You get access of native and power of javascript.

• You can make use of the powerful javascript libraries that are at our disposal for eg: gmaps.js which supports geolocation and several other map features. On native you might have to implement these by yourself. And the list is endless ..

Page 22: Introduction to hybrid application development

Some examples of hybrid applications

Page 23: Introduction to hybrid application development

So what do I use and when?

Jquery Mobile Mobile angular UI Ionic

Supports all mobile devices and all desktop browsers

Supports all mobile devices and all desktop browsers

Supports android and ios. Minimal windows phone support. No guaranteed support for browsers

Well suited for simple applications. Not well suited for applications having complex UI/DOM manipulations

Well suited for applications that require binding and have complex UI

Well suited for applications that require binding and have complex UI

UI appears similar on all devices. However, can be configured using device type checks

UI appears similar on all devices. However, can be configured using device type checks

Native focussed. Same code renders differently on different OS giving the application a more native feel

Create your own theme using theme roller

Themes can be created using css Themes can be created using css

Page 24: Introduction to hybrid application development

No built in responsiveness. Need to include third party libraries for it.

Uses Bootstrap3 internally for responsiveness

Offers built in responsive grid support

Performance can degrade for complex applications

Performance is better than JQM, however, not as smooth as ionic

Excellent performance and speed on native devices.

Limited built in transitions Limited built in transitions Several built in hardware accelerated transitions

No built in app templates. No built in app templates. However, the application created contains a rich bunch of samples.

Built in app templates get you started in minutes

Executable needs to be distributed manually if you do not want to upload it on app store

Executable needs to be distributed manually if you do not want to upload it on app store

You can use the Ionic View app to share your application with selected users without uploading it to app store

Page 25: Introduction to hybrid application development

Questions?

Page 26: Introduction to hybrid application development

Thank You