SlideShare una empresa de Scribd logo
1 de 49
Descargar para leer sin conexión
BUILDING MOBILE 
APPLICATIONS 
WITH DRUPALGAP 
SCHEDROV ALEXANDER 
! 
SANCHIZ
SCHEDROV ALEXANDER 
AKA 
SANCHIZ 
Lead Drupal Developer at Trellon 
Maintainer: 
• pathauto_i18n 
• user_profile_comment 
• DrupalGapManager 
https://github.com/Sanchiz/DrupalGapManager 
Participant: 
• crm_core 
• relation_lists
“Never memorise what you can look up in 
books.” 
- Albert Einstein
“Never memorise what you can look up 
IN YOUR PHONE.” 
- not Albert Einstein
WHY WE NEED PROVIDES 
MOBILE APPLICATION TO 
OUR CUSTOMERS?
MOBILE WEBSITE TRAFFIC 
Percentage of website traffic from mobile devices 
32 
24 
16 
8 
0 
30.0% 32.0% 29.0% 28.0% 
23.9% 
Q1 2013 Q2 2013 Q3 2013 Q4 2013 Q1 2014
REGULAR SITE 
Website 
+ 
Responsive 
Website
Site 
Drupal Bootstrap 
Receive response as 
markup 
Load CSS files 
Load JS files 
Load theme 
files(images, fonts) 
Load content images 
Show content to user 
Mobile application 
Drupal Bootstrap 
Receive response as 
JSON 
Load content images 
Show content to user
HOW MOBILE APPLICATION 
DIFFERENT FROM RESPONSIVE SITE? 
Our mobile phone have 
features which don't 
have our regular devices! 
It’s handy!
WHAT IS DRUPALGAP?
• Created by Tyler Frankenstein 
• First release Feb 25, 2012 ~100 lines 
• Currently ~10,000 lines
DRUPALGAP 
Drupal module 
hosted on d.org 
It's connection 
between mobile 
applications and 
Drupal websites via 
web Services. 
Development Kit hosted 
on GitHub 
Developers can create 
custom multi-platform 
mobile applications that 
communicate with their 
Drupal websites.
DRUPALGAP FEATURES 
You don't need a Objective-C and Java 
developers. 
! 
If you know how to build Drupal modules 
and know JavaScript - Welcome to 
DrupalGap developers.
DrupalGap application it’s a good 
example of using headless Drupal
HOW IT WORKS? 
PhoneGap generates HTML, CSS 
and JavaScript and make application 
iOS and Android mobile 
devices. 
Apache Cordova provides access 
via JavaScript to device 
features such as the 
Camera, GPS, File System, 
Contacts, Compass, etc.
TYPES OF SITES WHICH CAN USE 
MOBILE APPLICATION 
Any sites that you can imagine.
DRUPALGAP INSIDE
DEVELOPMENT REQUIREMENTS 
ENVIRONMENTS 
1. Google Chrome and 
Ripple Emulator extension 
2. node.js 
cordova(node.js package) 
Java SDK for Android or 
xCode for iOS 
DRUPAL 
• services 
• rest_server 
• views_datasource 
• views_json
DRUPALGAP INHERITS DRUPAL 
DEVELOPER CONCEPTS 
• Themes, modules 
• Blocks 
• Menus 
• Pages 
• Entities 
• Fields 
• Forms 
• Views 
• Messages 
• Services 
• Other Drupal 
tools
EXTENSIBLE WITH CONTRIB MODULES 
• Force Authentication 
• Telephone 
• Address Field 
• AmazonS3 
• AudioField 
• Colorbox 
• Commerce 
• Commerce DrupalGap Stripe 
• Date 
• Email Registration 
• Entity reference 
• Fivestar 
• Flag 
• Geofield 
• GeoTracker 
• Link 
• Location 
• LoginToboggan 
• Pathfix 
• Push Notifications 
• Rate 
• Services Menu 
• Shadowbox 
• User registration password 
• Voting API 
• Webform 
http://www.drupalgap.org/project/modules
EXTENSIBLE API 
http://api.drupalgap.org
We have a special tool for the Jedi!
DRUPALGAP MANAGER 
is a command-line tool and interface for DrupalGap 
https://github.com/Sanchiz/DrupalGapManager 
https://www.npmjs.org/package/dgm
http://tylerfrankenstein.com/code/build-mobile-app-sell-products- 
with-drupal
SPECIAL FEATURES
GEOLOCATION 
var onSuccess = function(position) { 
console.log(position); 
}; 
var onError = function(error) { 
console.log(error.message); 
} 
navigator.geolocation.getCurrentPosition(onSuccess, onError); 
var onSuccess = function(position) { 
console.log(position); 
} 
var onError = onError(error) { 
console.log(error.message); 
} 
! 
// Update is received every 30 seconds. 
var watchID = navigator.geolocation.watchPosition( 
onSuccess, 
onError, 
{ timeout: 30000 } 
);
CAMERA ACCESS 
AND FILE BROWSER
PUSH NOTIFICATIONS 
Sender Cloud server Target device 
Google Cloud Messaging 
or 
Apple Push Notification Service 
Drupal site 
Other systems
Drupal module: https://www.drupal.org/project/push_notifications 
Cordova plugin: https://github.com/phonegap-build/PushPlugin 
DrupalGap module: https://github.com/signalpoint/push_notifications 
Rules integration in 7.x-1.x-dev: https://www.drupal.org/node/ 
1658132#comment-8512423
EXTENSIBLE WITH CORDOVA PLUGINS 
http://plugins.cordova.io
DRUPAL 8
DRUPAL 8 
RESTful Web Services in Core
DRUPAL 8 
Views supports REST
#D8CX 
All that we need - update 
DrupalGap SDK according 
to the changes in Drupal 8. 
#D8CX: I pledge that DrupalGap will have a full Drupal 8 
release on the day that Drupal 8 is released (c) Tyler
DEVELOPMENT
FILE STRUCTURE 
modules 
custom 
themes 
settings.js
• MODULE_NAME (module folder) 
• MODULE_NAME.js (module file) 
/** 
* Implements hook_menu(). 
*/ 
function MODULE_NAME_menu() { 
} 
! 
function MODULE_NAME_homepage() { 
} 
app/settings.js: 
var items = {}; 
items['homepage'] = { 
title: 'New Sandbox', 
page_callback: 'MODULE_NAME_homepage' 
}; 
return items; 
var content = {}; 
content['homepage'] = { 
markup: 'some markup' 
}; 
return content; 
Drupal.modules.custom['MODULE_NAME'] = {};
app/settings.js: 
drupalgap.settings.menus['homepage_menu'] = { 
links:[ 
{title:'News', path:'news'}, 
{title:'About', path:'node/1'}, 
{title:'Contact', path:'contact'}, 
{title:'Our team', path:'team'} 
] 
};
drupalgap.settings.blocks.THEME_NAME = { 
content: { 
homepage_menu: { 
pages:{ 
value:['homepage'], 
mode:'include' 
} 
}, 
users_block: { 
pages:{ 
value:['node/*', 'user/*'], 
mode:'include' 
}, 
roles:{ 
value:['authenticated user'], 
mode:'include' 
} 
}, 
}, 
}; 
app/settings.js: 
page.tpl.html 
<div 
id="{:drupalgap_page_id:}" 
data-role="page"> 
{:header:} 
{:navigation:} 
{:content:} 
{:footer:} 
</div>
VIEWS 
1. Need to create page with JSON data document 
format (views_json module) 
2. Implement hook_menu 
3. Implement page_callback 
4. Implement row_callback(function to process 
and render each row)
function MODULE_NAME_menu() { 
var items = {}; 
items['team'] = { 
title: 'Our team', 
page_callback: 'MODULE_NAME_page' 
} 
return items; 
} 
app/modules/custom/module_name/module_name.js:
function MODULE_NAME_page() { 
var content = {}; 
content['team'] = { 
theme: 'view', 
format: ‘ul', /* ul, ol, table, unformatted_list */ 
path: 'mobile/team_new', /* the path to the view in Drupal */ 
row_callback: 'MODULE_NAME_page_row', 
empty_callback: 'MODULE_NAME_page_empty', 
attributes: { 
id: 'team-view' 
} 
}; 
return content; 
} 
! 
function MODULE_NAME_page_row(view, row) { 
var output = ''; 
output += '<img class="team-image" src="' + row.field_photo + '">'; 
output += l(row.title, 'node/' + row.Nid); 
return output; 
} 
! 
function MODULE_NAME_page_empty(view) { 
return 'Sorry, no results.'; 
} 
app/modules/custom/module_name/module_name.js:
NEED ADDITIONAL FUNCTIONALITY? 
YOU GOT IT! 
1. Create custom services resource in Drupal module 
hook_services_resources(); 
2. Create custom services call in DrupalGap module 
Drupal.services.call(options); 
var output = ''; 
Drupal.services.call({ 
method: 'POST', 
path: 'news.json', 
data: args, 
success: function(result) { 
output = ''; 
$.each(result, function(i, node) { 
output += node.title; 
}); 
} 
});
RELEASE
ANDROID 
Devices 
Android 2.1 (Deprecated May 2013) 
Android 2.2 
Android 2.3 
Android 3.x (Deprecated May 2013) 
Android 4.x 
Development 
Any OS 
JDK 6+ and Apache Ant 
Developer license: $25 one time
IOS 
Devices 
iOS Device with at least iOS 5.x+ 
Development 
Intel-based Computer with Mac OS X Lion or 
greater (10.7.4+) 
Xcode Command Line Tools 
Xcode 4.5+ and iOS 6 SDK 
Developer license: $99 per year
CONCLUSION 
• DrupalGap is growing 
• Needs support from a community 
• We have incredible tool that allows 
us to build mobile application from 
scratch
THANK YOU! 
https://www.drupal.org/u/sanchiz 
https://github.com/Sanchiz 
http://sanchiz.net 
Email: alexander.schedrov@gmail.com 
Twitter: @alexschedrov

Más contenido relacionado

La actualidad más candente

La actualidad más candente (20)

Road to Rails
Road to RailsRoad to Rails
Road to Rails
 
Progressive Enhancement 2.0 (jQuery Conference SF Bay Area 2011)
Progressive Enhancement 2.0 (jQuery Conference SF Bay Area 2011)Progressive Enhancement 2.0 (jQuery Conference SF Bay Area 2011)
Progressive Enhancement 2.0 (jQuery Conference SF Bay Area 2011)
 
HTML5
HTML5HTML5
HTML5
 
Css, xhtml, javascript
Css, xhtml, javascriptCss, xhtml, javascript
Css, xhtml, javascript
 
Lecture 3 Javascript1
Lecture 3  Javascript1Lecture 3  Javascript1
Lecture 3 Javascript1
 
HTML5 JS APIs
HTML5 JS APIsHTML5 JS APIs
HTML5 JS APIs
 
HTML 5 Step By Step - Ebook
HTML 5 Step By Step - EbookHTML 5 Step By Step - Ebook
HTML 5 Step By Step - Ebook
 
Jumping Into WordPress Plugin Programming
Jumping Into WordPress Plugin ProgrammingJumping Into WordPress Plugin Programming
Jumping Into WordPress Plugin Programming
 
BDD - Writing better scenario
BDD - Writing better scenarioBDD - Writing better scenario
BDD - Writing better scenario
 
HTML5 and the web of tomorrow!
HTML5  and the  web of tomorrow!HTML5  and the  web of tomorrow!
HTML5 and the web of tomorrow!
 
HTML5 Essentials
HTML5 EssentialsHTML5 Essentials
HTML5 Essentials
 
An Introduction To HTML5
An Introduction To HTML5An Introduction To HTML5
An Introduction To HTML5
 
An Introduction to HTML5
An Introduction to HTML5An Introduction to HTML5
An Introduction to HTML5
 
Introduction to Html5
Introduction to Html5Introduction to Html5
Introduction to Html5
 
Introduction to HTML5 & CSS3
Introduction to HTML5 & CSS3Introduction to HTML5 & CSS3
Introduction to HTML5 & CSS3
 
Introduction to html 5
Introduction to html 5Introduction to html 5
Introduction to html 5
 
Untangling the web9
Untangling the web9Untangling the web9
Untangling the web9
 
Building an HTML5 Video Player
Building an HTML5 Video PlayerBuilding an HTML5 Video Player
Building an HTML5 Video Player
 
Web Standards
Web StandardsWeb Standards
Web Standards
 
Untangling the web10
Untangling the web10Untangling the web10
Untangling the web10
 

Similar a Building mobile applications with DrupalGap

Android Scripting
Android ScriptingAndroid Scripting
Android Scripting
Juan Gomez
 

Similar a Building mobile applications with DrupalGap (20)

Getting Started with DrupalGap
Getting Started with DrupalGapGetting Started with DrupalGap
Getting Started with DrupalGap
 
DrupalGap. How to create native application for mobile devices based on Drupa...
DrupalGap. How to create native application for mobile devices based on Drupa...DrupalGap. How to create native application for mobile devices based on Drupa...
DrupalGap. How to create native application for mobile devices based on Drupa...
 
DrupalGap. How to create native application for mobile devices based on Drupa...
DrupalGap. How to create native application for mobile devices based on Drupa...DrupalGap. How to create native application for mobile devices based on Drupa...
DrupalGap. How to create native application for mobile devices based on Drupa...
 
Drupal 8 and iOS - an Open Source App
Drupal 8 and iOS - an Open Source AppDrupal 8 and iOS - an Open Source App
Drupal 8 and iOS - an Open Source App
 
Made for Mobile - Let Office 365 Power Your Mobile Apps
Made for Mobile - Let Office 365 Power Your Mobile AppsMade for Mobile - Let Office 365 Power Your Mobile Apps
Made for Mobile - Let Office 365 Power Your Mobile Apps
 
Headless Drupal en pratique
Headless Drupal en pratiqueHeadless Drupal en pratique
Headless Drupal en pratique
 
Best Practices for Moving to Drupal 9
Best Practices for Moving to Drupal 9Best Practices for Moving to Drupal 9
Best Practices for Moving to Drupal 9
 
phonegap with angular js for freshers
phonegap with angular js for freshers    phonegap with angular js for freshers
phonegap with angular js for freshers
 
Best Practices for Moving to Drupal 9
Best Practices for Moving to Drupal 9Best Practices for Moving to Drupal 9
Best Practices for Moving to Drupal 9
 
Reaching out from ADF Mobile (ODTUG KScope 2014)
Reaching out from ADF Mobile (ODTUG KScope 2014)Reaching out from ADF Mobile (ODTUG KScope 2014)
Reaching out from ADF Mobile (ODTUG KScope 2014)
 
#D8CX: Upgrade your modules to Drupal 8 (Part 1 and 2)
#D8CX: Upgrade your modules to Drupal 8 (Part 1 and 2)#D8CX: Upgrade your modules to Drupal 8 (Part 1 and 2)
#D8CX: Upgrade your modules to Drupal 8 (Part 1 and 2)
 
#D8 cx: upgrade your modules to drupal 8
#D8 cx: upgrade your modules to drupal 8 #D8 cx: upgrade your modules to drupal 8
#D8 cx: upgrade your modules to drupal 8
 
Mobile Vue.js – From PWA to Native
Mobile Vue.js – From PWA to NativeMobile Vue.js – From PWA to Native
Mobile Vue.js – From PWA to Native
 
Google Cloud lightning talk @MHacks
Google Cloud lightning talk @MHacksGoogle Cloud lightning talk @MHacks
Google Cloud lightning talk @MHacks
 
Android Scripting
Android ScriptingAndroid Scripting
Android Scripting
 
Ramp Up Your Web Experiences Using Drupal and Apache Solr
Ramp Up Your Web Experiences Using Drupal and Apache SolrRamp Up Your Web Experiences Using Drupal and Apache Solr
Ramp Up Your Web Experiences Using Drupal and Apache Solr
 
Drupal Day 2012 - Automating Drupal Development: Make!les, Features and Beyond
Drupal Day 2012 - Automating Drupal Development: Make!les, Features and BeyondDrupal Day 2012 - Automating Drupal Development: Make!les, Features and Beyond
Drupal Day 2012 - Automating Drupal Development: Make!les, Features and Beyond
 
Oracle APEX & PhoneGap
Oracle APEX & PhoneGapOracle APEX & PhoneGap
Oracle APEX & PhoneGap
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Migrations
MigrationsMigrations
Migrations
 

Más de Alex S

Feeds. использование и создание плагинов. Feeds API
Feeds. использование и создание плагинов. Feeds APIFeeds. использование и создание плагинов. Feeds API
Feeds. использование и создание плагинов. Feeds API
Alex S
 

Más de Alex S (10)

Scaling and sharing: Building custom drupal distributions for federated organ...
Scaling and sharing: Building custom drupal distributions for federated organ...Scaling and sharing: Building custom drupal distributions for federated organ...
Scaling and sharing: Building custom drupal distributions for federated organ...
 
Drupal Training Days 2017 - Drupal 8 basic functions.
Drupal Training Days 2017 - Drupal 8 basic functions.Drupal Training Days 2017 - Drupal 8 basic functions.
Drupal Training Days 2017 - Drupal 8 basic functions.
 
Build your application in seconds and optimize workflow as much as you can us...
Build your application in seconds and optimize workflow as much as you can us...Build your application in seconds and optimize workflow as much as you can us...
Build your application in seconds and optimize workflow as much as you can us...
 
Ansible is the simplest way to automate. MoldCamp, 2015
Ansible is the simplest way to automate. MoldCamp, 2015Ansible is the simplest way to automate. MoldCamp, 2015
Ansible is the simplest way to automate. MoldCamp, 2015
 
Ansible is the simplest way to automate. SymfonyCafe, 2015
Ansible is the simplest way to automate. SymfonyCafe, 2015Ansible is the simplest way to automate. SymfonyCafe, 2015
Ansible is the simplest way to automate. SymfonyCafe, 2015
 
Drupal and diversity of Single sign-on systems
Drupal and diversity of Single sign-on systemsDrupal and diversity of Single sign-on systems
Drupal and diversity of Single sign-on systems
 
Getting started with Ansible. Be efficient.
Getting started with Ansible. Be efficient.Getting started with Ansible. Be efficient.
Getting started with Ansible. Be efficient.
 
Drush - use full power - DrupalCamp Donetsk 2014
Drush - use full power - DrupalCamp Donetsk 2014Drush - use full power - DrupalCamp Donetsk 2014
Drush - use full power - DrupalCamp Donetsk 2014
 
Drush. Secrets come out.
Drush. Secrets come out.Drush. Secrets come out.
Drush. Secrets come out.
 
Feeds. использование и создание плагинов. Feeds API
Feeds. использование и создание плагинов. Feeds APIFeeds. использование и создание плагинов. Feeds API
Feeds. использование и создание плагинов. Feeds API
 

Último

Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 

Último (20)

Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELLPVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
 
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 
Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01
 
chapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringchapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineering
 
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torque
 
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
 
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 

Building mobile applications with DrupalGap

  • 1. BUILDING MOBILE APPLICATIONS WITH DRUPALGAP SCHEDROV ALEXANDER ! SANCHIZ
  • 2. SCHEDROV ALEXANDER AKA SANCHIZ Lead Drupal Developer at Trellon Maintainer: • pathauto_i18n • user_profile_comment • DrupalGapManager https://github.com/Sanchiz/DrupalGapManager Participant: • crm_core • relation_lists
  • 3. “Never memorise what you can look up in books.” - Albert Einstein
  • 4. “Never memorise what you can look up IN YOUR PHONE.” - not Albert Einstein
  • 5. WHY WE NEED PROVIDES MOBILE APPLICATION TO OUR CUSTOMERS?
  • 6. MOBILE WEBSITE TRAFFIC Percentage of website traffic from mobile devices 32 24 16 8 0 30.0% 32.0% 29.0% 28.0% 23.9% Q1 2013 Q2 2013 Q3 2013 Q4 2013 Q1 2014
  • 7. REGULAR SITE Website + Responsive Website
  • 8. Site Drupal Bootstrap Receive response as markup Load CSS files Load JS files Load theme files(images, fonts) Load content images Show content to user Mobile application Drupal Bootstrap Receive response as JSON Load content images Show content to user
  • 9. HOW MOBILE APPLICATION DIFFERENT FROM RESPONSIVE SITE? Our mobile phone have features which don't have our regular devices! It’s handy!
  • 11. • Created by Tyler Frankenstein • First release Feb 25, 2012 ~100 lines • Currently ~10,000 lines
  • 12. DRUPALGAP Drupal module hosted on d.org It's connection between mobile applications and Drupal websites via web Services. Development Kit hosted on GitHub Developers can create custom multi-platform mobile applications that communicate with their Drupal websites.
  • 13. DRUPALGAP FEATURES You don't need a Objective-C and Java developers. ! If you know how to build Drupal modules and know JavaScript - Welcome to DrupalGap developers.
  • 14. DrupalGap application it’s a good example of using headless Drupal
  • 15.
  • 16. HOW IT WORKS? PhoneGap generates HTML, CSS and JavaScript and make application iOS and Android mobile devices. Apache Cordova provides access via JavaScript to device features such as the Camera, GPS, File System, Contacts, Compass, etc.
  • 17. TYPES OF SITES WHICH CAN USE MOBILE APPLICATION Any sites that you can imagine.
  • 19. DEVELOPMENT REQUIREMENTS ENVIRONMENTS 1. Google Chrome and Ripple Emulator extension 2. node.js cordova(node.js package) Java SDK for Android or xCode for iOS DRUPAL • services • rest_server • views_datasource • views_json
  • 20. DRUPALGAP INHERITS DRUPAL DEVELOPER CONCEPTS • Themes, modules • Blocks • Menus • Pages • Entities • Fields • Forms • Views • Messages • Services • Other Drupal tools
  • 21. EXTENSIBLE WITH CONTRIB MODULES • Force Authentication • Telephone • Address Field • AmazonS3 • AudioField • Colorbox • Commerce • Commerce DrupalGap Stripe • Date • Email Registration • Entity reference • Fivestar • Flag • Geofield • GeoTracker • Link • Location • LoginToboggan • Pathfix • Push Notifications • Rate • Services Menu • Shadowbox • User registration password • Voting API • Webform http://www.drupalgap.org/project/modules
  • 23. We have a special tool for the Jedi!
  • 24. DRUPALGAP MANAGER is a command-line tool and interface for DrupalGap https://github.com/Sanchiz/DrupalGapManager https://www.npmjs.org/package/dgm
  • 27. GEOLOCATION var onSuccess = function(position) { console.log(position); }; var onError = function(error) { console.log(error.message); } navigator.geolocation.getCurrentPosition(onSuccess, onError); var onSuccess = function(position) { console.log(position); } var onError = onError(error) { console.log(error.message); } ! // Update is received every 30 seconds. var watchID = navigator.geolocation.watchPosition( onSuccess, onError, { timeout: 30000 } );
  • 28. CAMERA ACCESS AND FILE BROWSER
  • 29. PUSH NOTIFICATIONS Sender Cloud server Target device Google Cloud Messaging or Apple Push Notification Service Drupal site Other systems
  • 30. Drupal module: https://www.drupal.org/project/push_notifications Cordova plugin: https://github.com/phonegap-build/PushPlugin DrupalGap module: https://github.com/signalpoint/push_notifications Rules integration in 7.x-1.x-dev: https://www.drupal.org/node/ 1658132#comment-8512423
  • 31. EXTENSIBLE WITH CORDOVA PLUGINS http://plugins.cordova.io
  • 33. DRUPAL 8 RESTful Web Services in Core
  • 34. DRUPAL 8 Views supports REST
  • 35. #D8CX All that we need - update DrupalGap SDK according to the changes in Drupal 8. #D8CX: I pledge that DrupalGap will have a full Drupal 8 release on the day that Drupal 8 is released (c) Tyler
  • 37. FILE STRUCTURE modules custom themes settings.js
  • 38. • MODULE_NAME (module folder) • MODULE_NAME.js (module file) /** * Implements hook_menu(). */ function MODULE_NAME_menu() { } ! function MODULE_NAME_homepage() { } app/settings.js: var items = {}; items['homepage'] = { title: 'New Sandbox', page_callback: 'MODULE_NAME_homepage' }; return items; var content = {}; content['homepage'] = { markup: 'some markup' }; return content; Drupal.modules.custom['MODULE_NAME'] = {};
  • 39. app/settings.js: drupalgap.settings.menus['homepage_menu'] = { links:[ {title:'News', path:'news'}, {title:'About', path:'node/1'}, {title:'Contact', path:'contact'}, {title:'Our team', path:'team'} ] };
  • 40. drupalgap.settings.blocks.THEME_NAME = { content: { homepage_menu: { pages:{ value:['homepage'], mode:'include' } }, users_block: { pages:{ value:['node/*', 'user/*'], mode:'include' }, roles:{ value:['authenticated user'], mode:'include' } }, }, }; app/settings.js: page.tpl.html <div id="{:drupalgap_page_id:}" data-role="page"> {:header:} {:navigation:} {:content:} {:footer:} </div>
  • 41. VIEWS 1. Need to create page with JSON data document format (views_json module) 2. Implement hook_menu 3. Implement page_callback 4. Implement row_callback(function to process and render each row)
  • 42. function MODULE_NAME_menu() { var items = {}; items['team'] = { title: 'Our team', page_callback: 'MODULE_NAME_page' } return items; } app/modules/custom/module_name/module_name.js:
  • 43. function MODULE_NAME_page() { var content = {}; content['team'] = { theme: 'view', format: ‘ul', /* ul, ol, table, unformatted_list */ path: 'mobile/team_new', /* the path to the view in Drupal */ row_callback: 'MODULE_NAME_page_row', empty_callback: 'MODULE_NAME_page_empty', attributes: { id: 'team-view' } }; return content; } ! function MODULE_NAME_page_row(view, row) { var output = ''; output += '<img class="team-image" src="' + row.field_photo + '">'; output += l(row.title, 'node/' + row.Nid); return output; } ! function MODULE_NAME_page_empty(view) { return 'Sorry, no results.'; } app/modules/custom/module_name/module_name.js:
  • 44. NEED ADDITIONAL FUNCTIONALITY? YOU GOT IT! 1. Create custom services resource in Drupal module hook_services_resources(); 2. Create custom services call in DrupalGap module Drupal.services.call(options); var output = ''; Drupal.services.call({ method: 'POST', path: 'news.json', data: args, success: function(result) { output = ''; $.each(result, function(i, node) { output += node.title; }); } });
  • 46. ANDROID Devices Android 2.1 (Deprecated May 2013) Android 2.2 Android 2.3 Android 3.x (Deprecated May 2013) Android 4.x Development Any OS JDK 6+ and Apache Ant Developer license: $25 one time
  • 47. IOS Devices iOS Device with at least iOS 5.x+ Development Intel-based Computer with Mac OS X Lion or greater (10.7.4+) Xcode Command Line Tools Xcode 4.5+ and iOS 6 SDK Developer license: $99 per year
  • 48. CONCLUSION • DrupalGap is growing • Needs support from a community • We have incredible tool that allows us to build mobile application from scratch
  • 49. THANK YOU! https://www.drupal.org/u/sanchiz https://github.com/Sanchiz http://sanchiz.net Email: alexander.schedrov@gmail.com Twitter: @alexschedrov