SlideShare a Scribd company logo
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
Building mobile applications with DrupalGap
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

More Related Content

PPT
jQuery For Beginners - jQuery Conference 2009
Ralph Whitbeck
 
PDF
Taiwan Web Standards Talk 2011
Zi Bin Cheah
 
PDF
HTML5 & Friends
Remy Sharp
 
PDF
Realize mais com HTML 5 e CSS 3 - 16 EDTED - RJ
Leonardo Balter
 
PDF
Keypoints html5
dynamis
 
PPTX
What is HTML 5?
Susan Winters
 
PDF
Web Standards: Fueling Innovation [Web Design World Boston '08]
Aaron Gustafson
 
PDF
Dreamweaver CS6, jQuery, PhoneGap, mobile design
Dee Sadler
 
jQuery For Beginners - jQuery Conference 2009
Ralph Whitbeck
 
Taiwan Web Standards Talk 2011
Zi Bin Cheah
 
HTML5 & Friends
Remy Sharp
 
Realize mais com HTML 5 e CSS 3 - 16 EDTED - RJ
Leonardo Balter
 
Keypoints html5
dynamis
 
What is HTML 5?
Susan Winters
 
Web Standards: Fueling Innovation [Web Design World Boston '08]
Aaron Gustafson
 
Dreamweaver CS6, jQuery, PhoneGap, mobile design
Dee Sadler
 

What's hot (20)

PDF
Road to Rails
paoloperrotta
 
PDF
Progressive Enhancement 2.0 (jQuery Conference SF Bay Area 2011)
Nicholas Zakas
 
ODP
HTML5
Hatem Mahmoud
 
PPTX
Css, xhtml, javascript
Trần Khải Hoàng
 
PPT
Lecture 3 Javascript1
Sur College of Applied Sciences
 
PDF
HTML5 JS APIs
Remy Sharp
 
PDF
HTML 5 Step By Step - Ebook
Scottperrone
 
PDF
Jumping Into WordPress Plugin Programming
Dougal Campbell
 
PDF
BDD - Writing better scenario
Arnauld Loyer
 
PDF
HTML5 and the web of tomorrow!
Christian Heilmann
 
PDF
HTML5 Essentials
Marc Grabanski
 
PDF
An Introduction To HTML5
Robert Nyman
 
KEY
An Introduction to HTML5
Steven Chipman
 
PPSX
Introduction to Html5
www.netgains.org
 
PPTX
Introduction to HTML5 & CSS3
Pradeep Varadaraja Banavara
 
PDF
Introduction to html 5
Nir Elbaz
 
PPTX
Untangling the web9
Derek Jacoby
 
PDF
Building an HTML5 Video Player
Jim Jeffers
 
PDF
Web Standards
Helior Colorado
 
PPTX
Untangling the web10
Derek Jacoby
 
Road to Rails
paoloperrotta
 
Progressive Enhancement 2.0 (jQuery Conference SF Bay Area 2011)
Nicholas Zakas
 
Css, xhtml, javascript
Trần Khải Hoàng
 
Lecture 3 Javascript1
Sur College of Applied Sciences
 
HTML5 JS APIs
Remy Sharp
 
HTML 5 Step By Step - Ebook
Scottperrone
 
Jumping Into WordPress Plugin Programming
Dougal Campbell
 
BDD - Writing better scenario
Arnauld Loyer
 
HTML5 and the web of tomorrow!
Christian Heilmann
 
HTML5 Essentials
Marc Grabanski
 
An Introduction To HTML5
Robert Nyman
 
An Introduction to HTML5
Steven Chipman
 
Introduction to Html5
www.netgains.org
 
Introduction to HTML5 & CSS3
Pradeep Varadaraja Banavara
 
Introduction to html 5
Nir Elbaz
 
Untangling the web9
Derek Jacoby
 
Building an HTML5 Video Player
Jim Jeffers
 
Web Standards
Helior Colorado
 
Untangling the web10
Derek Jacoby
 
Ad

Similar to Building mobile applications with DrupalGap (20)

PDF
Getting Started with DrupalGap
Alex S
 
PDF
DrupalGap. How to create native application for mobile devices based on Drupa...
DrupalCampDN
 
PDF
DrupalGap. How to create native application for mobile devices based on Drupa...
Alex S
 
PDF
Drupal for Mobile
littleMAS
 
PPT
Mobile Interface to CMS Based On HTML5 and Drupal: A Case Study
Hima Javvadi
 
PPTX
Mobile-izing Your Organization with Drupal
Acquia
 
PDF
Drupalcamp armedia phonegap_oct2012_print
DrupalcampAtlanta2012
 
KEY
Drupal & Mobile
James Walker
 
PPTX
Briding the Gap between Desktop and Mobile publishing
Tom Deryckere
 
PDF
Build Mobile Apps Using PhoneGap and Drupal by Tyler Frankenstein
littleMAS
 
PPTX
Drupal Business Summit - making your sites mobile accessible, four methods.
Promet Source
 
PPTX
Drupal Business Summit - making your sites mobile accessible, four methods
Andy Kucharski
 
PPT
Drupal and mobile devices komelin konstanin (eng)
drupalconf
 
PDF
Responsive & Ready: Why Drupal 8 is Ideal for Building Mobile-first Experienc...
Acquia
 
PPTX
Power your mobile app with Drupal - Melbourne Mobile, July 2013
Chris Ward
 
KEY
For a Social Local and Mobile Drupal
Adyax
 
PDF
HTML5 Mobile Application Framework
Thanh Nguyen
 
PPT
Drupalcamp LA Aug 2009
Tom Deryckere
 
PPT
DrupalCon Chicago 2011 ReportBack (11/03/30 - G. Bedford)
DrupalCape
 
PPTX
Drupal as a Framework for Mobile Development
Rachel Jaro
 
Getting Started with DrupalGap
Alex S
 
DrupalGap. How to create native application for mobile devices based on Drupa...
DrupalCampDN
 
DrupalGap. How to create native application for mobile devices based on Drupa...
Alex S
 
Drupal for Mobile
littleMAS
 
Mobile Interface to CMS Based On HTML5 and Drupal: A Case Study
Hima Javvadi
 
Mobile-izing Your Organization with Drupal
Acquia
 
Drupalcamp armedia phonegap_oct2012_print
DrupalcampAtlanta2012
 
Drupal & Mobile
James Walker
 
Briding the Gap between Desktop and Mobile publishing
Tom Deryckere
 
Build Mobile Apps Using PhoneGap and Drupal by Tyler Frankenstein
littleMAS
 
Drupal Business Summit - making your sites mobile accessible, four methods.
Promet Source
 
Drupal Business Summit - making your sites mobile accessible, four methods
Andy Kucharski
 
Drupal and mobile devices komelin konstanin (eng)
drupalconf
 
Responsive & Ready: Why Drupal 8 is Ideal for Building Mobile-first Experienc...
Acquia
 
Power your mobile app with Drupal - Melbourne Mobile, July 2013
Chris Ward
 
For a Social Local and Mobile Drupal
Adyax
 
HTML5 Mobile Application Framework
Thanh Nguyen
 
Drupalcamp LA Aug 2009
Tom Deryckere
 
DrupalCon Chicago 2011 ReportBack (11/03/30 - G. Bedford)
DrupalCape
 
Drupal as a Framework for Mobile Development
Rachel Jaro
 
Ad

More from Alex S (10)

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

Recently uploaded (20)

PDF
Traditional Exams vs Continuous Assessment in Boarding Schools.pdf
The Asian School
 
PDF
Unit I Part II.pdf : Security Fundamentals
Dr. Madhuri Jawale
 
PPTX
Practice Questions on recent development part 1.pptx
JaspalSingh402
 
PDF
Queuing formulas to evaluate throughputs and servers
gptshubham
 
PPTX
Simulation of electric circuit laws using tinkercad.pptx
VidhyaH3
 
PPTX
Edge to Cloud Protocol HTTP WEBSOCKET MQTT-SN MQTT.pptx
dhanashri894551
 
PPTX
Lesson 3_Tessellation.pptx finite Mathematics
quakeplayz54
 
PDF
Introduction to Data Science: data science process
ShivarkarSandip
 
PDF
오픈소스 LLM, vLLM으로 Production까지 (Instruct.KR Summer Meetup, 2025)
Hyogeun Oh
 
PPTX
Module2 Data Base Design- ER and NF.pptx
gomathisankariv2
 
PDF
flutter Launcher Icons, Splash Screens & Fonts
Ahmed Mohamed
 
PDF
LEAP-1B presedntation xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
hatem173148
 
PDF
2010_Book_EnvironmentalBioengineering (1).pdf
EmilianoRodriguezTll
 
PPTX
The-Looming-Shadow-How-AI-Poses-Dangers-to-Humanity.pptx
shravanidabhane8
 
PDF
A Framework for Securing Personal Data Shared by Users on the Digital Platforms
ijcncjournal019
 
PPTX
MET 305 MODULE 1 KTU 2019 SCHEME 25.pptx
VinayB68
 
PDF
Chad Ayach - A Versatile Aerospace Professional
Chad Ayach
 
PPTX
anatomy of limbus and anterior chamber .pptx
ZePowe
 
PDF
FLEX-LNG-Company-Presentation-Nov-2017.pdf
jbloggzs
 
PDF
Principles of Food Science and Nutritions
Dr. Yogesh Kumar Kosariya
 
Traditional Exams vs Continuous Assessment in Boarding Schools.pdf
The Asian School
 
Unit I Part II.pdf : Security Fundamentals
Dr. Madhuri Jawale
 
Practice Questions on recent development part 1.pptx
JaspalSingh402
 
Queuing formulas to evaluate throughputs and servers
gptshubham
 
Simulation of electric circuit laws using tinkercad.pptx
VidhyaH3
 
Edge to Cloud Protocol HTTP WEBSOCKET MQTT-SN MQTT.pptx
dhanashri894551
 
Lesson 3_Tessellation.pptx finite Mathematics
quakeplayz54
 
Introduction to Data Science: data science process
ShivarkarSandip
 
오픈소스 LLM, vLLM으로 Production까지 (Instruct.KR Summer Meetup, 2025)
Hyogeun Oh
 
Module2 Data Base Design- ER and NF.pptx
gomathisankariv2
 
flutter Launcher Icons, Splash Screens & Fonts
Ahmed Mohamed
 
LEAP-1B presedntation xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
hatem173148
 
2010_Book_EnvironmentalBioengineering (1).pdf
EmilianoRodriguezTll
 
The-Looming-Shadow-How-AI-Poses-Dangers-to-Humanity.pptx
shravanidabhane8
 
A Framework for Securing Personal Data Shared by Users on the Digital Platforms
ijcncjournal019
 
MET 305 MODULE 1 KTU 2019 SCHEME 25.pptx
VinayB68
 
Chad Ayach - A Versatile Aerospace Professional
Chad Ayach
 
anatomy of limbus and anterior chamber .pptx
ZePowe
 
FLEX-LNG-Company-Presentation-Nov-2017.pdf
jbloggzs
 
Principles of Food Science and Nutritions
Dr. Yogesh Kumar Kosariya
 

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
  • 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: [email protected] Twitter: @alexschedrov