SlideShare a Scribd company logo
1 of 29
INTRODUCTION TO ANDROID USING PHONEGAP 
SANTHI J KRISHNAN 
ORI SYSINDIA CONSULTANCY SERVICES
Outline 
HTML 
JavaScript 
JQuery 
Android 
PhoneGap 
Workshop – Application Development 
WWW.ORISYS.IN 2
Introduction to HTML 
HTML – Hyper Text Markup Language 
HTML documents describe web pages (Static Web Page) 
HTML tags are keywords surrounded by angle brackets like <html> 
HTML tags normally come in pairs like <b> and </b> 
The first tag in a pair is the start tag (opening tags), the second tag is the end tag(closing tags) 
WWW.ORISYS.IN 3
WWW.ORISYS.IN 4 
Sample Code 
<html> 
<head> 
</head> 
<body> 
<h1>First Planet</h1> 
<h6>First Planet</h6> 
</body> 
</html> 
First Planet 
First Planet 
O/P : 
 <html> .... </html> describes the web page 
 <body> ..... </body> is the visible page content 
 <head> ..... </head> can include scripts, instruct the browser 
where to find style sheets, provide meta information, and more.
Link Tag 
Html Links : 
 Html links are defined with the <a> tag 
Syntax : 
 <a href="http://www.gmil.com">Gmail</a> 
Example: 
<html> 
<body> 
<a href="http://www.gmail.com">Gmail</a> 
</body> 
</html> 
WWW.ORISYS.IN 5
Html Comments 
Comments can be inserted in the HTML code to make it more readable and 
understandable. Comments are ignored by the browser and are not displayed. 
Syntax : 
<!-- some text --> 
Example: 
<html><body> 
<!--It will not be displayed--> 
<h3>Plant Trees </h3> 
</body></html> 
WWW.ORISYS.IN 6
Html Forms 
HTML Forms are used to select different kinds of user input. 
A form is an area that can contain form elements. 
Form elements are elements that allow the user to enter information like, 
Text fields 
Text area fields 
Drop-down menus 
Radio buttons 
Checkboxes 
WWW.ORISYS.IN 7
Html Forms 
Text Fields: 
Text fields are used when you want the user to type letters, numbers, etc. in a 
form. 
Example : 
<form> 
First name : 
Last name : 
First name: <input type="text" id=“firstname ” name=“firstname :" /> <br /> 
Last name: <input type="text" id=“lastname ” name=“lastname :" /> 
</form> 
WWW.ORISYS.IN 8
Html Forms 
Radio Buttons : 
<form action=""> 
<input type="radio" name="sex" value="male">Male<br> 
<input type="radio" name="sex" value="female">Female 
</form> 
Checkboxes : 
<form> 
Bike: <input type="checkbox" name="vehicle" 
value="Bike"/> <br /> 
Car: <input type="checkbox" name="vehicle" 
value="Car"/><br /> 
</form> 
WWW.ORISYS.IN 9
What can we do with JavaScript? 
To create interactive user interface in a web page (e.g., menu, pop-up 
alert, windows, etc.) 
WWW.ORISYS.IN 10 
Manipulating web content dynamically 
Change the content and style of an element 
Replace images on a page without page reload 
Hide/Show contents 
Generate HTML contents on the fly 
Form validation 
AJAX (e.g. Google complete)
Sample Script 
WWW.ORISYS.IN 11 
<html> 
<head> 
<title>First JavaScript Page</title> 
<script type="text/javascript"> 
document.write("<hr>"); 
document.write("Hello World Wide Web"); 
document.write("</hr>"); 
</script> 
</head> 
<body> 
<h1>First JavaScript Page</h1> 
</body> 
</html>
Embedding JavaScript 
WWW.ORISYS.IN 12 
<html> 
<head> 
<title>First JavaScript Program</title> 
<script type="text/javascript" 
src="your_source_file.js"></script> 
</head> 
<body> 
</body> 
</html> 
Inside your_source_file.js 
document.write("<hr>"); 
document.write("Hello World Wide Web"); 
document.write("<hr>"); 
Use the src attribute to include JavaScript codes from an external file.
Functions (Return Values) 
// A function can return value of any type using the 
// keyword "return". 
// The same function can possibly return values 
// of different types 
WWW.ORISYS.IN 13 
function foo (p1) { 
if (typeof(p1) == "number") 
return 0; // Return a number 
else 
if (typeof(p1) == "string") 
return "zero"; // Return a string 
// If no value being explicitly returned 
// "undefined" is returned. 
} 
foo(1); // returns 0 
foo("abc"); // returns "zero" 
foo(); // returns undefined
jQuery – a JavaScript library 
It is a JavaScript library 
It has a large number of functions 
Elements can be selected using element name, class name and ID 
It can be executed even before the page is completely loaded 
Faster and smoother animations 
WWW.ORISYS.IN 14
Basic selectors 
Tag Name 
JavaScript : document.getElementsByTagName("tagName"); 
JQuery : $("tagName") 
Example : $("div"), $("p"), $("div"),..... 
Tag ID 
JavaScript : document.getElementById("id"); 
JQuery : $("#id") 
Example : $("#name"), $("#address"),…. 
Tag Class 
JavaScript : document.getElementsByClassName("className"); 
JQuery : $(".className") 
Example : $(".comment"), $(".code"),…… 
To select all elements 
JQuery : -$("*") 
WWW.ORISYS.IN 15
Enable Jquery in your page 
 jQuery can be enabled in your page by including reference to jQuery library file 
Introduce a jQuery function by using the below syntax: 
$(document).ready(function(){ 
WWW.ORISYS.IN 16 
$("p").click(function() 
{ 
$(this).hide(); 
}); 
}); :Clicked paragraph will become hidden 
<script 
src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
jQuery Selectors 
$("p").hide() 
Demonstrates the jQuery hide() method, hiding all <p> elements. 
$("#test").hide() 
Demonstrates the jQuery hide() method, hiding the element with id="test". 
$(".test").hide() 
Demonstrates the jQuery hide() method, hiding all elements with class="test". 
$(this).hide() 
Demonstrates the jQuery hide() method, hiding the current HTML element. 
WWW.ORISYS.IN 17
What is Android ? 
 An open source software stack for mobile devices that includes an operating system, 
middleware and key applications. 
 Based on the Linux kernel 
 Android has its own virtual machine (Dalvik Virtual Machine) which is used for executing 
the android application. 
 Google acquired CA based start-up Android, Inc. - initial developers of the Android mobile 
device platform, incorporated in 2005. 
WWW.ORISYS.IN 18
Android Versions 
WWW.ORISYS.IN 19
Android Architecture 
The software stack is split into Four Layers: 
 The application layer 
 The application framework 
 The libraries and runtime 
 The kernel 
WWW.ORISYS.IN 20
WWW.ORISYS.IN 21
About Phonegap 
 PhoneGap is an open-source mobile development framework 
 Developed by Nitobi Software 
 Bought by Adobe 
 Enables building of mobile applications using JavaScript, HTML and CSS depending upon the 
platform of the device 
WWW.ORISYS.IN 22
PhoneGap Applications 
 The software underlying PhoneGap is Apache Cordova 
 Much of the functions of HTML5 are supported 
 The PhoneGap applications support Android, iPhone, Windows Phone, BlackBerry, Bada, 
Symbian, webOS, Tizen hence it is known to be hybrid 
 A disadvantage is that hybrid applications do not have full access to the device APIs 
Camera, compass, accelerometer, etc. 
WWW.ORISYS.IN 23
How does it work ? 
 Build your app once with web-standards 
 Based on HTML5,CSS,JS,Jquery etc. 
 Wrap it up with PhoneGap 
 Using the free open source framework or PhoneGap build, 
you can access the native APIs 
 Deploy to multiple platforms 
 Standards-based web technologies to bridge web applications and mobile 
devices 
WWW.ORISYS.IN 24
Means of PhoneGap Development 
 PhoneGap is just a library that you must include in your app 
 Couple of JavaScript and xml files 
 What is PhoneGap doing? 
 PhoneGap generates an out-of-the-browser window that executes the HTML and 
JavaScript 
 Due to a couple of xml and jar/dll files it enables the usage of native APIs 
WWW.ORISYS.IN 25
Where can we Develop ? 
 Native IDE for the corresponding OS 
 Eclipse, Xcode, Visual Studio, etc. 
 Abode launched a new version of Dreamweaver that integrates with 
PhoneGap 
Build the web site 
Add the mobile SDKs 
Say it is mobile app 
Build and deploy 
 In both the concrete OS SDK must be present 
WWW.ORISYS.IN 26
• feedback @ santhi.j.krishnan@orisys.in 
• download slides here : bit.ly/1xmX7bM 
WWW.ORISYS.IN 27
Contact 
SANTHI J KRISHNAN 
ANDROID DEVELOPER 
E MAIL : santhi.j.krishnan@orisys.in 
TWITTER : @santhijkrishnan 
ORISYSINDIA CONSULTANCY SERVICES 
TBIC3, THEJASWINI BUILDING 
TECHNOPARK,TRIVANDRUM 
KERALA - 695 581, INDIA 
TEL : +91 8086 800 203 
E MAIL : contact@orisys.in 
WWW.ORISYS.IN 
WWW.ORISYS.IN 28
THANK YOU

More Related Content

What's hot

C#Web Sec Oct27 2010 Final
C#Web Sec Oct27 2010 FinalC#Web Sec Oct27 2010 Final
C#Web Sec Oct27 2010 FinalRich Helton
 
[Devoxx Morocco 2015] Apache Cordova In Action
[Devoxx Morocco 2015] Apache Cordova In Action[Devoxx Morocco 2015] Apache Cordova In Action
[Devoxx Morocco 2015] Apache Cordova In ActionHazem Saleh
 
The Scala Programming Language
The Scala Programming LanguageThe Scala Programming Language
The Scala Programming LanguageHaim Michael
 
Android app development Hybrid approach for beginners
Android app development  Hybrid approach for beginnersAndroid app development  Hybrid approach for beginners
Android app development Hybrid approach for beginnersKhirulnizam Abd Rahman
 
Angular 2 Seminar_(December 7/12/2015)
Angular 2 Seminar_(December 7/12/2015)Angular 2 Seminar_(December 7/12/2015)
Angular 2 Seminar_(December 7/12/2015)Haim Michael
 
20150812 4시간만에 따라해보는 windows 10 앱 개발
20150812  4시간만에 따라해보는 windows 10 앱 개발20150812  4시간만에 따라해보는 windows 10 앱 개발
20150812 4시간만에 따라해보는 windows 10 앱 개발영욱 김
 
Apache Cordova In Action
Apache Cordova In ActionApache Cordova In Action
Apache Cordova In ActionHazem Saleh
 
Intro Java Rev010
Intro Java Rev010Intro Java Rev010
Intro Java Rev010Rich Helton
 
Mobile Web App development multiplatform using phonegap-cordova
Mobile Web App development multiplatform using phonegap-cordovaMobile Web App development multiplatform using phonegap-cordova
Mobile Web App development multiplatform using phonegap-cordovaKhirulnizam Abd Rahman
 
[JMaghreb 2014] Developing JavaScript Mobile Apps Using Apache Cordova
[JMaghreb 2014] Developing JavaScript Mobile Apps Using Apache Cordova[JMaghreb 2014] Developing JavaScript Mobile Apps Using Apache Cordova
[JMaghreb 2014] Developing JavaScript Mobile Apps Using Apache CordovaHazem Saleh
 
Enterprise AIR Development for JavaScript Developers
Enterprise AIR Development for JavaScript DevelopersEnterprise AIR Development for JavaScript Developers
Enterprise AIR Development for JavaScript DevelopersAndreCharland
 

What's hot (12)

JavaScript Basic
JavaScript BasicJavaScript Basic
JavaScript Basic
 
C#Web Sec Oct27 2010 Final
C#Web Sec Oct27 2010 FinalC#Web Sec Oct27 2010 Final
C#Web Sec Oct27 2010 Final
 
[Devoxx Morocco 2015] Apache Cordova In Action
[Devoxx Morocco 2015] Apache Cordova In Action[Devoxx Morocco 2015] Apache Cordova In Action
[Devoxx Morocco 2015] Apache Cordova In Action
 
The Scala Programming Language
The Scala Programming LanguageThe Scala Programming Language
The Scala Programming Language
 
Android app development Hybrid approach for beginners
Android app development  Hybrid approach for beginnersAndroid app development  Hybrid approach for beginners
Android app development Hybrid approach for beginners
 
Angular 2 Seminar_(December 7/12/2015)
Angular 2 Seminar_(December 7/12/2015)Angular 2 Seminar_(December 7/12/2015)
Angular 2 Seminar_(December 7/12/2015)
 
20150812 4시간만에 따라해보는 windows 10 앱 개발
20150812  4시간만에 따라해보는 windows 10 앱 개발20150812  4시간만에 따라해보는 windows 10 앱 개발
20150812 4시간만에 따라해보는 windows 10 앱 개발
 
Apache Cordova In Action
Apache Cordova In ActionApache Cordova In Action
Apache Cordova In Action
 
Intro Java Rev010
Intro Java Rev010Intro Java Rev010
Intro Java Rev010
 
Mobile Web App development multiplatform using phonegap-cordova
Mobile Web App development multiplatform using phonegap-cordovaMobile Web App development multiplatform using phonegap-cordova
Mobile Web App development multiplatform using phonegap-cordova
 
[JMaghreb 2014] Developing JavaScript Mobile Apps Using Apache Cordova
[JMaghreb 2014] Developing JavaScript Mobile Apps Using Apache Cordova[JMaghreb 2014] Developing JavaScript Mobile Apps Using Apache Cordova
[JMaghreb 2014] Developing JavaScript Mobile Apps Using Apache Cordova
 
Enterprise AIR Development for JavaScript Developers
Enterprise AIR Development for JavaScript DevelopersEnterprise AIR Development for JavaScript Developers
Enterprise AIR Development for JavaScript Developers
 

Viewers also liked

The elements of UX
The elements of UXThe elements of UX
The elements of UXMK_kogsci
 
13 Indisputable Reasons to Redesign Your Website.
13 Indisputable Reasons to Redesign Your Website.13 Indisputable Reasons to Redesign Your Website.
13 Indisputable Reasons to Redesign Your Website.Captivate Designs
 
台灣的小漁港
台灣的小漁港台灣的小漁港
台灣的小漁港Eve Guo
 
Youtube marketing software
Youtube marketing softwareYoutube marketing software
Youtube marketing softwareselinasimpson842
 
Evaluation
EvaluationEvaluation
Evaluationalliixa
 
Hubungan etnik-di-malaysia-group-1
Hubungan etnik-di-malaysia-group-1Hubungan etnik-di-malaysia-group-1
Hubungan etnik-di-malaysia-group-1Siti Norazlina
 
Исследования Константина Иовкова
Исследования Константина ИовковаИсследования Константина Иовкова
Исследования Константина ИовковаBuTCHeR1337
 
Artist Research - Tyler Noel
Artist Research - Tyler NoelArtist Research - Tyler Noel
Artist Research - Tyler Noelniyattesfamariam
 
Derechos de autor en la web
Derechos de autor en la webDerechos de autor en la web
Derechos de autor en la webArmando Casas
 
Approach to a child with hematemesis or melena
Approach to a child with hematemesis or melenaApproach to a child with hematemesis or melena
Approach to a child with hematemesis or melenaAvijeet Mishra
 
Evaluation Question 1
Evaluation Question 1Evaluation Question 1
Evaluation Question 1El_Lester
 
Audi a8 3.0 t lwb quattro tiptronic sedan 2015 Photo Gallery
Audi a8 3.0 t lwb quattro tiptronic sedan 2015 Photo GalleryAudi a8 3.0 t lwb quattro tiptronic sedan 2015 Photo Gallery
Audi a8 3.0 t lwb quattro tiptronic sedan 2015 Photo Galleryizmostudio
 
Porsche Cayenne S Hybrid SUV 2014 Photo Gallery
Porsche Cayenne S Hybrid SUV 2014 Photo GalleryPorsche Cayenne S Hybrid SUV 2014 Photo Gallery
Porsche Cayenne S Hybrid SUV 2014 Photo Galleryizmostudio
 
Codes and convention
Codes and conventionCodes and convention
Codes and conventionstephanie983
 
Bersiap untuk-sebuah-akhir-prima-pindai
Bersiap untuk-sebuah-akhir-prima-pindaiBersiap untuk-sebuah-akhir-prima-pindai
Bersiap untuk-sebuah-akhir-prima-pindaiPindai Media
 

Viewers also liked (19)

G2
G2G2
G2
 
The elements of UX
The elements of UXThe elements of UX
The elements of UX
 
13 Indisputable Reasons to Redesign Your Website.
13 Indisputable Reasons to Redesign Your Website.13 Indisputable Reasons to Redesign Your Website.
13 Indisputable Reasons to Redesign Your Website.
 
bab 6 kls x
bab 6 kls xbab 6 kls x
bab 6 kls x
 
台灣的小漁港
台灣的小漁港台灣的小漁港
台灣的小漁港
 
Youtube marketing software
Youtube marketing softwareYoutube marketing software
Youtube marketing software
 
Evaluation
EvaluationEvaluation
Evaluation
 
Hubungan etnik-di-malaysia-group-1
Hubungan etnik-di-malaysia-group-1Hubungan etnik-di-malaysia-group-1
Hubungan etnik-di-malaysia-group-1
 
Исследования Константина Иовкова
Исследования Константина ИовковаИсследования Константина Иовкова
Исследования Константина Иовкова
 
Jossue interacción WEB
Jossue interacción WEB Jossue interacción WEB
Jossue interacción WEB
 
Artist Research - Tyler Noel
Artist Research - Tyler NoelArtist Research - Tyler Noel
Artist Research - Tyler Noel
 
Derechos de autor en la web
Derechos de autor en la webDerechos de autor en la web
Derechos de autor en la web
 
Portfolio Karator4Brains
Portfolio Karator4BrainsPortfolio Karator4Brains
Portfolio Karator4Brains
 
Approach to a child with hematemesis or melena
Approach to a child with hematemesis or melenaApproach to a child with hematemesis or melena
Approach to a child with hematemesis or melena
 
Evaluation Question 1
Evaluation Question 1Evaluation Question 1
Evaluation Question 1
 
Audi a8 3.0 t lwb quattro tiptronic sedan 2015 Photo Gallery
Audi a8 3.0 t lwb quattro tiptronic sedan 2015 Photo GalleryAudi a8 3.0 t lwb quattro tiptronic sedan 2015 Photo Gallery
Audi a8 3.0 t lwb quattro tiptronic sedan 2015 Photo Gallery
 
Porsche Cayenne S Hybrid SUV 2014 Photo Gallery
Porsche Cayenne S Hybrid SUV 2014 Photo GalleryPorsche Cayenne S Hybrid SUV 2014 Photo Gallery
Porsche Cayenne S Hybrid SUV 2014 Photo Gallery
 
Codes and convention
Codes and conventionCodes and convention
Codes and convention
 
Bersiap untuk-sebuah-akhir-prima-pindai
Bersiap untuk-sebuah-akhir-prima-pindaiBersiap untuk-sebuah-akhir-prima-pindai
Bersiap untuk-sebuah-akhir-prima-pindai
 

Similar to Introduction to Android using PhoneGap

Building Desktop RIAs with PHP, HTML & Javascript in AIR
Building Desktop RIAs with PHP, HTML & Javascript in AIRBuilding Desktop RIAs with PHP, HTML & Javascript in AIR
Building Desktop RIAs with PHP, HTML & Javascript in AIRfunkatron
 
Titanium appcelerator my first app
Titanium appcelerator my first appTitanium appcelerator my first app
Titanium appcelerator my first appAlessio Ricco
 
[JavaLand 2015] Developing JavaScript Mobile Apps Using Apache Cordova
[JavaLand 2015] Developing JavaScript Mobile Apps Using Apache Cordova[JavaLand 2015] Developing JavaScript Mobile Apps Using Apache Cordova
[JavaLand 2015] Developing JavaScript Mobile Apps Using Apache CordovaHazem Saleh
 
Building Cross-Platform Mobile Apps
Building Cross-Platform Mobile AppsBuilding Cross-Platform Mobile Apps
Building Cross-Platform Mobile AppsTroy Miles
 
A I R Presentation Dev Camp Feb 08
A I R  Presentation  Dev Camp  Feb 08A I R  Presentation  Dev Camp  Feb 08
A I R Presentation Dev Camp Feb 08Abdul Qabiz
 
Googleappengineintro 110410190620-phpapp01
Googleappengineintro 110410190620-phpapp01Googleappengineintro 110410190620-phpapp01
Googleappengineintro 110410190620-phpapp01Tony Frame
 
(Christian heilman) firefox
(Christian heilman) firefox(Christian heilman) firefox
(Christian heilman) firefoxNAVER D2
 
WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...Fabio Franzini
 
Folio3 - An Introduction to PHP Yii
Folio3 - An Introduction to PHP YiiFolio3 - An Introduction to PHP Yii
Folio3 - An Introduction to PHP YiiFolio3 Software
 
Developing Native Mobile Apps Using JavaScript, ApacheCon NA 2014
Developing Native Mobile Apps Using JavaScript, ApacheCon NA 2014Developing Native Mobile Apps Using JavaScript, ApacheCon NA 2014
Developing Native Mobile Apps Using JavaScript, ApacheCon NA 2014Hazem Saleh
 
Rails Girls - Introduction to HTML & CSS
Rails Girls - Introduction to HTML & CSSRails Girls - Introduction to HTML & CSS
Rails Girls - Introduction to HTML & CSSTimo Herttua
 
Android App Development using HTML5 Technology
Android App Development using HTML5 TechnologyAndroid App Development using HTML5 Technology
Android App Development using HTML5 TechnologyOon Arfiandwi
 

Similar to Introduction to Android using PhoneGap (20)

Building Desktop RIAs with PHP, HTML & Javascript in AIR
Building Desktop RIAs with PHP, HTML & Javascript in AIRBuilding Desktop RIAs with PHP, HTML & Javascript in AIR
Building Desktop RIAs with PHP, HTML & Javascript in AIR
 
jQuery plugins & JSON
jQuery plugins & JSONjQuery plugins & JSON
jQuery plugins & JSON
 
Titanium appcelerator my first app
Titanium appcelerator my first appTitanium appcelerator my first app
Titanium appcelerator my first app
 
Android Intro
Android IntroAndroid Intro
Android Intro
 
[JavaLand 2015] Developing JavaScript Mobile Apps Using Apache Cordova
[JavaLand 2015] Developing JavaScript Mobile Apps Using Apache Cordova[JavaLand 2015] Developing JavaScript Mobile Apps Using Apache Cordova
[JavaLand 2015] Developing JavaScript Mobile Apps Using Apache Cordova
 
Android TCJUG
Android TCJUGAndroid TCJUG
Android TCJUG
 
Building Cross-Platform Mobile Apps
Building Cross-Platform Mobile AppsBuilding Cross-Platform Mobile Apps
Building Cross-Platform Mobile Apps
 
SAX - Android Development
SAX - Android DevelopmentSAX - Android Development
SAX - Android Development
 
A I R Presentation Dev Camp Feb 08
A I R  Presentation  Dev Camp  Feb 08A I R  Presentation  Dev Camp  Feb 08
A I R Presentation Dev Camp Feb 08
 
Gears User Guide
Gears User GuideGears User Guide
Gears User Guide
 
Intro to Android Programming
Intro to Android ProgrammingIntro to Android Programming
Intro to Android Programming
 
Googleappengineintro 110410190620-phpapp01
Googleappengineintro 110410190620-phpapp01Googleappengineintro 110410190620-phpapp01
Googleappengineintro 110410190620-phpapp01
 
Wt unit 5
Wt unit 5Wt unit 5
Wt unit 5
 
(Christian heilman) firefox
(Christian heilman) firefox(Christian heilman) firefox
(Christian heilman) firefox
 
WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...
 
Folio3 - An Introduction to PHP Yii
Folio3 - An Introduction to PHP YiiFolio3 - An Introduction to PHP Yii
Folio3 - An Introduction to PHP Yii
 
Developing Native Mobile Apps Using JavaScript, ApacheCon NA 2014
Developing Native Mobile Apps Using JavaScript, ApacheCon NA 2014Developing Native Mobile Apps Using JavaScript, ApacheCon NA 2014
Developing Native Mobile Apps Using JavaScript, ApacheCon NA 2014
 
jQuery
jQueryjQuery
jQuery
 
Rails Girls - Introduction to HTML & CSS
Rails Girls - Introduction to HTML & CSSRails Girls - Introduction to HTML & CSS
Rails Girls - Introduction to HTML & CSS
 
Android App Development using HTML5 Technology
Android App Development using HTML5 TechnologyAndroid App Development using HTML5 Technology
Android App Development using HTML5 Technology
 

Introduction to Android using PhoneGap

  • 1. INTRODUCTION TO ANDROID USING PHONEGAP SANTHI J KRISHNAN ORI SYSINDIA CONSULTANCY SERVICES
  • 2. Outline HTML JavaScript JQuery Android PhoneGap Workshop – Application Development WWW.ORISYS.IN 2
  • 3. Introduction to HTML HTML – Hyper Text Markup Language HTML documents describe web pages (Static Web Page) HTML tags are keywords surrounded by angle brackets like <html> HTML tags normally come in pairs like <b> and </b> The first tag in a pair is the start tag (opening tags), the second tag is the end tag(closing tags) WWW.ORISYS.IN 3
  • 4. WWW.ORISYS.IN 4 Sample Code <html> <head> </head> <body> <h1>First Planet</h1> <h6>First Planet</h6> </body> </html> First Planet First Planet O/P :  <html> .... </html> describes the web page  <body> ..... </body> is the visible page content  <head> ..... </head> can include scripts, instruct the browser where to find style sheets, provide meta information, and more.
  • 5. Link Tag Html Links :  Html links are defined with the <a> tag Syntax :  <a href="http://www.gmil.com">Gmail</a> Example: <html> <body> <a href="http://www.gmail.com">Gmail</a> </body> </html> WWW.ORISYS.IN 5
  • 6. Html Comments Comments can be inserted in the HTML code to make it more readable and understandable. Comments are ignored by the browser and are not displayed. Syntax : <!-- some text --> Example: <html><body> <!--It will not be displayed--> <h3>Plant Trees </h3> </body></html> WWW.ORISYS.IN 6
  • 7. Html Forms HTML Forms are used to select different kinds of user input. A form is an area that can contain form elements. Form elements are elements that allow the user to enter information like, Text fields Text area fields Drop-down menus Radio buttons Checkboxes WWW.ORISYS.IN 7
  • 8. Html Forms Text Fields: Text fields are used when you want the user to type letters, numbers, etc. in a form. Example : <form> First name : Last name : First name: <input type="text" id=“firstname ” name=“firstname :" /> <br /> Last name: <input type="text" id=“lastname ” name=“lastname :" /> </form> WWW.ORISYS.IN 8
  • 9. Html Forms Radio Buttons : <form action=""> <input type="radio" name="sex" value="male">Male<br> <input type="radio" name="sex" value="female">Female </form> Checkboxes : <form> Bike: <input type="checkbox" name="vehicle" value="Bike"/> <br /> Car: <input type="checkbox" name="vehicle" value="Car"/><br /> </form> WWW.ORISYS.IN 9
  • 10. What can we do with JavaScript? To create interactive user interface in a web page (e.g., menu, pop-up alert, windows, etc.) WWW.ORISYS.IN 10 Manipulating web content dynamically Change the content and style of an element Replace images on a page without page reload Hide/Show contents Generate HTML contents on the fly Form validation AJAX (e.g. Google complete)
  • 11. Sample Script WWW.ORISYS.IN 11 <html> <head> <title>First JavaScript Page</title> <script type="text/javascript"> document.write("<hr>"); document.write("Hello World Wide Web"); document.write("</hr>"); </script> </head> <body> <h1>First JavaScript Page</h1> </body> </html>
  • 12. Embedding JavaScript WWW.ORISYS.IN 12 <html> <head> <title>First JavaScript Program</title> <script type="text/javascript" src="your_source_file.js"></script> </head> <body> </body> </html> Inside your_source_file.js document.write("<hr>"); document.write("Hello World Wide Web"); document.write("<hr>"); Use the src attribute to include JavaScript codes from an external file.
  • 13. Functions (Return Values) // A function can return value of any type using the // keyword "return". // The same function can possibly return values // of different types WWW.ORISYS.IN 13 function foo (p1) { if (typeof(p1) == "number") return 0; // Return a number else if (typeof(p1) == "string") return "zero"; // Return a string // If no value being explicitly returned // "undefined" is returned. } foo(1); // returns 0 foo("abc"); // returns "zero" foo(); // returns undefined
  • 14. jQuery – a JavaScript library It is a JavaScript library It has a large number of functions Elements can be selected using element name, class name and ID It can be executed even before the page is completely loaded Faster and smoother animations WWW.ORISYS.IN 14
  • 15. Basic selectors Tag Name JavaScript : document.getElementsByTagName("tagName"); JQuery : $("tagName") Example : $("div"), $("p"), $("div"),..... Tag ID JavaScript : document.getElementById("id"); JQuery : $("#id") Example : $("#name"), $("#address"),…. Tag Class JavaScript : document.getElementsByClassName("className"); JQuery : $(".className") Example : $(".comment"), $(".code"),…… To select all elements JQuery : -$("*") WWW.ORISYS.IN 15
  • 16. Enable Jquery in your page  jQuery can be enabled in your page by including reference to jQuery library file Introduce a jQuery function by using the below syntax: $(document).ready(function(){ WWW.ORISYS.IN 16 $("p").click(function() { $(this).hide(); }); }); :Clicked paragraph will become hidden <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
  • 17. jQuery Selectors $("p").hide() Demonstrates the jQuery hide() method, hiding all <p> elements. $("#test").hide() Demonstrates the jQuery hide() method, hiding the element with id="test". $(".test").hide() Demonstrates the jQuery hide() method, hiding all elements with class="test". $(this).hide() Demonstrates the jQuery hide() method, hiding the current HTML element. WWW.ORISYS.IN 17
  • 18. What is Android ?  An open source software stack for mobile devices that includes an operating system, middleware and key applications.  Based on the Linux kernel  Android has its own virtual machine (Dalvik Virtual Machine) which is used for executing the android application.  Google acquired CA based start-up Android, Inc. - initial developers of the Android mobile device platform, incorporated in 2005. WWW.ORISYS.IN 18
  • 20. Android Architecture The software stack is split into Four Layers:  The application layer  The application framework  The libraries and runtime  The kernel WWW.ORISYS.IN 20
  • 22. About Phonegap  PhoneGap is an open-source mobile development framework  Developed by Nitobi Software  Bought by Adobe  Enables building of mobile applications using JavaScript, HTML and CSS depending upon the platform of the device WWW.ORISYS.IN 22
  • 23. PhoneGap Applications  The software underlying PhoneGap is Apache Cordova  Much of the functions of HTML5 are supported  The PhoneGap applications support Android, iPhone, Windows Phone, BlackBerry, Bada, Symbian, webOS, Tizen hence it is known to be hybrid  A disadvantage is that hybrid applications do not have full access to the device APIs Camera, compass, accelerometer, etc. WWW.ORISYS.IN 23
  • 24. How does it work ?  Build your app once with web-standards  Based on HTML5,CSS,JS,Jquery etc.  Wrap it up with PhoneGap  Using the free open source framework or PhoneGap build, you can access the native APIs  Deploy to multiple platforms  Standards-based web technologies to bridge web applications and mobile devices WWW.ORISYS.IN 24
  • 25. Means of PhoneGap Development  PhoneGap is just a library that you must include in your app  Couple of JavaScript and xml files  What is PhoneGap doing?  PhoneGap generates an out-of-the-browser window that executes the HTML and JavaScript  Due to a couple of xml and jar/dll files it enables the usage of native APIs WWW.ORISYS.IN 25
  • 26. Where can we Develop ?  Native IDE for the corresponding OS  Eclipse, Xcode, Visual Studio, etc.  Abode launched a new version of Dreamweaver that integrates with PhoneGap Build the web site Add the mobile SDKs Say it is mobile app Build and deploy  In both the concrete OS SDK must be present WWW.ORISYS.IN 26
  • 27. • feedback @ santhi.j.krishnan@orisys.in • download slides here : bit.ly/1xmX7bM WWW.ORISYS.IN 27
  • 28. Contact SANTHI J KRISHNAN ANDROID DEVELOPER E MAIL : santhi.j.krishnan@orisys.in TWITTER : @santhijkrishnan ORISYSINDIA CONSULTANCY SERVICES TBIC3, THEJASWINI BUILDING TECHNOPARK,TRIVANDRUM KERALA - 695 581, INDIA TEL : +91 8086 800 203 E MAIL : contact@orisys.in WWW.ORISYS.IN WWW.ORISYS.IN 28