SlideShare une entreprise Scribd logo
1  sur  11
Step by Step Guide
to build Ionic Hybrid App using
Cordova/Android
By Swagat Parida
Introduction
This tip will guide in developing a basic app Hybrid Mobile App using Ionic, Cordova, Android.
Background
There is a lot of curiosity among developers regarding emerging ionic framework along
with Cordova. Ionic library is built by considering AngularJS as its base. This framework provides mobile-
optimized HTML components to create highly interactive hybrid apps.
Reference: Ionic site for more details.
The below steps/code will help in developing a basic Ionic-Cordova app and showcase a simple grouped list
view.
Environment Setup and App Creation
NodeJS
Before we start on any development, NodeJS installation is important. Click here to download NodeJS.
Ionic & Cordova
The below command should install all related modules and dependencies for ionic and Cordova.
$ C:Program Files (x86)nodejs>npm install -g cordova ionic
Verify ionic by typing the below command:
$ C:Program Files (x86)nodejs>ionic
and the result should show:
Create An App
Use the below command to create an ionic cordova app:
C:Program Files (x86)nodejs>ionic start sampleApp blank
And the result will be as shown below:
Generate Android Code for the Above Ionic App
After creating blank ionic app, it is necessary to generate the required platform [Android/iOS/Windows]. And it
generates respective app code directories.
Generate Android app as below:
C:Program Files (x86)nodejs>cd sampleApp
C:Program Files (x86)nodejssampleApp>ionic platform add android
And the result should be as below:
And, app creation is done!!
Import Into Android Studio
Let's dive into the folder structure of ionic app creation. Go to NodeJS directory and the below screenshot would
help in understanding the structure:
In platforms, there are three folders as I tried creating for all three OS platforms. Now, the same path must be used
to import the Android app into Android Studio.
Once it is imported, it would generate the Gradle scripts
and app will have three modules.
Create a Sample Ionic List View
Let's start with designing our list view. Go to index.html file to understand the js structures.
app.js is the most important file which initializes the complete app. List view should look like below:
And controller should look like:
The complete code can be downloaded from: https://github.com/swagatblog/AndroidIonicCordova.
References
https://nodejs.org/
http://ionicframework.com/docs/guide/installation.html
https://cordova.apache.org/docs/en/4.0.0/
https://github.com/swagatblog/AndroidIonicCordova
??
?
?
?
?
? ?
?
?
?
??
?
?
?
?
?
Please contact
Swagat Parida

Contenu connexe

Tendances

MDC2011 Android_ Webdriver Automation Test
MDC2011 Android_ Webdriver Automation TestMDC2011 Android_ Webdriver Automation Test
MDC2011 Android_ Webdriver Automation Test
Masud Parvez
 
Android installation
Android installationAndroid installation
Android installation
Durai S
 

Tendances (20)

MDC2011 Android_ Webdriver Automation Test
MDC2011 Android_ Webdriver Automation TestMDC2011 Android_ Webdriver Automation Test
MDC2011 Android_ Webdriver Automation Test
 
Methods to set up android app development environment
Methods to set up android app development environmentMethods to set up android app development environment
Methods to set up android app development environment
 
IONIC - Hybrid Mobile App Development
IONIC - Hybrid Mobile App DevelopmentIONIC - Hybrid Mobile App Development
IONIC - Hybrid Mobile App Development
 
Android studio installation
Android studio installationAndroid studio installation
Android studio installation
 
Getting started with Appcelerator Titanium
Getting started with Appcelerator TitaniumGetting started with Appcelerator Titanium
Getting started with Appcelerator Titanium
 
Android course (lecture2)
Android course (lecture2)Android course (lecture2)
Android course (lecture2)
 
Hello android example.
Hello android example.Hello android example.
Hello android example.
 
How to create a local Android open source project mirror in 6 easy steps
How to create a local Android open source project mirror in 6 easy stepsHow to create a local Android open source project mirror in 6 easy steps
How to create a local Android open source project mirror in 6 easy steps
 
Ng2 cli
Ng2 cliNg2 cli
Ng2 cli
 
Introduction to Appcelerator Titanium
Introduction to Appcelerator TitaniumIntroduction to Appcelerator Titanium
Introduction to Appcelerator Titanium
 
Windows Universal Apps
Windows Universal AppsWindows Universal Apps
Windows Universal Apps
 
State ofappdevelopment
State ofappdevelopmentState ofappdevelopment
State ofappdevelopment
 
Android installation
Android installationAndroid installation
Android installation
 
Deployment options for mule applications
Deployment options for mule applicationsDeployment options for mule applications
Deployment options for mule applications
 
From Zero to Docker
From Zero to DockerFrom Zero to Docker
From Zero to Docker
 
Android Studio vs. ADT
Android Studio vs. ADTAndroid Studio vs. ADT
Android Studio vs. ADT
 
Windows Universal Apps
Windows Universal AppsWindows Universal Apps
Windows Universal Apps
 
Android Application Development for Beginners
Android Application Development for BeginnersAndroid Application Development for Beginners
Android Application Development for Beginners
 
Tomáš Kohout: Jak zrychlit iOS vývoj pomocí Swift playgoundů
Tomáš Kohout: Jak zrychlit iOS vývoj pomocí Swift playgoundůTomáš Kohout: Jak zrychlit iOS vývoj pomocí Swift playgoundů
Tomáš Kohout: Jak zrychlit iOS vývoj pomocí Swift playgoundů
 
CI & CD- mobile application
CI & CD- mobile applicationCI & CD- mobile application
CI & CD- mobile application
 

En vedette

Generos del Cine con Norma Apa
Generos del Cine con Norma ApaGeneros del Cine con Norma Apa
Generos del Cine con Norma Apa
Stephanie Pinzón
 
Mi infografia greidy añez
Mi infografia greidy añezMi infografia greidy añez
Mi infografia greidy añez
GREIDY01
 

En vedette (20)

Mobile app architectures
Mobile app architecturesMobile app architectures
Mobile app architectures
 
La montaña 15 marzo 2017 papà
La montaña 15 marzo 2017   papàLa montaña 15 marzo 2017   papà
La montaña 15 marzo 2017 papà
 
How to build your own Hybrid JS Interface with Android?
How to build your own Hybrid JS Interface with Android?How to build your own Hybrid JS Interface with Android?
How to build your own Hybrid JS Interface with Android?
 
Valvular heart disease kay johnstone
Valvular heart disease   kay johnstoneValvular heart disease   kay johnstone
Valvular heart disease kay johnstone
 
Generos del Cine con Norma Apa
Generos del Cine con Norma ApaGeneros del Cine con Norma Apa
Generos del Cine con Norma Apa
 
Building Mobile Apps with Cordova , AngularJS and Ionic
Building Mobile Apps with Cordova , AngularJS and IonicBuilding Mobile Apps with Cordova , AngularJS and Ionic
Building Mobile Apps with Cordova , AngularJS and Ionic
 
architecture of mobile software applications
architecture of mobile software applicationsarchitecture of mobile software applications
architecture of mobile software applications
 
Hybrid Apps with Angular & Ionic Framework
Hybrid Apps with Angular & Ionic FrameworkHybrid Apps with Angular & Ionic Framework
Hybrid Apps with Angular & Ionic Framework
 
Ionic - Hybrid Mobile Application Framework
Ionic - Hybrid Mobile Application FrameworkIonic - Hybrid Mobile Application Framework
Ionic - Hybrid Mobile Application Framework
 
Ionic Hybrid Mobile Application
Ionic Hybrid Mobile ApplicationIonic Hybrid Mobile Application
Ionic Hybrid Mobile Application
 
러쉬파퍼『 http://x5.ana.kr 』 톡 w2015 ♡ 러쉬파퍼판매, 러쉬파퍼효과,러쉬파퍼정품구입,러쉬파퍼부작용,러쉬파퍼지속시간
러쉬파퍼『 http://x5.ana.kr  』 톡 w2015 ♡ 러쉬파퍼판매, 러쉬파퍼효과,러쉬파퍼정품구입,러쉬파퍼부작용,러쉬파퍼지속시간러쉬파퍼『 http://x5.ana.kr  』 톡 w2015 ♡ 러쉬파퍼판매, 러쉬파퍼효과,러쉬파퍼정품구입,러쉬파퍼부작용,러쉬파퍼지속시간
러쉬파퍼『 http://x5.ana.kr 』 톡 w2015 ♡ 러쉬파퍼판매, 러쉬파퍼효과,러쉬파퍼정품구입,러쉬파퍼부작용,러쉬파퍼지속시간
 
Manual de redes. equipo 5
Manual de redes. equipo 5Manual de redes. equipo 5
Manual de redes. equipo 5
 
러브젤『 http://x5.ana.kr 』 톡 w2015 ♡ 러브젤판매,러브젤약효,러브젤구입처,러브젤구매처,러브젤파는곳
러브젤『 http://x5.ana.kr  』 톡 w2015 ♡ 러브젤판매,러브젤약효,러브젤구입처,러브젤구매처,러브젤파는곳러브젤『 http://x5.ana.kr  』 톡 w2015 ♡ 러브젤판매,러브젤약효,러브젤구입처,러브젤구매처,러브젤파는곳
러브젤『 http://x5.ana.kr 』 톡 w2015 ♡ 러브젤판매,러브젤약효,러브젤구입처,러브젤구매처,러브젤파는곳
 
Proc. nivelacion alineamiento y verticalidad
Proc. nivelacion alineamiento y verticalidadProc. nivelacion alineamiento y verticalidad
Proc. nivelacion alineamiento y verticalidad
 
Ionic CLI Adventures
Ionic CLI AdventuresIonic CLI Adventures
Ionic CLI Adventures
 
Mobile HTML5 websites and Hybrid Apps with AngularJS
Mobile HTML5 websites and Hybrid Apps with AngularJSMobile HTML5 websites and Hybrid Apps with AngularJS
Mobile HTML5 websites and Hybrid Apps with AngularJS
 
Ionic 2 intro
Ionic 2   introIonic 2   intro
Ionic 2 intro
 
Ionic Framework
Ionic FrameworkIonic Framework
Ionic Framework
 
Mi infografia greidy añez
Mi infografia greidy añezMi infografia greidy añez
Mi infografia greidy añez
 
La montaña 9 giugno 2016 il mio angelo
La montaña 9 giugno 2016   il mio angeloLa montaña 9 giugno 2016   il mio angelo
La montaña 9 giugno 2016 il mio angelo
 

Similaire à Step by step guide to build ionic hybrid app using cordova android

iOS & Android Application Development - Pee Dee User Group Meeting
iOS & Android Application Development - Pee Dee User Group MeetingiOS & Android Application Development - Pee Dee User Group Meeting
iOS & Android Application Development - Pee Dee User Group Meeting
Jim Tochterman
 
Mobile os by waqas
Mobile os by waqasMobile os by waqas
Mobile os by waqas
8neutron8
 
Hybrid Mobile Apps - Meetup
Hybrid Mobile Apps - MeetupHybrid Mobile Apps - Meetup
Hybrid Mobile Apps - Meetup
Sanjay Patel
 

Similaire à Step by step guide to build ionic hybrid app using cordova android (20)

Ionic2 First Lesson of Four
Ionic2 First Lesson of FourIonic2 First Lesson of Four
Ionic2 First Lesson of Four
 
Ionic
IonicIonic
Ionic
 
Ionic Framework
Ionic FrameworkIonic Framework
Ionic Framework
 
An overview of Ionic
An overview of IonicAn overview of Ionic
An overview of Ionic
 
Ionic framework
Ionic frameworkIonic framework
Ionic framework
 
Tutorial: Develop Mobile Applications with AngularJS
Tutorial: Develop Mobile Applications with AngularJSTutorial: Develop Mobile Applications with AngularJS
Tutorial: Develop Mobile Applications with AngularJS
 
iOS & Android Application Development - Pee Dee User Group Meeting
iOS & Android Application Development - Pee Dee User Group MeetingiOS & Android Application Development - Pee Dee User Group Meeting
iOS & Android Application Development - Pee Dee User Group Meeting
 
Headlessdrupalcordovaapp
HeadlessdrupalcordovaappHeadlessdrupalcordovaapp
Headlessdrupalcordovaapp
 
Mobile os by waqas
Mobile os by waqasMobile os by waqas
Mobile os by waqas
 
Workshop Ionic Framework - CC FE & UX
Workshop Ionic Framework - CC FE & UXWorkshop Ionic Framework - CC FE & UX
Workshop Ionic Framework - CC FE & UX
 
Hybrid Mobile Apps - Meetup
Hybrid Mobile Apps - MeetupHybrid Mobile Apps - Meetup
Hybrid Mobile Apps - Meetup
 
Final NEWS.pdf
Final NEWS.pdfFinal NEWS.pdf
Final NEWS.pdf
 
Final NewsApp.pdf
Final NewsApp.pdfFinal NewsApp.pdf
Final NewsApp.pdf
 
PhoneGap Application Development - Santhi J Krishnan
PhoneGap Application Development - Santhi J KrishnanPhoneGap Application Development - Santhi J Krishnan
PhoneGap Application Development - Santhi J Krishnan
 
Cross Platform Mobile Apps with the Ionic Framework
Cross Platform Mobile Apps with the Ionic FrameworkCross Platform Mobile Apps with the Ionic Framework
Cross Platform Mobile Apps with the Ionic Framework
 
Installing android sdk on net beans
Installing android sdk on net beansInstalling android sdk on net beans
Installing android sdk on net beans
 
Hybrid Apps in a Snap
Hybrid Apps in a SnapHybrid Apps in a Snap
Hybrid Apps in a Snap
 
Ionic Mobile Applications - Hybrid Mobile Applications Without Compromises
Ionic Mobile Applications - Hybrid Mobile Applications Without CompromisesIonic Mobile Applications - Hybrid Mobile Applications Without Compromises
Ionic Mobile Applications - Hybrid Mobile Applications Without Compromises
 
Common Ionic Development Mistakes Developers Tend To Make!
Common Ionic Development Mistakes Developers Tend To Make!Common Ionic Development Mistakes Developers Tend To Make!
Common Ionic Development Mistakes Developers Tend To Make!
 
MoSync Cross Platform mobile app development
MoSync  Cross Platform mobile app developmentMoSync  Cross Platform mobile app development
MoSync Cross Platform mobile app development
 

Dernier

Dernier (20)

Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 

Step by step guide to build ionic hybrid app using cordova android

  • 1. Step by Step Guide to build Ionic Hybrid App using Cordova/Android By Swagat Parida
  • 2.
  • 3. Introduction This tip will guide in developing a basic app Hybrid Mobile App using Ionic, Cordova, Android. Background There is a lot of curiosity among developers regarding emerging ionic framework along with Cordova. Ionic library is built by considering AngularJS as its base. This framework provides mobile- optimized HTML components to create highly interactive hybrid apps. Reference: Ionic site for more details. The below steps/code will help in developing a basic Ionic-Cordova app and showcase a simple grouped list view.
  • 4. Environment Setup and App Creation NodeJS Before we start on any development, NodeJS installation is important. Click here to download NodeJS. Ionic & Cordova The below command should install all related modules and dependencies for ionic and Cordova. $ C:Program Files (x86)nodejs>npm install -g cordova ionic Verify ionic by typing the below command: $ C:Program Files (x86)nodejs>ionic and the result should show:
  • 5. Create An App Use the below command to create an ionic cordova app: C:Program Files (x86)nodejs>ionic start sampleApp blank And the result will be as shown below:
  • 6. Generate Android Code for the Above Ionic App After creating blank ionic app, it is necessary to generate the required platform [Android/iOS/Windows]. And it generates respective app code directories. Generate Android app as below: C:Program Files (x86)nodejs>cd sampleApp C:Program Files (x86)nodejssampleApp>ionic platform add android And the result should be as below: And, app creation is done!!
  • 7. Import Into Android Studio Let's dive into the folder structure of ionic app creation. Go to NodeJS directory and the below screenshot would help in understanding the structure:
  • 8. In platforms, there are three folders as I tried creating for all three OS platforms. Now, the same path must be used to import the Android app into Android Studio. Once it is imported, it would generate the Gradle scripts and app will have three modules.
  • 9. Create a Sample Ionic List View Let's start with designing our list view. Go to index.html file to understand the js structures. app.js is the most important file which initializes the complete app. List view should look like below:
  • 10. And controller should look like: The complete code can be downloaded from: https://github.com/swagatblog/AndroidIonicCordova. References https://nodejs.org/ http://ionicframework.com/docs/guide/installation.html https://cordova.apache.org/docs/en/4.0.0/ https://github.com/swagatblog/AndroidIonicCordova