Date post: | 01-Dec-2014 |
Category: |
Presentations & Public Speaking |
Upload: | borort-sort |
View: | 167 times |
Download: | 3 times |
So.. again, WHY Drupal?
Why use Drupal to manage Mobile app data?
• 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
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
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.)
Service Endpoint
• [endpoint]/node.json• [endpoint]/node/1.json• [endpoint]/node.json?
parameters[nid]=1
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
Why REST?
• Use standard HTTP protocol (simple data access)
• Performance (Local caching)• Multiple data formats (JSON, XML, ..)
JSON
Connecting Android to Drupal
Classes
• JSONParser (custom)• AsynTask
DEMO
Thank you!