Alfresco Android Mobile SDK

25 downloads 13345 Views 2MB Size Report
Agenda. • Introducing Android SDK. • Deep Dive. • Apache Chemistry Android Client. • Android SDK : Client API. • Android SDK : ASYNC API. • Android SDK : UI ...
Alfresco Android Mobile SDK Jean Marie PASCAL @jeanmariepascal #Android #Mobile #SDK

Agenda • Introducing Android SDK • Deep Dive • • • •

Apache Chemistry Android Client Android SDK : Client API Android SDK : ASYNC API Android SDK : UI Library • Demo : SDK Sample application

• One extra thing ? • Question time

About Me • Jean Marie PASCAL • Now • Android Developer @Alfresco

• Apache Committer : Android Client for OpenCMIS

• Previously • Amateur in Android development • Creator of first Alfresco/CMIS Android Application

• Worked for 4 years as Alfresco integrator

• Alfresco community member

What about you ?

Introduction

Alfresco Mobile SDK Overview • Allow access to Alfresco functionality • On Premise (3.4 and above) • On Cloud

• V 1.0 : Released in October 2012 • License Apache 2.0 • Download package • https://developer.alfresco.com/mobile

• Source Code • https://github.com/Alfresco/alfresco-android-sdk

SDK: A Mobile Tools provider

Samples

UI Component

Client API

Where are we?

Deep Dive Alfresco Android SDK

What’s inside? Applications UI Components

Async API Client API Alfresco OpenCMIS Extension

OpenCMIS Android Client

Powered by Maven • Overview • We use android-maven-plugin

• Developers can use Android SDK • as Default Android project • pom.xml is ignored in this case

• as Maven Project • dependencies are managed by Maven

SDK in figures… Summary • One maven multi module projects • 11 projects • SDK : 3 projects (13500 loc) • Samples : 3 projects (2500 loc) • Tests : 5 projects (7500 loc)

• 4 direct dependencies • android, opencmis android client, slf4j, opencmis alfresco extension

Apache Chemistry

OpenCMIS Android Client

Apache Chemistry – Android Client Summary • Started first quarter 2012 by

• Officially released in October 2012 with OpenCMIS 0.8.0 • License Apache 2.0 • Download package available here • http://chemistry.apache.org/java/download.html

OpenCMIS Android Client Overview • Supports CMIS 1.0 (1.1 in a near future)

• Try to provide the same level of services & models than OpenCMIS Java Client ! • Same code can works both on mobile and desktop/server • Supports Android 2.3 and above

• Packaged as One single jar file !

OpenCMIS Android Client Restriction • AtomPub Binding ONLY (no Web Services !) • Plan to support Json Binding for CMIS 1.1

• Currently not supported • Policy Management • ACL Management

OpenCMIS Android Client is SYNCHRONOUS ! UI Thread

Background Thread

Code Sample

CMIS & Apache Chemistry There’s a book for that !

Available http://www.manning.com/mueller/

OpenCMIS Android Client : Use Case Use it if you want… • Data and nothing else matters ! • to support others CMIS vendors • to reuse your OpenCMIS code

Alfresco Android SDK Client API

Alfresco Android SDK – Client API Summary • Leverage OpenCMIS Principle

• Add Alfresco philosophy : services & objects • V1.0 • Support Cloud & OnPremise (3.4 and above) • Common part for all Alfresco • Supports Android 2.3 and above

• Packaged as One single jar file !

Client API – Session Object • Session object is at the heart of SDK ! • Responsible to provide • Services • Repository Information • Authentication Provider

• Configurable via Parameters • 2 types • CloudSession • RepositorySession (for on premise)

Client API - Services • Do you know about • Alfresco foundation services? • Alfresco Service Registry?

• We have implemented the same idea !

Client API – Services Extension • Do you know it’s possible to extend them ? • How to • Create CustomServiceRegistry extends ServiceRegistry • Create CustomRatingsService extends RatingsService • Implement your new methods

• During session creation provide the parameter • ONPREMISE_SERVICES_CLASSNAME • CLOUD_SERVICES_CLASSNAME

Client API - Model • High Level Objects • Contains information from server • They are usable on UI Thread !

How to use all of this… • Inside your eclipse • Create or open an Android project • Create libs folder and add libs in it • Alfresco Client API • Alfresco OpenCMIS Extension

• OpenCMIS • slf4j

• Start Coding !

Sample Code

Android Client API : Use Case Use it if… • • • •

You want data from Alfresco onPremise You want data from Alfresco Cloud You want to retrieve Alfresco Services You already have a mobile application

Android Asynchronous Layer

Asynchronous API Overview • Based on Android Loaders object • One of Android background thread mechanism

• Supports Android 3.X and above • It’s possible to use support library to use it in 2.3

• Packaged as One single jar file !

Asynchronous API : Use Case Use it if… • You start a new project • You like loaders ! • You are a beginner in Android project

Don’t use it if… • You already have your mechanism

Alfresco Android SDK UI Library

UI Library • Overview • Provides extensible re-usable UI components & utilities • Supports Android 3.X and above • Possibility to use support library to use it in 2.3

• Packaged as Android Library Project (apklib)

UI Library : Fondations • Images Ressources • file type icon, logo…

• Themes • Color scheme, Layout template…

• Localisation Ressources • English only (for the moment)

UI Library : Components • Fragments • Reusable piece of UI

• Adapters • Template for creating listview of content

• Managers • Utils class for storage, thumbnail…

Demo Time Alfresco Sample Application

Android UI Library : Use Case Use it if… • You want to create a quick win new mobile project • You already use an application with fragments • You want to create a tablet application

One extra thing ?

It’s about an application…

To infinity and beyond !

So are you ready ?

Are you ready?

And don’t forget… Do Great Work !

Thank You !