app-ify drupal
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
Charted territory
๏ GreatBrewers.com & BeerCloud app(http://drupal.org/node/659772)
๏ DrupalCon SF session(http://sf2010.drupal.org/conference/sessions/developing-apps-iphoneipadandroid-using-drupal-base-system)
๏ How to build a native app(http://goodold.se/blog/tech/integrate-iphone-app-drupal)
6
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
Pick your poison
๏ XML-RPC, JSON, SOAP, REST
๏ Titanium is Javascript, so I’ll JSON
๏ There’s always a catch
๏ Need to patch json_server(http://civicactions.com/blog/2010/apr/30/drupalcon_developing_apps_iphoneipadandroid_using_drupal_base_system#comment-3580)
16
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
Demo time
23
Edmonton FringFest app(http://itunes.apple.com/ca/app/edmonton-fringefest/
id385446133?mt=8)