Using Drupal as a backend for Android app

24
BarCamp Phnom Penh – 13-14 Sep 2014 Borort Sort [email protected] as a backend for Android app

description

Drupal is one of the best content management systems on the planet that meets most of the requirements from building personal blogs to more sophisticated enterprise applications. Thousands of add-on modules and designs let you build any site you can imagine and also provide backend data services for mobile applications. Drupal’s built, used, and supported by an active and diverse community of people around the world, which makes it not only a reliable CMS but also a perfect backend platform for app development.

Transcript of Using Drupal as a backend for Android app

Page 1: Using Drupal as a backend for Android app

BarCamp Phnom Penh – 13-14 Sep 2014

Borort [email protected]

as a backend for Android app

Page 2: Using Drupal as a backend for Android app
Page 3: Using Drupal as a backend for Android app
Page 4: Using Drupal as a backend for Android app
Page 5: Using Drupal as a backend for Android app
Page 6: Using Drupal as a backend for Android app
Page 7: Using Drupal as a backend for Android app

So.. again, WHY Drupal?

Page 8: Using Drupal as a backend for Android app
Page 9: Using Drupal as a backend for Android app
Page 10: Using Drupal as a backend for Android app
Page 11: Using Drupal as a backend for Android app
Page 12: Using Drupal as a backend for Android app

Why use Drupal to manage Mobile app data?

Page 13: Using Drupal as a backend for Android app

• Has everything you need for content management and permissions

• Very flexible in providing a JSON REST interface

• Don’t have to write lots of server-side code from scratch

• Large Drupal community support

Page 14: Using Drupal as a backend for Android app

Configuring Drupal to be the backend for Mobile

• Install Services 3 module for Drupal to act as a REST server

• Set up an endpoint URL for the REST service

• Enable resources to expose at that endpoint

Page 15: Using Drupal as a backend for Android app

Drupal Services 3.0

• A standardized solution of integrating external applications with Drupal

• Resource oriented (CRUD = create, retrieve, update, delete, index)

• Provide web services via multiple interfaces (REST, XMLRPC, SOAP, JSON, etc.)

Page 16: Using Drupal as a backend for Android app

Service Endpoint

• [endpoint]/node.json• [endpoint]/node/1.json• [endpoint]/node.json?

parameters[nid]=1

Page 17: Using Drupal as a backend for Android app

Drupal Services Views

• Create view based resource creating Services display in a view

[endpoint]/[resource name]

[endpoint]/[resource name]?tags=1

• Execute any view via views resource call

[endpoint]/views/[view name]

[endpoint]/views/[view name]? filters[tags]=1

Page 18: Using Drupal as a backend for Android app
Page 19: Using Drupal as a backend for Android app

Why REST?

• Use standard HTTP protocol (simple data access)

• Performance (Local caching)• Multiple data formats (JSON, XML, ..)

Page 20: Using Drupal as a backend for Android app

JSON

Page 21: Using Drupal as a backend for Android app

Connecting Android to Drupal

Page 22: Using Drupal as a backend for Android app

Classes

• JSONParser (custom)• AsynTask

Page 23: Using Drupal as a backend for Android app

DEMO

Page 24: Using Drupal as a backend for Android app

Thank you!