Building solutions on the Microsoft platform that target iPhone, iPad, and Android devices

Post on 09-May-2015

15.160 views 5 download

description

Presentation from recent webcast - Building solutions on the Microsoft platform that target iPhone, iPad, and Android devices.

Transcript of Building solutions on the Microsoft platform that target iPhone, iPad, and Android devices

Building Solutions on the Microsoft Platformthat target iPhone, iPad, and Android

Simon GuestDirector, Mobility Solutionssimon.guest@neudesic.com

Lie, Damned Lies, and Statistics

Lie, Damned Lies, and Statistics

January 2010

RIMiOSAndroidWM6/WP7PalmOther

www.comscore.com/Products_Services/Product_Index/MobiLens (trend used for Dec and Mar)

Lie, Damned Lies, and Statistics

February 2010

RIMiOSAndroidWM6/WP7PalmOther

www.comscore.com/Products_Services/Product_Index/MobiLens (trend used for Dec and Mar)

Lie, Damned Lies, and Statistics

March 2010

RIMiOSAndroidWM6/WP7PalmOther

www.comscore.com/Products_Services/Product_Index/MobiLens (trend used for Dec and Mar)

Lie, Damned Lies, and Statistics

April 2010

RIMiOSAndroidWM6/WP7PalmOther

www.comscore.com/Products_Services/Product_Index/MobiLens (trend used for Dec and Mar)

Lie, Damned Lies, and Statistics

May 2010

RIMiOSAndroidWM6/WP7PalmOther

www.comscore.com/Products_Services/Product_Index/MobiLens (trend used for Dec and Mar)

Lie, Damned Lies, and Statistics

June 2010

RIMiOSAndroidWM6/WP7PalmOther

www.comscore.com/Products_Services/Product_Index/MobiLens (trend used for Dec and Mar)

Lie, Damned Lies, and Statistics

July 2010

RIMiOSAndroidWM6/WP7PalmOther

www.comscore.com/Products_Services/Product_Index/MobiLens (trend used for Dec and Mar)

Lie, Damned Lies, and Statistics

August 2010

RIMiOSAndroidWM6/WP7PalmOther

www.comscore.com/Products_Services/Product_Index/MobiLens (trend used for Dec and Mar)

Lie, Damned Lies, and Statistics

September 2010

RIMiOSAndroidWM6/WP7PalmOther

www.comscore.com/Products_Services/Product_Index/MobiLens (trend used for Dec and Mar)

Lie, Damned Lies, and Statistics

October 2010

RIMiOSAndroidWM6/WP7PalmOther

www.comscore.com/Products_Services/Product_Index/MobiLens (trend used for Dec and Mar)

Lie, Damned Lies, and Statistics

November 2010

RIMiOSAndroidWM6/WP7PalmOther

www.comscore.com/Products_Services/Product_Index/MobiLens (trend used for Dec and Mar)

Lie, Damned Lies, and Statistics

December 2010

RIMiOSAndroidWM6/WP7PalmOther

www.comscore.com/Products_Services/Product_Index/MobiLens (trend used for Dec and Mar)

Lie, Damned Lies, and Statistics

December 2010

RIMiOSAndroidWM6/WP7PalmOther

www.comscore.com/Products_Services/Product_Index/MobiLens (trend used for Dec and Mar)

RIM remains strong, but steadily eroding share

iOS holding steady around 25% market share

Android on fire. From 2.8% to 28.7% in 12 months

WM6 loses 10% share in 12 months. What will WP7 bring?

Lie, Damned Lies, and Statistics

Many customers looking at building applications targeting iPhone, iPad, and Android devices

Lie, Damned Lies, and Statistics

But what if you have an existing investment in Microsoft technology?

Lie, Damned Lies, and Statistics

Objective

to a Microsoft platform and infrastructure

To give you the tools and knowledge

to connect iPhone, iPad, and Android devices

Scenarios

1 2 3 4 5Web Service Server Data Language

Scenarios

1 2 3 4 5Web Service Server Data Language

Scenario 1: Web

“I’ve got an existing web site...”

“How do I make it render well on the iPhone and Android handsets?”

Scenario 1: Web

Step 1: Need to identify mobile browsers

Scenario 1: Web

HTTP Request

PagesHTTP Response

User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0;

SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR

3.0.30729; .NET4.0C; .NET4.0E; InfoPath.3; MS-RTC LM 8)

Windows 7 / IE8.0

Scenario 1: Web

HTTP Request

PagesHTTP Response

iPhone OS 4.2

UserAgent: Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_2_1 like Mac OS X; en-us)

AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8C148 Safari/6533.18.5

Scenario 1: Web

HTTP Request

PagesHTTP Response

iPad OS 4.2

Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like

Gecko) Version/4.2.1 Mobile/7B334b Safari/531.21.10

Scenario 1: Web

HTTP Request

PagesHTTP Response

Android 2.2

Mozilla/5.0 (Linux; U; Android 2.2; en-gb; Nexus One Build/FRF50) AppleWebKit/533.1 (KHTML,

like Gecko) Version/4.0 Mobile Safari/533.1

Scenario 1: Web

Pages

User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET

CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET4.0C; .NET4.0E; InfoPath.3; MS-RTC

LM 8)

Windows 7 / IE8.0

if (useragent contains ”MSIE”)…

Android 2.2 Pages

if (useragent contains

”Android”)…Mozilla/5.0 (Linux; U; Android 2.2; en-gb; Nexus

One Build/FRF50) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1

Scenario 1: Web

User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET

CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET4.0C; .NET4.0E; InfoPath.3; MS-RTC

LM 8)

Windows 7 / IE8.0

Android 2.2

Mozilla/5.0 (Linux; U; Android 2.2; en-gb; Nexus One Build/FRF50) AppleWebKit/533.1 (KHTML, like

Gecko) Version/4.0 Mobile Safari/533.1

Controller

ViewCSS

ViewCSS

if (useragent contains ”MSIE”)…

if (useragent contains

”Android”)…

Scenario 1: Web

User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET

CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET4.0C; .NET4.0E; InfoPath.3; MS-RTC

LM 8)

Windows 7 / IE8.0

Android 2.2

Mozilla/5.0 (Linux; U; Android 2.2; en-gb; Nexus One Build/FRF50) AppleWebKit/533.1 (KHTML, like

Gecko) Version/4.0 Mobile Safari/533.1

Controller

ViewCSS

ViewCSS

if (useragent contains ”MSIE”)…

if (useragent contains

”Android”)…

Scenario 1: Web

User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET

CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET4.0C; .NET4.0E; InfoPath.3; MS-RTC

LM 8)

Windows 7 / IE8.0

Android 2.2

Mozilla/5.0 (Linux; U; Android 2.2; en-gb; Nexus One Build/FRF50) AppleWebKit/533.1 (KHTML, like

Gecko) Version/4.0 Mobile Safari/533.1

ASP.NET MVCViewEngine

Controller

ViewCSS

ViewCSS

if (useragent contains ”MSIE”)…

if (useragent contains

”Android”)…

Scenario 1: Web

Demo: Implementing Mobile View Engines in ASP.NET MVC 3

Scenario 1: Web

“Errr… OK – but it still looks like my original webpage”

Scenario 1: Web

User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET

CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET4.0C; .NET4.0E; InfoPath.3; MS-RTC

LM 8)

Windows 7 / IE8.0

Android 2.2

Mozilla/5.0 (Linux; U; Android 2.2; en-gb; Nexus One Build/FRF50) AppleWebKit/533.1 (KHTML, like

Gecko) Version/4.0 Mobile Safari/533.1

Controller

ViewCSS

ViewCSS

ASP.NET MVCViewEngine

Scenario 1: Web

iUIhttp://iui-js.org

jQTouchhttp://jqtouch.com

jQueryMobilehttp://jquerymobile.com

Mobile Web Frameworks

Scenario 1: Web

PhoneGaphttp://phonegap.com

Sencha Touchhttp://sencha.com

Unifyhttp://unify.github.com/

unify

Device-Integrated Web Frameworks

Scenario 1: Web

User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET

CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET4.0C; .NET4.0E; InfoPath.3; MS-RTC

LM 8)

Windows 7 / IE8.0

Android 2.2

Mozilla/5.0 (Linux; U; Android 2.2; en-gb; Nexus One Build/FRF50) AppleWebKit/533.1 (KHTML, like

Gecko) Version/4.0 Mobile Safari/533.1

Controller

ViewCSS

ViewCSS

ASP.NET MVCViewEngine

Scenario 1: Web

User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET

CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET4.0C; .NET4.0E; InfoPath.3; MS-RTC

LM 8)

Windows 7 / IE8.0

Android 2.2

Mozilla/5.0 (Linux; U; Android 2.2; en-gb; Nexus One Build/FRF50) AppleWebKit/533.1 (KHTML, like

Gecko) Version/4.0 Mobile Safari/533.1

1. Copy SiteMasterinto

MobileSiteMaster

2. Import jQueryMobile

3. Annotate structure of

MobileSiteMaster

4. Annotate individual views

ASP.NET MVCViewEngine

Scenario 1: Web

Demo: Using jQueryMobile to create device specific UI

Scenario 1: Web

Takeaways

Recommendations:

• Mobile Web sites will let you target multiple devices with a single back end

• Use ASP.NET MVC with ViewEngine support for device specific views

• Use ASP.NET MVC 3 (not 2) for improved HTML5 attributes

Watch out for:

• Many different UI frameworks – choose carefully, think about longevity

• MEAPs – Mobile Enterprise Application Platforms (auto gen’d UI from single source)

Scenarios

1 2 3 4 5Web Service Server Data Language

Scenario 2: Service

“We’ve covered Mobile Web pages, but how about if my site has REST/SOAP services?”

Scenario 2: Service

REST

Android 2.2 (Java)

SOAP (WS-I)

iPad/iPhone OS 4.2 (ObjC)

Native Application

Scenario 2: Service

REST

Android 2.2 (Java)

iPad/iPhone OS 4.2 (ObjC)

Native Application

<%@ ServiceHost Service="TRMobile.Web.Services.SessionService" Factory="System.ServiceModel.Activation.WebServiceHostFactory" %>

REST.svc

Scenario 2: Service

REST

Android 2.2 (Java)

iPad/iPhone OS 4.2 (ObjC)

Native Application

public class SessionService : ISessionService{ public SessionSummary[] GetData() {

// return active sessions }}

SessionService.cs

Scenario 2: Service

REST

Android 2.2 (Java)

iPad/iPhone OS 4.2 (ObjC)

Native Application

[ServiceContract] public interface ISessionService { [WebGet(UriTemplate = "/Sessions", RequestFormat = WebMessageFormat.Xml, ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare)] [OperationContract] SessionSummary[] GetData(); }

ISessionService.cs

Scenario 2: Service

REST

iPad/iPhone OS 4.2 (ObjC)

Native Application

Step 1: You need a JSON

library

http://stig.github.com

Scenario 2: Service

REST

iPad/iPhone OS 4.2 (ObjC)

Native Application

Step 2: Use NSMutableURLReques

t to call the service

-(IBAction)callRESTService:(id)sender{

NSURL *url = [NSURL URLWithString:@"http://sguest01/TRMobile/Services/REST.svc/Sessions"];

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];

[request setHTTPMethod:@"GET"];

connection = [[NSURLConnection alloc] initWithRequest:request delegate:self];

if (connection){

NSLog(@"Connection was established");receivedData = [[NSMutableData data] retain];

}else {

NSLog(@"Connection was null");}

}

iPhoneClientViewController.m

Scenario 2: Service

REST

iPad/iPhone OS 4.2 (ObjC)

Native Application

Step 3: Handle callbacks

- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response{

NSLog(@"Received response from the REST call");[receivedData setLength:0];

}

-(void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data{

NSLog(@"Received data from the REST call");[receivedData appendData:data];

}

-(void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error{

NSLog(@"REST call failed with an error");}

iPhoneClientViewController.m

Scenario 2: Service

REST

iPad/iPhone OS 4.2 (ObjC)

Native Application

Step 4: Get the response, deserialize

JSON

-(void)connectionDidFinishLoading:(NSURLConnection *)connection{

NSLog(@"Connection finished loading");NSString *responseString = [[NSString

alloc]initWithData:receivedData encoding:NSUTF8StringEncoding];NSLog(@"%@",responseString);

NSArray *dict = [responseString JSONValue]; for (id obj in dict){

NSDictionary *session = [[NSDictionary alloc] initWithDictionary:obj];

NSString *sessionCode = [session valueForKey:@"Code"];

NSLog(@"%@",sessionCode);}

NSLog(@"Complete");}

iPhoneClientViewController.m

Scenario 2: Service

Demo: Consuming a REST based service on iPhone/iPad

Scenario 2: Service

“Great! Is it a similar process on Android?”

Scenario 2: Service

REST

Native Application

Step 1: Use HttpClient and

HttpGet to make connection

Android 2.2 (Java)

HttpClient httpClient = new DefaultHttpClient();HttpGet request = new HttpGet("http://sguest01/TRMobile/Services/REST.svc/Sessions");

HttpEntity restEntity = httpClient.execute(request).getEntity();String restResult = new BufferedReader(new InputStreamReader(restEntity.getContent())).readLine();

Main.java

Scenario 2: Service

REST

Native Application

Step 2: Use org.json libraries

to deserialize JSON

Android 2.2 (Java)

JSONArray jArray = new JSONArray(restResult);for(int i=0; i<jArray.length(); i++){

JSONObject session = jArray.getJSONObject(i);Log.i("Session retrieved", "Code: "+session.getString("Code")

+" - "+session.getString("Title"));}

Main.java

Scenario 2: Service

REST

Native Application

Step 3: Optional – use GSON to

support serialization

Android 2.2 (Java)

http://code.google.com/p/google-gson

public void runJSONParser(){        try{        Log.i("MY INFO", "Json Parser started..");        Gson gson = new Gson();Reader r = new InputStreamReader(getJSONData("http://search.twitter.com/trends.json”));        Log.i("MY INFO", r.toString());        TwitterTrends objs = gson.fromJson(r, TwitterTrends.class);        Log.i("MY INFO", ""+objs.getTrends().size());        for(TwitterTrend tr : objs.getTrends()){            Log.i("TRENDS", tr.getName() + " - " + tr.getUrl());        }        }catch(Exception ex){            ex.printStackTrace();        }    }

Scenario 2: Service

Demo: Consuming a REST based service on Android

Scenario 2: Service

“REST appears to be fairly straightforward – but how about my services use SOAP?”

Scenario 2: Service

Android 2.2 (Java)

SOAP (WS-I)

iPad/iPhone OS 4.2 (ObjC)

Native Application

[ServiceContract] public interface ISOAP { [OperationContract] List<SessionSummary> GetSessions(); }

iSOAP.cs

public class SOAP : ISOAP{ public List<SessionSummary> GetSessions() { // code to return active sessions }}

SOAP.svc.cs

Scenario 2: Service

“It’s not as easy as you were hoping!”

No easy way of saying this, but:

Scenario 2: Service

SOAP (WS-I)

iPad/iPhone OS 4.2 (ObjC)

Native Application

Option 1: Handcraft the SOAP request/handle the SOAP response

Scenario 2: Service

SOAP (WS-I)

iPad/iPhone OS 4.2 (ObjC)

Native Application

Option 2: Your searches will likely take you down the road of gSOAP

and WSMakeStubs

Scenario 2: Service

SOAP (WS-I)

iPad/iPhone OS 4.2 (ObjC)

Native Application

Option 3: wsdl2objc (http://code.google.com/p/

wsdl2objc/)Version 0.7-pre1 recommended

http://code.google.com/p/wsdl2objc

Scenario 2: Service

SOAP (WS-I)

iPad/iPhone OS 4.2 (ObjC)

Native Application

Option 3: wsdl2objc (http://code.google.com/p/wsdl2objc/)

Version 0.7-pre1 recommended

Scenario 2: Service

SOAP (WS-I)

iPad/iPhone OS 4.2 (ObjC)

Native Application

Option 3: wsdl2objc (http://code.google.com/p/wsdl2objc/)

Version 0.7-pre1 recommended

BasicHttpBinding_ISOAPBinding *myBinding = [SOAP BasicHttpBinding_ISOAPBinding];myBinding.logXMLInOut = true;

SOAP_GetTitleForCode *parameters = [[SOAP_GetTitleForCode new] autorelease];parameters.code = [[NSString alloc]initWithString:[numberTextField text]];

BasicHttpBinding_ISOAPBindingResponse *response = [myBinding GetTitleForCodeUsingParameters:parameters];

NSArray *responseBodyParts = response.bodyParts;for (id bodyPart in responseBodyParts){

NSString *message = [bodyPart GetTitleForCodeResult];}

iPhoneClientViewController.m

Scenario 2: Service

Demo: Consuming a SOAP based service on iPhone/iPad

Scenario 2: Service

SOAP (WS-I)

iPad/iPhone OS 4.2 (ObjC)

Native Application

Option 3: wsdl2objc (http://code.google.com/p/wsdl2objc/)

Version 0.7-pre1 recommended

WSDL

XSD

XSD

Scenario 2: Service

SOAP (WS-I)

iPad/iPhone OS 4.2 (ObjC)

Native Application

WSDL

XSD

XSD

Step 1: Ensure that the namespace of the XSD elements matches the namespace of

the service[DataContract(Namespace =

"http://neudesic.com")]Step 2: Consider flattening WSDL and XSD

http://wcfextras.codeplex.com

Scenario 2: Service

“How about SOAP support on Android? A similar story?”

Scenario 2: Service

SOAP (WS-I)

Native Application

You would think that wsimport should work

Android 2.2 (Java)

Usage: wsimport [options] <WSDL_URI>

where [options] include: -b <path> specify jaxws/jaxb binding files or additional schemas (Each <path> must have its own -b) -B<jaxbOption> Pass this option to JAXB schema compiler -catalog <file> specify catalog file to resolve external entity references supports TR9401, XCatalog, and OASIS XML Catalog format. -d <directory> specify where to place generated output files -extension allow vendor extensions - functionality not specified by the specification. Use of extensions may result in applications that are not portable or may not interoperate with other...

wsimport

Scenario 2: Service

SOAP (WS-I)

Native Application

Android 2.2 (Java)

http://ksoap2.sourceforge.net

Scenario 2: Service

SOAP (WS-I)

Native Application

Android 2.2 (Java)

http://code.google.com/p/ksoap2-android

Scenario 2: Service

SOAP (WS-I)

Native Application

Android 2.2 (Java)maven install

KSOAP2-Android

Scenario 2: Service

SOAP (WS-I)

Native Application

Android 2.2 (Java)

String SOAP_ACTION = "http://tempuri.org/ISOAP/GetTitleForCode";String METHOD_NAME = "GetTitleForCode";String NAMESPACE = "http://tempuri.org/";String URL = "http://sguest01/TRMobile/Services/SOAP.svc";

SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);request.addProperty("code","ARC310");SoapSerializationEnvelope env = new SoapSerializationEnvelope(SoapEnvelope.VER11);env.dotNet = true;env.setOutputSoapObject(request);

HttpTransportSE transport = new HttpTransportSE(URL);transport.call(SOAP_ACTION, env);SoapPrimitive returnedTitle = (SoapPrimitive)env.getResponse();

Main.java

Scenario 2: Service

Demo: Consuming a SOAP based service on Android

Scenario 2: Service

“How about connecting iPhone, iPad, and Android to Windows Azure?”

Scenario 2: Service

Android 2.2 (Java)

iPad/iPhone OS 4.2 (ObjC)

Native Application

Web Role

Mobile Web (ASP.NET MVC + jQueryMobile)

REST EndpointSOAP Endpoint

Scenario 2: Service

Android 2.2 (Java)

iPad/iPhone OS 4.2 (ObjC)

Native Application

Azure Blob Storage

Azure Table Storage

Azure Queues

REST

REST

REST

PUT http://myaccount.blob.core.windows.net/mycontainer/myblockblob HTTP/1.1

Request Headers:x-ms-version: 2009-09-19x-ms-date: Sun, 27 Sep 2009 22:33:35 GMTContent-Type: text/plain; charset=UTF-8x-ms-blob-type: BlockBlobx-ms-meta-m1: v1x-ms-meta-m2: v2Authorization: SharedKey myaccount:YhuFJjN4fAR8/AmBrqBz7MG2uFinQ4rkh4dscbj598g=Content-Length: 11

Request Body:{binary representation of photo}

Scenario 2: Service

iPad/iPhone OS 4.2 (ObjC)

Native Application

0 0 32 deviceToken 0 34 message

Token Length Payload Length JSON formatted

Worker Role

TCP SSL connection

App User Acceptance

Anytime when onEvery 15 mins when

sleep

Scenario 2: Service

Android 2.2 (Java)

Native Application

http://code.google.com/android/c2dm

C2DM

Register Intent

User Acceptance

Worker Role

Send Message

Additional Data

https://android.apis.google.com/c2dm/sendregistration_idcollapse_keydata.<key>delay_while_idleAuthToken

Scenario 2: Service

Takeaways

Recommendations:

• Use REST whenever you have a choice• Push notification to both iOS and

Android possible using Windows Azure worker roles

• Get a good development environment setup with Fiddler/network sniffer

Watch out for:

• Async vs Sync operation. Both iOS and Android support sync, but don’t use it!

• Very limited support for WS-* on native iOS and Android libraries

Scenarios

1 2 3 4 5Web Service Server Data Language

Scenario 3: Server

“Many of Microsoft’s server products also expose REST/SOAP. What options exist for consuming these?”

Scenario 3: Server

“Let’s start with SharePoint Server”

Scenario 3: Server

Android 2.2

SharePoint Server2007/2010

iPad/iPhone OS 4.2

Basic: Use OOB Mobile Rendering

Packaged: Use AppStore/Market Client

Custom: Native Client to Services or Mobile Web Middle Tier

Scenario 3: Server

Android 2.2

SharePoint Server2007/2010

iPad/iPhone OS 4.2

Scenario 3: Server

Android 2.2

SharePoint Server2007/2010

iPad/iPhone OS 4.2

Scenario 3: Server

Android 2.2

SharePoint Server2007/2010

iPad/iPhone OS 4.2

Basic: Use OOB Mobile Rendering

Pros: Easy to setup, works out of the box (with SPS2010)

Cons: Basic, non-native CSS. No support for browser-based NTLM from Android.

No caching of username/password credentials.

Scenario 3: Server

Android 2.2

SharePoint Server2007/2010

iPad/iPhone OS 4.2

Basic: Use OOB Mobile Rendering

Packaged: Use AppStore/Market Client

Custom: Native Client to Services or Mobile Web Middle Tier

Scenario 3: Server

Android 2.2

SharePoint Server2007/2010

iPad/iPhone OS 4.2

http://itunes.apple.com/us/app/filamente-sharepoint-client

Scenario 3: Server

Android 2.2

SharePoint Server2007/2010

iPad/iPhone OS 4.2

http://itunes.apple.com/us/app/shareplus-office-mobile-client

Scenario 3: Server

Android 2.2

SharePoint Server2007/2010

iPad/iPhone OS 4.2

Scenario 3: Server

Android 2.2

SharePoint Server2007/2010

iPad/iPhone OS 4.2

Packaged: Use AppStore/Market Client

Pros: Cheap ($10 – $20 per client). Multiple authentication schemes.

Cached credentials. Some offline/sync support.

Cons: All site content for mobile users. Leaf nodes are mostly read only HTML (e.g. Announcements).

Most solutions are iPhone only (limited Android)

Scenario 3: Server

Android 2.2

SharePoint Server2007/2010

iPad/iPhone OS 4.2

Basic: Use OOB Mobile Rendering

Packaged: Use AppStore/Market Client

Custom: Native Client to Services or Mobile Web Middle Tier

Scenario 3: Server

Android 2.2

SharePoint Server2007/2010

iPad/iPhone OS 4.2

SPWeb (2007)ODATA (2010)

Scenario 3: Server

Android 2.2

SharePoint Server2007/2010

iPad/iPhone OS 4.2

ASP.NET MVCMiddle Tier

(jQueryMobile)

Mobile Web Rendering of information

useful to Mobile clients

SPWeb (2007)ODATA (2010)

Scenario 3: Server

Android 2.2

SharePoint Server2007/2010

iPad/iPhone OS 4.2

ASP.NET MVCMiddle Tier

(jQueryMobile)

Mobile Web Rendering of information

useful to Mobile clients

SPWeb (2007)ODATA (2010)

Scenario 3: Server

Android 2.2

SharePoint Server2007/2010

iPad/iPhone OS 4.2

ASP.NET MVCMiddle Tier

(jQueryMobile)

Mobile Web Rendering of information

useful to Mobile clients

SPWeb (2007)ODATA (2010)

Custom: Native Client or Middle Web Tier

Pros: Complete custom solution. Can even hide fact that back end is SharePoint-based.

Cons: More expensive option. Limitations with SOAP client libraries for iPhone/Android.

Scenario 3: Server

“Do the same options apply to Dynamics CRM?”

Scenario 3: Server

Android 2.2

Dynamics CRM4.0/2011

iPad/iPhone OS 4.2

Basic: Use OOB Mobile Rendering

Packaged: Use AppStore/Market Client

Custom: Native Client to Services or Mobile Web Middle Tier

Scenario 3: Server

Android 2.2

Dynamics CRM4.0/2011

iPad/iPhone OS 4.2

Scenario 3: Server

Android 2.2

Dynamics CRM4.0/2011

iPad/iPhone OS 4.2

http://www.microsoft.com/downloads/en/details.aspx?FamilyID=f592ec6c-f412-4fd5-9a80-cd3bcbd26d8b

Scenario 3: Server

Android 2.2

Dynamics CRM4.0/2011

iPad/iPhone OS 4.2

Scenario 3: Server

Android 2.2

Dynamics CRM4.0/2011

iPad/iPhone OS 4.2

Scenario 3: Server

Android 2.2

Dynamics CRM4.0/2011

iPad/iPhone OS 4.2

Basic: Use OOB Mobile Rendering

Pros: Easy to setup, works out of the box. Forms based authentication works with non-NTLM browsers.

Cons: Basic, non-native CSS. Controls a little awkward. No user-agent detection.

No caching of username/password credentials.

Scenario 3: Server

Android 2.2

Dynamics CRM4.0/2011

iPad/iPhone OS 4.2

Basic: Use OOB Mobile Rendering

Packaged: Use AppStore/Market Client

Custom: Native Client to Services or Mobile Web Middle Tier

Scenario 3: Server

Android 2.2

Dynamics CRM4.0/2011

iPad/iPhone OS 4.2

http://tendigits.com/mobileaccess.html

Scenario 3: Server

Android 2.2

Dynamics CRM4.0/2011

iPad/iPhone OS 4.2

http://itunes.apple.com/us/app/cwr-mobile-crm-v4-2-for-microsoft

Scenario 3: Server

Android 2.2

Dynamics CRM4.0/2011

iPad/iPhone OS 4.2

CWR/TenDigitsMiddle Tier

Optimized rendering

Scenario 3: Server

Android 2.2

Dynamics CRM4.0/2011

iPad/iPhone OS 4.2

CWR/TenDigitsMiddle Tier

Optimized rendering

Packaged: Use AppStore/Market Client

Pros: Offline access. Cached credentials.

Cons: All site content for mobile users. Most solutions are iPhone only (limited Android)

Scenario 3: Server

Android 2.2

Dynamics CRM4.0/2011

iPad/iPhone OS 4.2

Basic: Use OOB Mobile Rendering

Packaged: Use AppStore/Market Client

Custom: Native Client to Services or Mobile Web Middle Tier

Scenario 3: Server

Android 2.2

Dynamics CRM4.0/2011

iPad/iPhone OS 4.2

SOAP Web Services (4.0)REST Endpoint (2011)

Updated Web Services (2011)ODATA (2011)

Scenario 3: Server

Android 2.2

Dynamics CRM4.0/2011

iPad/iPhone OS 4.2

SOAP Web Services (4.0)REST Endpoint (2011)

Updated Web Services (2011)ODATA (2011)

Scenario 3: Server

Android 2.2

Dynamics CRM4.0/2011

iPad/iPhone OS 4.2

SOAP Web Services (4.0)REST Endpoint (2011)

Updated Web Services (2011)ODATA (2011)

Custom: Native Client or Middle Web Tier

Pros: Complete custom solution. Can even hide fact that back end is Dynamics-based.

Cons: Limitations with SOAP client libraries for iPhone/Android. On CRM 2011, REST endpoint only provides limited CRUD.

Web Service (SOAP) endpoint uses WS-Security with Kerberos.

Scenario 3: Server

Takeaways

Recommendations:

• Think about accessing SPS/CRM three ways

• Basic Web• Packaged• Custom

• Custom is (IMO) the most interesting to customers

Watch out for:

• Mobile Web is very basic• Packaged solutions are good, but

expose whole site• Pains with SOAP libraries on devices• CRM 2011 REST interface only allows

certain CRUD operations• CRM 2011 Web Service uses WS-

Security w/ Kerberos tokens

Scenario 3: Server

“You’ve mentioned ODATA many times. What’s the story?”

Scenarios

1 2 3 4 5Web Service Server Data Language

Scenario 3: Server

Android 2.2

SQL Server

iPad/iPhone OS 4.2TDS ProtocolX

Scenario 4: Data

OData

iPad/iPhone OS 4.2 (ObjC)

Native Application

WCFData

Service

SQL ServerEDMX

Scenario 4: Data

ODATA

iPad/iPhone OS 4.2 (ObjC)

Native Application

WCFData

Service

EDMX SQL Server

public class ODATA : DataService<SessionModelContainer> { public static void InitializeService(DataServiceConfiguration config) { config.SetEntitySetAccessRule("*", EntitySetRights.AllRead); config.DataServiceBehavior.MaxProtocolVersion = DataServiceProtocolVersion.V2; } }

ODATA.svc

Scenario 4: Data

ODATA

iPad/iPhone OS 4.2 (ObjC)

Native Application

WCFData

Service

EDMX SQL Server

http://interoperabilitybridges.com

Scenario 4: Data

OData

iPad/iPhone OS 4.2 (ObjC)

Native Application

WCFData

Service

EDMX SQL Server

./odatagen /uri=http://sguest01/TRMobile/Services/ODATA.svc /out=.

-rw-r--r-- 1 Simon staff 5738 Feb 10 13:09 SessionModelContainer.h-rw-r--r-- 1 Simon staff 14735 Feb 10 13:09 SessionModelContainer.m

odatagen

Scenario 4: Data

OData

iPad/iPhone OS 4.2 (ObjC)

Native Application

WCFData

Service

EDMX SQL Server

-(IBAction)callODATAService:(id)sender{

SessionModelContainer *proxy = [[SessionModelContainer alloc] initWithUri:@"http://sguest01/TRMobile/Services/ODATA.svc" credential:nil];

QueryOperationResponse *response = [proxy execute:@"Sessions"];NSMutableArray *sessions =[response getResult];for (id session in sessions){

NSLog(@"Session Code: %@",[session getCode]);NSLog(@"Session Title: %@", [session getTitle]);

}NSLog(@"Complete");

}

iPhoneClientViewController.m

Scenario 4: Data

Demo: Consuming an ODATA service on iPhone/iPad

Scenario 4: Data

Native Application

Android 2.2

OData

WCFData

Service

EDMX SQL Server

Scenario 4: Data

Native Application

Android 2.2

ODATA

WCFData

Service

EDMX SQL Server

http://code.google.com/p/odata4j

Scenario 4: Data

Native Application

Android 2.2

ODATA

WCFData

Service

EDMX SQL Server

http://www.restlet.org

Scenario 4: Data

Native Application

Android 2.2

ODATA

WCFData

Service

EDMX SQL Server

lib Simon$ java -cp org.restlet.jar:org.restlet.ext.xml.jar:org.restlet.ext.atom.jar:org.restlet.ext.freemarker.jar:org.restlet.ext.odata.jar:org.freemarker.jar org.restlet.ext.odata.Generator http://sguest01/TRMobile/Services/ODATA.svc ~/Desktop/ARC310/restlet-proxy/---------------------------OData client code generator---------------------------...The source code has been generated in directory: /Users/Simon/Desktop/ARC310/restlet-proxy

Proxy Generation

Note: Must be done with the full JSE version of Restlet.jar libraries (no generator in the Android version)!

Scenario 4: Data

Native Application

Android 2.2

OData

WCFData

Service

EDMX SQL Server

TrmobileWebModelsService service = new TrmobileWebModelsService();Query<sessionmodel.Session> query = service.createSessionQuery("/Sessions?$filter=startswith(Code,'VIR')%20eq%20true");

for (Session session : query){

// do work}

Main.java

Scenario 4: Data

Demo: Consuming an OData service on Android

Scenario 4: Data

Android 2.2

iPad/iPhone OS 4.2OData+Sync

WCFData

Service

EDMX SQL Server

Core DataSQLLite

SQLLite

Scenario 4: Data

Takeaways

Recommendations:

• Easy to create feeds using OData• Easy to consume through native

libraries• Easy to consume lists exposed by

SharePoint 2010

Watch out for:

• Anything that looks like SQL library on device

• OData+Sync not supported today• Consuming OData feeds from Office

365

Scenarios

1 2 3 4 5Web Service Server Data Language

Scenario 5: Language

“…but I don’t want to learn Objective C or Java!”

“I just want to do C#...”

Scenario 5: Language

2004 2005 2006 2007 2008 2009 2010 2011

Mono 1.0(C# 1.0)

1.1

1.2(C# 2.0)

2.0(C# 3.0)

2.8(C# 4.0)

Full AOT

SharpDevelop

MonoTouch 2.0/3.0

MonoTouch 1.0

MonoDroid Beta

Scenario 5: Language

iPad/iPhone OS 4.2

MonoDevelop

C#

MSIL

Mono compiler

Uses

Interface Builder

UI Kit

XIB

Saved as

Uses

MacOSX/XCode specific

Native

AOT (Ahead of Time) compiler“mscorlib.dll”

Scenario 5: Language

Demo: Building a simple application using MonoTouch

Scenario 5: Language

Interface Builder

UI Kit

XIB

Native

Saved as

Uses

XCode

Objective C

Uses

Compiles to

iPad/iPhone OS 4.2

MonoDevelop

C# Library

MSIL

AOT compiler

Mono compiler

Import existing

mylibrary.dll.s

Use MT for library only

Scenario 5: Language

MonoDevelop

C#

MSIL

Mono compiler

Uses

Android 2.2

Eclipse ADT

main.axml

Saved as

Eclipse optional

<application>.apk – includes assemblies and “runtime”

Dalvik VM

Android bindings

Scenario 5: Language

Takeaways

Recommendations:

• Ability to re-use existing C# skills and business logic

• Features of .NET that are easier than ObjC and Java (LINQ, XML Parsing, Generics)

Watch out for:

• No benefits for UI (UI Kit or main.axml)• MonoDevelop is more “Eclipse-like”• Support/roadmap from Novell? • Apple XCode 4 support?• MonoDroid in open preview – no go

live license yet• Price Tag ($1000 per MonoDevelop

enterprise license)

Scenarios

1 2 3 4 5Web Service Server Data Language

Conclusion

The momentum behind iPhone, iPad, and Android

continues…

Conclusion

Knowledge and tools to ensure that your mobile applications

are able to take full advantage of the Microsoft platform

Conclusion

Windows Phone 7 iPhone iPad Android Blackberry

Kelley Blue Book

Realtor.com

Neudesic Pulse

Whole Foods

Symetra Financial

Neudesic Pulse

SimonMed

VHA Inc

Kelley Blue Book

Symetra Financial

Kelley Blue Book

Neudesic Pulse

Neudesic Pulse

Gold Certified Microsoft Partner

Thank You!

Simon GuestDirector, Mobility Solutionssimon.guest@neudesic.com