25
Alfresco Mobile SDKs Agenda Overview – Why, What & How? – Gavin Cornwell Android SDK – Jean Marie Pascal iOS SDK – Peter Schmidt

Alfresco tech talk live mobile sdks

Embed Size (px)

DESCRIPTION

Slide deck to accompany Tech Talk Live on Alfresco's SDKs for Android and iOS.

Citation preview

Page 1: Alfresco tech talk live mobile sdks

Alfresco Mobile SDKs Agenda

•  Overview – Why, What & How? – Gavin Cornwell

•  Android SDK – Jean Marie Pascal

•  iOS SDK – Peter Schmidt

Page 2: Alfresco tech talk live mobile sdks

Overview – Why?

•  Simplify Access To Alfresco From Mobile Devices

•  Uniform API To Access On-Premise Servers and The Cloud

•  Enable 3rd party App Integration •  Rapidly Build Alfresco Based Apps •  Used For All Future Alfresco Apps

Page 3: Alfresco tech talk live mobile sdks

Overview – What?

Page 4: Alfresco tech talk live mobile sdks

Overview – Sample App

Page 5: Alfresco tech talk live mobile sdks

Overview – How?

Page 6: Alfresco tech talk live mobile sdks

Overview – How?

Page 7: Alfresco tech talk live mobile sdks

Overview – How?

•  Create Session •  Use Services •  Retrieve Model Objects •  Handles Asynchronous Calls For You

Page 8: Alfresco tech talk live mobile sdks

Android SDK

Page 9: Alfresco tech talk live mobile sdks

In Android world… •  A common Android Application is made of

–  Activities •  provides a screen with which users can

interact in order to do something –  Fragments (Available in android 3+)

•  represents a behavior or a portion of user interface

–  Loaders (Available in android 3+)

•  make it easy to asynchronously load data in an activity or fragment

–  Services •  request information remotely to content

repository and are responsible for creating data objects.

Page 10: Alfresco tech talk live mobile sdks

What Alfresco Mobile - Android SDK provides… •  Synchronous Alfresco Services API

–  High level services + objects

•  Asynchronous API –  Loaders

•  UI Component Library –  Fragments, Adapter and manager

•  Sample application –  Demonstrate how to use components

Page 11: Alfresco tech talk live mobile sdks

It’s not just one project…

Alfresco OpenCMIS Extension

Alfresco Mobile Repository API

Alfresco Mobile Async API

Alfresco Mobile UI Components

Alfresco Applications (sample…)

APKLIB

APK

Android OpenCMIS JAR

JAR

JAR

JAR

Works on Android versions superior to 2.1

Works on Android version superior to 3.0

Dependency

Page 12: Alfresco tech talk live mobile sdks

Support is possible…

Alfresco OpenCMIS Extension

Alfresco Mobile Repository API

Alfresco Mobile Async API

Alfresco Mobile UI Components

Alfresco Applications (sample…)

APKLIB

APK

Android OpenCMIS JAR

JAR

JAR

JAR

Works on Android versions superior to 2.1

Android support library JAR

Dependency

Not provided

Page 13: Alfresco tech talk live mobile sdks

UI Library •  Provides

–  Images Ressources •  file type icon, logo…

–  Themes •  Color scheme, Layout template…

–  Localization Resources –  Fragments and adapters

•  Activities List, •  Folder list, •  Comments List…

Page 14: Alfresco tech talk live mobile sdks

Demo Time

Page 15: Alfresco tech talk live mobile sdks

Use cases

•  Create an application from scratch –  Extends and customize the sample application

•  Add Alfresco oriented screen to an existing application –  Use the ApkLib UI component and add a fragment

(Android 3+)

•  Just need data –  Use the repository API

Page 16: Alfresco tech talk live mobile sdks

So are you ready to level up ?

Page 17: Alfresco tech talk live mobile sdks

Alfresco Mobile SDK

Page 18: Alfresco tech talk live mobile sdks

What’s included ?

Sample App

Mobile API Library Included Objective CMIS library

Documentation (appledoc docset)

Page 19: Alfresco tech talk live mobile sdks

What are the libraries ? Alfresco Mobile API

(+headers) •  Asynchronous handling of

requests •  E.g. download/upload

documents •  Additional Services, e.g.

•  Comments •  Tagging •  Rating •  Activity

•  Encapsulates low level CMIS calls

Objective CMIS Library (+headers)

•  Low level library to handle CMIS sessions, requests & services

•  Provides CMIS standard services, e.g.

•  Document/Folder (e.g. upload/create/download)

•  Versioning •  Search

•  Mostly synchronous request •  Collaborative project •  Planned to add to Apache CMIS

project

Page 20: Alfresco tech talk live mobile sdks

iOS Specifics •  Naming conventions

–  Objective CMIS code prefixed with CMIS –  Mobile API code prefixed with Alfresco

•  Error Handling –  No exceptions in iOS apps, use NSError instead

•  As per Apple standard: –  NSError object remains nil if method call is successful. Always check!

•  ARC (Automatic Reference Counting)* –  No more retain, release, autorelease on objects

•  Blocks –  Used extensively in Mobile API to handle asynchronous requests and callbacks

* requires iOS 5.x or later for full support

^(<parameter list>){ execution code }

Page 21: Alfresco tech talk live mobile sdks

iOS SDK – Async Handling

Repository

If(nil == error) { self.session = session; } else { UIAlertView *alert = [[UIAlertView. Alloc]……….. }

Alfresco Mobile API

CMIS/REST API

Background thread

Main thread

In Sample App code

Page 22: Alfresco tech talk live mobile sdks

How do Objective C Blocks fit in?

•  Blocks were introduced in iOS 4, Mac OSX 10.6

•  Ad hoc functionality that can be passed on like parameters

•  Mobile API uses blocks as callbacks once requests complete –  You define what your app/code needs to do within a

block

Page 23: Alfresco tech talk live mobile sdks

Example – Create Session NSURL *url = [NSURL URLWithString:host]; [AlfrescoRepositorySession connectWithUrl:url

username:username password:pwd settings:nil

completionBlock:^(id<AlfrescoSession> session, NSError *error){ if (nil != error) {

/* Your error handling code goes here */ }

else { self.session = session; NSLog(@"Authenticated successfully."); } }];

Page 24: Alfresco tech talk live mobile sdks

iOS Sample App Demo

Page 25: Alfresco tech talk live mobile sdks

Thank You!