App-ify drupal

Post on 04-Dec-2014

6,876 views 0 download

description

 

transcript

App-ify DrupalUsing Titanium and Servicesto put your web site in theApp StoreJoshua SchroederDrupal Camp Alberta 2010September 12, 2010

Session Resources

๏ Presentation slides(http://slideshare.net/jdschroeder and http://jdschroeder.ca)

๏ Drupal site(http://github.com/jdschroeder/appify-drupal)

๏ Titanium project(http://github.com/jdschroeder/titanium-drupal)

2

Hello, my name is Josh

and I like iPhones

3

I also like Drupal4

Obviously

5

this means I should put Drupal on my iPhone

The easy wayLet someone else write

Objective-C for us.

7

Appcelerator Titanium

๏ http://appcelerator.com

๏ Open source

๏ Write your apps using Javascript

๏ Compile to native iOS and Android apps

๏ vs. Phone Gap’s end-to-end web apps

๏ Limited to Titanium API

8

Even the kitchen sink

Learn by example with the Kitchen Sink app

(http://github.com/appcelerator/KitchenSink)

9

What about 3.3.1?

“Titanium produces a valid XCode project at application creation, generates Objective-C (and sometimes C/C++) and executes the xcodebuild to compile your XCode project into a native application using Apple’s published APIs.”(http://developer.appcelerator.com/blog/2010/04/update-on-apple-sdk-4-0-and-tos.html)

10

What about it?

“In particular, we are relaxing all restrictions on the development tools used to create iOS apps, as long as the resulting apps do not download any code. This should give developers the flexibility they want, while preserving the security we need.”(http://www.apple.com/pr/library/2010/09/09statement.html)

11

Web apps vs. Native

๏ Benefits of a native app(http://alistapart.com/articles/apps-vs-the-web)

๏ Speed, data management, animation, resources, usability, productivity, integration

๏ Your Drupal nodes are already on the web(http://drupal.org/project/iwebkit)

12

Have your cake...

with the Services module(http://drupal.org/project/services)

13

nodes users system views

services(XML-RPC, JSON, REST, SOAP, etc.)

nod

e.vi

ew, u

ser.g

et,

syst

em.c

onne

ct

node.save, user.save,

system.w

atchdog

In our tool belt

๏ Xcode/iPhone SDK(http://developer.apple.com/iphone)

๏ Appcelerator Titanium(http://developer.appcelerator.com)

๏ Drupal Services Module(http://drupal.org/project/services)

๏ JSON Server(http://drupal.org/project/json_server)

14

Set-up your Drupal site๏ For this demo I’ve enabled these modules:

๏ admin_menu

๏ content, text

๏ imagecache

๏ views, views_ui

๏ services, node_service, views_service

๏ json_server

15

What data to share?

๏ Let’s build a directory of WHL hockey arenas

๏ Content type for teams

๏ Fields for arena name and location (latitude and longitude) and team logo

๏ View to list teams

17

How it looks online

18

Services browser

๏ admin/services/browse

๏ List the servers and services available to us

๏ Document the required and optional arguments

๏ Preview the data returned by the service

19

Let’s build an app

20

What’s missing?

21

๏ Saving nodes or comments back to the site.

๏ User authentication

๏ Really, we should create a service user and role, then always authenticate

Further reading

๏ Existing Drupal/Titanium API Resources(http://groups.drupal.org/node/81519)

๏ Appcelerator API Documentation(http://developer.appcelerator.com/apidoc/mobile/latest)

๏ Titanium API Drupal Group(http://groups.drupal.org/titanium-api)

22

Questionswww.jdschroeder.ca

24