Building Solutions on the Microsoft Platformthat target iPhone, iPad, and Android<br />Simon Guest<br />Director, Mobility...
www.comscore.com/Products_Services/Product_Index/MobiLens (trend used for Dec and Mar)<br />
www.comscore.com/Products_Services/Product_Index/MobiLens (trend used for Dec and Mar)<br />
www.comscore.com/Products_Services/Product_Index/MobiLens (trend used for Dec and Mar)<br />
www.comscore.com/Products_Services/Product_Index/MobiLens (trend used for Dec and Mar)<br />
www.comscore.com/Products_Services/Product_Index/MobiLens (trend used for Dec and Mar)<br />
www.comscore.com/Products_Services/Product_Index/MobiLens (trend used for Dec and Mar)<br />
www.comscore.com/Products_Services/Product_Index/MobiLens (trend used for Dec and Mar)<br />
www.comscore.com/Products_Services/Product_Index/MobiLens (trend used for Dec and Mar)<br />
www.comscore.com/Products_Services/Product_Index/MobiLens (trend used for Dec and Mar)<br />
www.comscore.com/Products_Services/Product_Index/MobiLens (trend used for Dec and Mar)<br />
www.comscore.com/Products_Services/Product_Index/MobiLens (trend used for Dec and Mar)<br />
www.comscore.com/Products_Services/Product_Index/MobiLens (trend used for Dec and Mar)<br />
www.comscore.com/Products_Services/Product_Index/MobiLens (trend used for Dec and Mar)<br />WM6 loses 10% share in 12 mont...
Many customers looking at building applications targeting iPhone, iPad, and Android devices<br />
But what if you have an existing investment <br />in Microsoft technology?<br />
To give you the tools and knowledge <br />to connect iPhone, iPad, and Android devices<br />to a Microsoft platform and in...
“I’ve got an existing web site...”  <br />“How do I make it render well on the iPhone and Android handsets?”<br />
Step 1:  Need to identify mobile browsers<br />
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...
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) Vers...
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/7B33...
Mozilla/5.0 (Linux; U; Android 2.2; en-gb; Nexus One Build/FRF50) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile...
if (useragent contains <br />”MSIE”)…<br />User-Agent: Mozilla/4.0 (compatible; MSIE8.0; Windows NT 6.1; WOW64; Trident/4....
if (useragent contains <br />”MSIE”)…<br />User-Agent: Mozilla/4.0 (compatible; MSIE8.0; Windows NT 6.1; WOW64; Trident/4....
if (useragent contains <br />”MSIE”)…<br />User-Agent: Mozilla/4.0 (compatible; MSIE8.0; Windows NT 6.1; WOW64; Trident/4....
if (useragent contains <br />”MSIE”)…<br />User-Agent: Mozilla/4.0 (compatible; MSIE8.0; Windows NT 6.1; WOW64; Trident/4....
Demo:  Implementing Mobile View Engines in ASP.NET MVC 3<br />
“Errr…  OK – but it still looks like my original webpage”<br />
User-Agent: Mozilla/4.0 (compatible; MSIE8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5....
Mobile Web Frameworks<br />iUI<br />http://iui-js.org<br />jQTouch<br />http://jqtouch.com<br />jQueryMobile<br />http://j...
Device-Integrated Web Frameworks<br />Sencha Touch<br />http://sencha.com<br />Unify<br />http://unify.github.com/unify<br...
User-Agent: Mozilla/4.0 (compatible; MSIE8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5....
User-Agent: Mozilla/4.0 (compatible; MSIE8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5....
Demo:  Using jQueryMobile to create device specific UI<br />
Takeaways<br />Recommendations:<br /><ul><li>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</li></ul>Watch out for:<br /><ul><li>Many different UI frameworks ...
MEAPs – Mobile Enterprise Application Platforms (auto gen’d UI from single source) </li></li></ul><li>
“We’ve covered Mobile Web pages, <br />but how about if my site has REST/SOAP services?”<br />
Native Application<br />REST<br />iPad/iPhone OS 4.2 (ObjC)<br />SOAP (WS-I)<br />Android 2.2 (Java)<br />
Native Application<br />REST<br />REST.svc<br /><%@ ServiceHost Service="TRMobile.Web.Services.SessionService" Factory="Sy...
Native Application<br />SessionService.cs<br />REST<br />public class SessionService : ISessionService<br />{<br />public ...
Native Application<br />ISessionService.cs<br />REST<br /> [ServiceContract]<br />    public interface ISessionService<br ...
Native Application<br />REST<br />iPad/iPhone OS 4.2 (ObjC)<br />Step 1:  Youneed a JSON library<br />http://stig.github.c...
iPhoneClientViewController.m<br />-(IBAction)callRESTService:(id)sender<br />{<br />	NSURL *url = [NSURL URLWithString:@"h...
iPhoneClientViewController.m<br />- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)res...
iPhoneClientViewController.m<br />-(void)connectionDidFinishLoading:(NSURLConnection *)connection<br />{<br />NSLog(@"Conn...
Demo:  Consuming a REST based service on iPhone/iPad<br />
“Great!  Is it a similar process on Android?”<br />
Native Application<br />REST<br />Main.java<br />HttpClienthttpClient = new DefaultHttpClient();<br />HttpGetrequest = new...
Native Application<br />REST<br />Main.java<br />JSONArrayjArray = new JSONArray(restResult);<br />for(inti=0; i<jArray.le...
public void runJSONParser(){<br />        try{<br />        Log.i("MY INFO", "Json Parser started..");<br />        Gsongs...
Demo:  Consuming a REST based service on Android<br />
“REST appears to be fairly straightforward – <br />but how about my services use SOAP?”<br />
Native Application<br />iSOAP.cs<br /> [ServiceContract]<br />public interface ISOAP<br />{<br />[OperationContract]<br />...
No easy way of saying this, but: <br />“It’s not as easy as you were hoping!”<br />
Native Application<br />SOAP (WS-I)<br />iPad/iPhone OS 4.2 (ObjC)<br />Option 1:  Handcraft the SOAP request/handle the S...
Native Application<br />SOAP (WS-I)<br />iPad/iPhone OS 4.2 (ObjC)<br />Option 2:  Yoursearcheswilllikelytakeyou down the ...
Native Application<br />SOAP (WS-I)<br />iPad/iPhone OS 4.2 (ObjC)<br />Option 3:  wsdl2objc <br />(http://code.google.com...
Native Application<br />SOAP (WS-I)<br />iPad/iPhone OS 4.2 (ObjC)<br />Option 3:  wsdl2objc <br />(http://code.google.com...
iPhoneClientViewController.m<br />BasicHttpBinding_ISOAPBinding *myBinding = [SOAP BasicHttpBinding_ISOAPBinding];<br />my...
Demo:  Consuming a SOAP based service on iPhone/iPad<br />
Native Application<br />SOAP (WS-I)<br />iPad/iPhone OS 4.2 (ObjC)<br />Option 3:  wsdl2objc <br />(http://code.google.com...
Native Application<br />SOAP (WS-I)<br />iPad/iPhone OS 4.2 (ObjC)<br />Step 1:  Ensurethat the namespace of the XSD eleme...
“How about SOAP support on Android?  A similar story?”<br />
wsimport<br />Usage: wsimport [options] <WSDL_URI><br />where [options] include:<br />  -b <path>                 specify ...
Native Application<br />SOAP (WS-I)<br />Android 2.2 (Java)<br />http://ksoap2.sourceforge.net<br />
Native Application<br />SOAP (WS-I)<br />Android 2.2 (Java)<br />http://code.google.com/p/ksoap2-android<br />
Native Application<br />SOAP (WS-I)<br />Android 2.2 (Java)<br />maveninstall<br />KSOAP2-Android<br />
Main.java<br />String SOAP_ACTION = "http://tempuri.org/ISOAP/GetTitleForCode";<br />String METHOD_NAME = "GetTitleForCode...
Demo:  Consuming a SOAP based service on Android<br />
“How about connecting iPhone, iPad, and Android to Windows Azure?”<br />
Native Application<br />iPad/iPhone OS 4.2 (ObjC)<br />Web Role<br />Mobile Web (ASP.NET MVC + jQueryMobile)<br />REST End...
Native Application<br />PUT http://myaccount.blob.core.windows.net/mycontainer/myblockblob HTTP/1.1<br />Request Headers:<...
Token Length<br />Payload Length<br />JSON formatted<br />0<br />0<br />32<br />deviceToken<br />0<br />34<br />message<br...
https://android.apis.google.com/c2dm/send<br />registration_id<br />collapse_key<br />data.<key><br />delay_while_idle<br ...
Takeaways<br />Recommendations:<br /><ul><li>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</li></ul>Watch out for:<br /><ul><li>Asyncvs Sync op...
Very limited support for WS-* on native iOS and Android libraries</li></li></ul><li>
“Many of Microsoft’s server products also expose REST/SOAP.  What options exist for consuming these?”<br />
“Let’s start with SharePoint Server”<br />
Custom:  Native Client to Services <br />or Mobile Web Middle Tier<br />Packaged:  Use AppStore/Market Client<br />iPad/iP...
iPad/iPhone OS 4.2<br />SharePoint Server<br />2007/2010<br />Android 2.2<br />
iPad/iPhone OS 4.2<br />SharePoint Server<br />2007/2010<br />Android 2.2<br />
Basic:  Use OOB Mobile Rendering<br />Pros:  Easy to setup, works out of the box (with SPS2010)<br />Cons:  Basic, non-nat...
Custom:  Native Client to Services <br />or Mobile Web Middle Tier<br />Packaged:  Use AppStore/Market Client<br />iPad/iP...
iPad/iPhone OS 4.2<br />SharePoint Server<br />2007/2010<br />Android 2.2<br />http://itunes.apple.com/us/app/filamente-sh...
iPad/iPhone OS 4.2<br />SharePoint Server<br />2007/2010<br />Android 2.2<br />http://itunes.apple.com/us/app/shareplus-of...
iPad/iPhone OS 4.2<br />SharePoint Server<br />2007/2010<br />Android 2.2<br />
Packaged:  Use AppStore/Market Client<br />Pros:  Cheap ($10 – $20 per client).  <br />Multiple authentication schemes.  <...
Custom:  Native Client to Services <br />or Mobile Web Middle Tier<br />Packaged:  Use AppStore/Market Client<br />iPad/iP...
SPWeb (2007)<br />ODATA (2010)<br />iPad/iPhone OS 4.2<br />SharePoint Server<br />2007/2010<br />Android 2.2<br />
SPWeb (2007)<br />ODATA (2010)<br />iPad/iPhone OS 4.2<br />Mobile Web Rendering of information<br />useful to Mobile clie...
SPWeb (2007)<br />ODATA (2010)<br />iPad/iPhone OS 4.2<br />Mobile Web Rendering of information<br />useful to Mobile clie...
SPWeb (2007)<br />ODATA (2010)<br />Custom:  Native Client or Middle Web Tier<br />Pros:  Complete custom solution.  <br /...
“Do the same options apply to Dynamics CRM?”<br />
Custom:  Native Client to Services <br />or Mobile Web Middle Tier<br />Packaged:  Use AppStore/Market Client<br />iPad/iP...
iPad/iPhone OS 4.2<br />Dynamics CRM<br />4.0/2011<br />Android 2.2<br />
iPad/iPhone OS 4.2<br />Dynamics CRM<br />4.0/2011<br />Android 2.2<br />http://www.microsoft.com/downloads/en/details.asp...
iPad/iPhone OS 4.2<br />Dynamics CRM<br />4.0/2011<br />Android 2.2<br />
iPad/iPhone OS 4.2<br />Dynamics CRM<br />4.0/2011<br />Android 2.2<br />
Basic:  Use OOB Mobile Rendering<br />Pros:  Easy to setup, works out of the box.  <br />Forms based authentication works ...
Custom:  Native Client to Services <br />or Mobile Web Middle Tier<br />Packaged:  Use AppStore/Market Client<br />iPad/iP...
iPad/iPhone OS 4.2<br />Dynamics CRM<br />4.0/2011<br />Android 2.2<br />http://tendigits.com/mobileaccess.html<br />
iPad/iPhone OS 4.2<br />Dynamics CRM<br />4.0/2011<br />Android 2.2<br />http://itunes.apple.com/us/app/cwr-mobile-crm-v4-...
iPad/iPhone OS 4.2<br />Optimized rendering<br />Dynamics CRM<br />4.0/2011<br />CWR/TenDigits<br />Middle Tier<br />Andro...
Packaged:  Use AppStore/Market Client<br />Pros:  Offline access.  <br />Cached credentials.<br />Cons:  All site content ...
Custom:  Native Client to Services <br />or Mobile Web Middle Tier<br />Packaged:  Use AppStore/Market Client<br />iPad/iP...
SOAP Web Services (4.0)<br />REST Endpoint (2011)<br />Updated Web Services (2011)<br />ODATA (2011)<br />iPad/iPhone OS 4...
SOAP Web Services (4.0)<br />REST Endpoint (2011)<br />Updated Web Services (2011)<br />ODATA (2011)<br />iPad/iPhone OS 4...
Custom:  Native Client or Middle Web Tier<br />Pros:  Complete custom solution.  <br />Can even hide fact that back end is...
Takeaways<br />Recommendations:<br /><ul><li>Think about accessing SPS/CRM three ways
Basic Web
Packaged
Custom
Custom is (IMO) the most interesting to customers</li></ul>Watch out for:<br /><ul><li>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</li></li></ul><li>“You’ve mentioned ODATA many times.  What’s the...
X<br />TDS Protocol<br />iPad/iPhone OS 4.2<br />SQL Server<br />Android 2.2<br />
Native Application<br />OData<br />iPad/iPhone OS 4.2 (ObjC)<br />WCF<br />Data<br />Service<br />SQL Server<br />EDMX<br />
Native Application<br />ODATA.svc<br /> public class ODATA : DataService<SessionModelContainer><br />{<br />     public st...
Native Application<br />ODATA<br />iPad/iPhone OS 4.2 (ObjC)<br />WCF<br />Data<br />Service<br />EDMX<br />SQL Server<br ...
Native Application<br />odatagen<br />./odatagen /uri=http://sguest01/TRMobile/Services/ODATA.svc /out=.<br />-rw-r--r--  ...
iPhoneClientViewController.m<br />-(IBAction)callODATAService:(id)sender<br />{<br />SessionModelContainer *proxy = [[Sess...
Demo:  Consuming an ODATA service on iPhone/iPad<br />
Native Application<br />OData<br />Android 2.2<br />WCF<br />Data<br />Service<br />EDMX<br />SQL Server<br />
Native Application<br />ODATA<br />Android 2.2<br />WCF<br />Data<br />Service<br />EDMX<br />SQL Server<br />http://code....
Native Application<br />ODATA<br />Android 2.2<br />WCF<br />Data<br />Service<br />EDMX<br />SQL Server<br />http://www.r...
Note:  Must be done with the full JSE version of Restlet.jarlibraries (no generator in the Android version)!<br />Native A...
Main.java<br />TrmobileWebModelsServiceservice = new TrmobileWebModelsService();<br />Query<sessionmodel.Session> query = ...
Demo:  Consuming an OData service on Android<br />
Core Data<br />SQLLite<br />iPad/iPhone OS 4.2<br />OData+Sync<br />WCF<br />Data<br />Service<br />EDMX<br />SQL Server<b...
Takeaways<br />Recommendations:<br /><ul><li>Easy to create feeds using OData
Easy to consume through native libraries
Easy to consume lists exposed by SharePoint 2010</li></ul>Watch out for:<br /><ul><li>Anything that looks like SQL library...
Upcoming SlideShare
Loading in …5
×

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

16,202 views

Published on

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

Published in: Technology
0 Comments
3 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
16,202
On SlideShare
0
From Embeds
0
Number of Embeds
484
Actions
Shares
0
Downloads
111
Comments
0
Likes
3
Embeds 0
No embeds

No notes for slide

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

  1. 1. Building Solutions on the Microsoft Platformthat target iPhone, iPad, and Android<br />Simon Guest<br />Director, Mobility Solutions<br />simon.guest@neudesic.com<br />
  2. 2.
  3. 3. www.comscore.com/Products_Services/Product_Index/MobiLens (trend used for Dec and Mar)<br />
  4. 4. www.comscore.com/Products_Services/Product_Index/MobiLens (trend used for Dec and Mar)<br />
  5. 5. www.comscore.com/Products_Services/Product_Index/MobiLens (trend used for Dec and Mar)<br />
  6. 6. www.comscore.com/Products_Services/Product_Index/MobiLens (trend used for Dec and Mar)<br />
  7. 7. www.comscore.com/Products_Services/Product_Index/MobiLens (trend used for Dec and Mar)<br />
  8. 8. www.comscore.com/Products_Services/Product_Index/MobiLens (trend used for Dec and Mar)<br />
  9. 9. www.comscore.com/Products_Services/Product_Index/MobiLens (trend used for Dec and Mar)<br />
  10. 10. www.comscore.com/Products_Services/Product_Index/MobiLens (trend used for Dec and Mar)<br />
  11. 11. www.comscore.com/Products_Services/Product_Index/MobiLens (trend used for Dec and Mar)<br />
  12. 12. www.comscore.com/Products_Services/Product_Index/MobiLens (trend used for Dec and Mar)<br />
  13. 13. www.comscore.com/Products_Services/Product_Index/MobiLens (trend used for Dec and Mar)<br />
  14. 14. www.comscore.com/Products_Services/Product_Index/MobiLens (trend used for Dec and Mar)<br />
  15. 15. www.comscore.com/Products_Services/Product_Index/MobiLens (trend used for Dec and Mar)<br />WM6 loses 10% share in 12 months. What will WP7 bring?<br />RIM remains strong, but steadily eroding share<br />Android on fire. From 2.8% to 28.7% in 12 months<br />iOS holding steady around 25% market share<br />
  16. 16. Many customers looking at building applications targeting iPhone, iPad, and Android devices<br />
  17. 17. But what if you have an existing investment <br />in Microsoft technology?<br />
  18. 18.
  19. 19. To give you the tools and knowledge <br />to connect iPhone, iPad, and Android devices<br />to a Microsoft platform and infrastructure<br />
  20. 20.
  21. 21.
  22. 22. “I’ve got an existing web site...” <br />“How do I make it render well on the iPhone and Android handsets?”<br />
  23. 23. Step 1: Need to identify mobile browsers<br />
  24. 24. 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)<br />HTTP Request<br />HTTP Response<br />Pages<br />Windows 7 / IE8.0<br />
  25. 25. 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<br />HTTP Request<br />HTTP Response<br />Pages<br />iPhone OS 4.2<br />
  26. 26. 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<br />HTTP Request<br />HTTP Response<br />Pages<br />iPad OS 4.2<br />
  27. 27. 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<br />HTTP Request<br />HTTP Response<br />Pages<br />Android 2.2<br />
  28. 28. if (useragent contains <br />”MSIE”)…<br />User-Agent: Mozilla/4.0 (compatible; MSIE8.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)<br />Windows 7 / IE8.0<br />Pages<br />if (useragentcontains ”Android”)…<br />Mozilla/5.0 (Linux; U; Android2.2; en-gb; Nexus One Build/FRF50) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1<br />Pages<br />Android 2.2<br />
  29. 29. if (useragent contains <br />”MSIE”)…<br />User-Agent: Mozilla/4.0 (compatible; MSIE8.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)<br />Windows 7 / IE8.0<br />View<br />CSS<br />Controller<br />if (useragentcontains ”Android”)…<br />Mozilla/5.0 (Linux; U; Android2.2; en-gb; Nexus One Build/FRF50) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1<br />View<br />CSS<br />Android 2.2<br />
  30. 30. if (useragent contains <br />”MSIE”)…<br />User-Agent: Mozilla/4.0 (compatible; MSIE8.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)<br />Windows 7 / IE8.0<br />View<br />CSS<br />Controller<br />if (useragentcontains ”Android”)…<br />Mozilla/5.0 (Linux; U; Android2.2; en-gb; Nexus One Build/FRF50) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1<br />View<br />CSS<br />Android 2.2<br />
  31. 31. if (useragent contains <br />”MSIE”)…<br />User-Agent: Mozilla/4.0 (compatible; MSIE8.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)<br />Windows 7 / IE8.0<br />View<br />CSS<br />Controller<br />ASP.NET MVC<br />ViewEngine<br />if (useragentcontains ”Android”)…<br />Mozilla/5.0 (Linux; U; Android2.2; en-gb; Nexus One Build/FRF50) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1<br />View<br />CSS<br />Android 2.2<br />
  32. 32. Demo: Implementing Mobile View Engines in ASP.NET MVC 3<br />
  33. 33. “Errr… OK – but it still looks like my original webpage”<br />
  34. 34. User-Agent: Mozilla/4.0 (compatible; MSIE8.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)<br />Windows 7 / IE8.0<br />View<br />CSS<br />Controller<br />ASP.NET MVC<br />ViewEngine<br />Mozilla/5.0 (Linux; U; Android2.2; en-gb; Nexus One Build/FRF50) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1<br />View<br />CSS<br />Android 2.2<br />
  35. 35. Mobile Web Frameworks<br />iUI<br />http://iui-js.org<br />jQTouch<br />http://jqtouch.com<br />jQueryMobile<br />http://jquerymobile.com<br />
  36. 36. Device-Integrated Web Frameworks<br />Sencha Touch<br />http://sencha.com<br />Unify<br />http://unify.github.com/unify<br />PhoneGap<br />http://phonegap.com<br />
  37. 37. User-Agent: Mozilla/4.0 (compatible; MSIE8.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)<br />Windows 7 / IE8.0<br />View<br />CSS<br />Controller<br />ASP.NET MVC<br />ViewEngine<br />Mozilla/5.0 (Linux; U; Android2.2; en-gb; Nexus One Build/FRF50) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1<br />View<br />CSS<br />Android 2.2<br />
  38. 38. User-Agent: Mozilla/4.0 (compatible; MSIE8.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)<br />Windows 7 / IE8.0<br />1. Copy SiteMaster<br />into<br />MobileSiteMaster<br />2. Import<br />jQueryMobile<br />ASP.NET MVC<br />ViewEngine<br />3. Annotate structure <br />of <br />MobileSiteMaster<br />Mozilla/5.0 (Linux; U; Android2.2; en-gb; Nexus One Build/FRF50) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1<br />4. Annotate <br />individual views<br />Android 2.2<br />
  39. 39. Demo: Using jQueryMobile to create device specific UI<br />
  40. 40. Takeaways<br />Recommendations:<br /><ul><li>Mobile Web sites will let you target multiple devices with a single back end
  41. 41. Use ASP.NET MVC with ViewEngine support for device specific views
  42. 42. Use ASP.NET MVC 3 (not 2) for improved HTML5 attributes</li></ul>Watch out for:<br /><ul><li>Many different UI frameworks – choose carefully, think about longevity
  43. 43. MEAPs – Mobile Enterprise Application Platforms (auto gen’d UI from single source) </li></li></ul><li>
  44. 44. “We’ve covered Mobile Web pages, <br />but how about if my site has REST/SOAP services?”<br />
  45. 45. Native Application<br />REST<br />iPad/iPhone OS 4.2 (ObjC)<br />SOAP (WS-I)<br />Android 2.2 (Java)<br />
  46. 46. Native Application<br />REST<br />REST.svc<br /><%@ ServiceHost Service="TRMobile.Web.Services.SessionService" Factory="System.ServiceModel.Activation.WebServiceHostFactory" %><br />iPad/iPhone OS 4.2 (ObjC)<br />Android 2.2 (Java)<br />
  47. 47. Native Application<br />SessionService.cs<br />REST<br />public class SessionService : ISessionService<br />{<br />public SessionSummary[] GetData()<br />{<br />// return active sessions<br /> }<br />} <br />iPad/iPhone OS 4.2 (ObjC)<br />Android 2.2 (Java)<br />
  48. 48. Native Application<br />ISessionService.cs<br />REST<br /> [ServiceContract]<br /> public interface ISessionService<br /> {<br />[WebGet(UriTemplate = "/Sessions", RequestFormat = WebMessageFormat.Xml, ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare)]<br /> [OperationContract]<br />SessionSummary[] GetData();<br /> }<br />iPad/iPhone OS 4.2 (ObjC)<br />Android 2.2 (Java)<br />
  49. 49. Native Application<br />REST<br />iPad/iPhone OS 4.2 (ObjC)<br />Step 1: Youneed a JSON library<br />http://stig.github.com<br />
  50. 50. iPhoneClientViewController.m<br />-(IBAction)callRESTService:(id)sender<br />{<br /> NSURL *url = [NSURL URLWithString:@"http://sguest01/TRMobile/Services/REST.svc/Sessions"];<br />NSMutableURLRequest *request = [NSMutableURLRequestrequestWithURL:url];<br /> [request setHTTPMethod:@"GET"];<br />connection = [[NSURLConnectionalloc] initWithRequest:requestdelegate:self];<br /> if (connection)<br /> {<br />NSLog(@"Connection was established");<br />receivedData = [[NSMutableData data] retain];<br /> }<br />else {<br />NSLog(@"Connection wasnull");<br /> }<br />}<br />Native Application<br />REST<br />iPad/iPhone OS 4.2 (ObjC)<br />Step 2: UseNSMutableURLRequest to call the service<br />
  51. 51. iPhoneClientViewController.m<br />- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response<br />{<br />NSLog(@"Received response from the REST call");<br /> [receivedData setLength:0];<br />}<br />-(void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data<br />{<br />NSLog(@"Received data from the REST call");<br /> [receivedDataappendData:data];<br />}<br />-(void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error<br />{<br />NSLog(@"REST call failed with an error");<br />}<br />Native Application<br />REST<br />iPad/iPhone OS 4.2 (ObjC)<br />Step 3: Handle callbacks<br />
  52. 52. iPhoneClientViewController.m<br />-(void)connectionDidFinishLoading:(NSURLConnection *)connection<br />{<br />NSLog(@"Connection finished loading");<br />NSString *responseString = [[NSStringalloc]initWithData:receivedData encoding:NSUTF8StringEncoding];<br />NSLog(@"%@",responseString);<br />NSArray *dict = [responseStringJSONValue]; <br /> for (id obj in dict)<br /> {<br />NSDictionary *session = [[NSDictionaryalloc] initWithDictionary:obj];<br />NSString *sessionCode = [session valueForKey:@"Code"];<br />NSLog(@"%@",sessionCode);<br /> }<br />NSLog(@"Complete");<br />}<br />Native Application<br />REST<br />iPad/iPhone OS 4.2 (ObjC)<br />Step 4: Get the response, deserialize JSON<br />
  53. 53. Demo: Consuming a REST based service on iPhone/iPad<br />
  54. 54. “Great! Is it a similar process on Android?”<br />
  55. 55. Native Application<br />REST<br />Main.java<br />HttpClienthttpClient = new DefaultHttpClient();<br />HttpGetrequest = new HttpGet("http://sguest01/TRMobile/Services/REST.svc/Sessions");<br />HttpEntityrestEntity= httpClient.execute(request).getEntity();<br />String restResult= new BufferedReader(new InputStreamReader(restEntity.getContent())).readLine();<br />Android 2.2 (Java)<br />Step 1: UseHttpClient and HttpGet to makeconnection<br />
  56. 56. Native Application<br />REST<br />Main.java<br />JSONArrayjArray = new JSONArray(restResult);<br />for(inti=0; i<jArray.length(); i++)<br />{<br />JSONObject session = jArray.getJSONObject(i);<br />Log.i("Session retrieved", "Code: "+session.getString("Code")+" - "+session.getString("Title"));<br />}<br />Android 2.2 (Java)<br />Step 2: Useorg.jsonlibraries to deserialize JSON<br />
  57. 57. public void runJSONParser(){<br />        try{<br />        Log.i("MY INFO", "Json Parser started..");<br />        Gsongson = new Gson();<br />Reader r = new InputStreamReader(getJSONData("http://search.twitter.com/trends.json”));<br />        Log.i("MY INFO", r.toString());<br />        TwitterTrendsobjs = gson.fromJson(r, TwitterTrends.class);<br />        Log.i("MY INFO", ""+objs.getTrends().size());<br />        for(TwitterTrendtr : objs.getTrends()){<br />            Log.i("TRENDS", tr.getName() + " - " + tr.getUrl());<br />        }<br />        }catch(Exception ex){<br />            ex.printStackTrace();<br />        }<br />    }<br />Native Application<br />REST<br />Android 2.2 (Java)<br />Step 3: Optional – use GSON to supportserialization<br />http://code.google.com/p/google-gson<br />
  58. 58. Demo: Consuming a REST based service on Android<br />
  59. 59. “REST appears to be fairly straightforward – <br />but how about my services use SOAP?”<br />
  60. 60. Native Application<br />iSOAP.cs<br /> [ServiceContract]<br />public interface ISOAP<br />{<br />[OperationContract]<br />List<SessionSummary> GetSessions();<br />}<br />SOAP (WS-I)<br />iPad/iPhone OS 4.2 (ObjC)<br />SOAP.svc.cs<br />public class SOAP : ISOAP<br />{<br />public List<SessionSummary> GetSessions()<br />{<br />// code to return active sessions<br />}<br />}<br />Android 2.2 (Java)<br />
  61. 61. No easy way of saying this, but: <br />“It’s not as easy as you were hoping!”<br />
  62. 62. Native Application<br />SOAP (WS-I)<br />iPad/iPhone OS 4.2 (ObjC)<br />Option 1: Handcraft the SOAP request/handle the SOAP response<br />
  63. 63. Native Application<br />SOAP (WS-I)<br />iPad/iPhone OS 4.2 (ObjC)<br />Option 2: Yoursearcheswilllikelytakeyou down the road of gSOAP and WSMakeStubs<br />
  64. 64. Native Application<br />SOAP (WS-I)<br />iPad/iPhone OS 4.2 (ObjC)<br />Option 3: wsdl2objc <br />(http://code.google.com/p/wsdl2objc/)<br />Version 0.7-pre1 recommended<br />http://code.google.com/p/wsdl2objc<br />
  65. 65. Native Application<br />SOAP (WS-I)<br />iPad/iPhone OS 4.2 (ObjC)<br />Option 3: wsdl2objc <br />(http://code.google.com/p/wsdl2objc/)<br />Version 0.7-pre1 recommended<br />
  66. 66. iPhoneClientViewController.m<br />BasicHttpBinding_ISOAPBinding *myBinding = [SOAP BasicHttpBinding_ISOAPBinding];<br />myBinding.logXMLInOut= true;<br />SOAP_GetTitleForCode*parameters = [[SOAP_GetTitleForCode new] autorelease];<br />parameters.code= [[NSStringalloc]initWithString:[numberTextField text]];<br />BasicHttpBinding_ISOAPBindingResponse*response = [myBindingGetTitleForCodeUsingParameters:parameters];<br />NSArray*responseBodyParts = response.bodyParts;<br />for (id bodyPart in responseBodyParts)<br />{<br />NSString *message = [bodyPartGetTitleForCodeResult];<br />}<br />Native Application<br />SOAP (WS-I)<br />iPad/iPhone OS 4.2 (ObjC)<br />Option 3: wsdl2objc <br />(http://code.google.com/p/wsdl2objc/)<br />Version 0.7-pre1 recommended<br />
  67. 67. Demo: Consuming a SOAP based service on iPhone/iPad<br />
  68. 68. Native Application<br />SOAP (WS-I)<br />iPad/iPhone OS 4.2 (ObjC)<br />Option 3: wsdl2objc <br />(http://code.google.com/p/wsdl2objc/)<br />Version 0.7-pre1 recommended<br />WSDL<br />XSD<br />XSD<br />
  69. 69. Native Application<br />SOAP (WS-I)<br />iPad/iPhone OS 4.2 (ObjC)<br />Step 1: Ensurethat the namespace of the XSD elementsmatches the namespace of the service<br />[DataContract(Namespace = "http://neudesic.com")]<br />WSDL<br />XSD<br />XSD<br />Step 2: Considerflattening WSDL and XSD<br />http://wcfextras.codeplex.com<br />
  70. 70. “How about SOAP support on Android? A similar story?”<br />
  71. 71. wsimport<br />Usage: wsimport [options] <WSDL_URI><br />where [options] include:<br /> -b <path> specify jaxws/jaxb binding files or additional schemas<br /> (Each <path> must have its own -b)<br /> -B<jaxbOption> Pass this option to JAXB schema compiler<br /> -catalog <file> specify catalog file to resolve external entity references<br /> supports TR9401, XCatalog, and OASIS XML Catalog format.<br /> -d <directory> specify where to place generated output files<br /> -extension allow vendor extensions - functionality not specified<br /> by the specification. Use of extensions may<br /> result in applications that are not portable or<br /> may not interoperate with other<br />...<br />Native Application<br />SOAP (WS-I)<br />Android 2.2 (Java)<br />Youwouldthinkthatwsimportshouldwork<br />
  72. 72. Native Application<br />SOAP (WS-I)<br />Android 2.2 (Java)<br />http://ksoap2.sourceforge.net<br />
  73. 73. Native Application<br />SOAP (WS-I)<br />Android 2.2 (Java)<br />http://code.google.com/p/ksoap2-android<br />
  74. 74. Native Application<br />SOAP (WS-I)<br />Android 2.2 (Java)<br />maveninstall<br />KSOAP2-Android<br />
  75. 75. Main.java<br />String SOAP_ACTION = "http://tempuri.org/ISOAP/GetTitleForCode";<br />String METHOD_NAME = "GetTitleForCode";<br />String NAMESPACE = "http://tempuri.org/";<br />String URL = "http://sguest01/TRMobile/Services/SOAP.svc";<br />SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);<br />request.addProperty("code","ARC310");<br />SoapSerializationEnvelopeenv = new SoapSerializationEnvelope(SoapEnvelope.VER11);<br />env.dotNet= true;<br />env.setOutputSoapObject(request);<br />HttpTransportSE transport = new HttpTransportSE(URL);<br />transport.call(SOAP_ACTION, env);<br />SoapPrimitivereturnedTitle = (SoapPrimitive)env.getResponse();<br />Native Application<br />SOAP (WS-I)<br />Android 2.2 (Java)<br />
  76. 76. Demo: Consuming a SOAP based service on Android<br />
  77. 77. “How about connecting iPhone, iPad, and Android to Windows Azure?”<br />
  78. 78. Native Application<br />iPad/iPhone OS 4.2 (ObjC)<br />Web Role<br />Mobile Web (ASP.NET MVC + jQueryMobile)<br />REST Endpoint<br />SOAP Endpoint<br />Android 2.2 (Java)<br />
  79. 79. Native Application<br />PUT http://myaccount.blob.core.windows.net/mycontainer/myblockblob HTTP/1.1<br />Request Headers:<br />x-ms-version: 2009-09-19<br />x-ms-date: Sun, 27 Sep 2009 22:33:35 GMT<br />Content-Type: text/plain; charset=UTF-8<br />x-ms-blob-type: BlockBlob<br />x-ms-meta-m1: v1<br />x-ms-meta-m2: v2<br />Authorization: SharedKey myaccount:YhuFJjN4fAR8/AmBrqBz7MG2uFinQ4rkh4dscbj598g=<br />Content-Length: 11<br />Request Body:<br />{binary representation of photo}<br />REST<br />AzureBlob Storage<br />REST<br />iPad/iPhone OS 4.2 (ObjC)<br />AzureTable Storage<br />REST<br />AzureQueues<br />Android 2.2 (Java)<br />
  80. 80. Token Length<br />Payload Length<br />JSON formatted<br />0<br />0<br />32<br />deviceToken<br />0<br />34<br />message<br />Native Application<br />App User Acceptance<br />TCP SSL connection<br />Anytime when on<br />Every 15 mins when sleep<br />iPad/iPhone OS 4.2 (ObjC)<br />Worker Role<br />
  81. 81. https://android.apis.google.com/c2dm/send<br />registration_id<br />collapse_key<br />data.<key><br />delay_while_idle<br />AuthToken<br />C2DM<br />Native Application<br />User Acceptance<br />Register Intent<br />Send Message<br />Additional Data<br />Android 2.2 (Java)<br />Worker Role<br />http://code.google.com/android/c2dm<br />
  82. 82. Takeaways<br />Recommendations:<br /><ul><li>Use REST whenever you have a choice
  83. 83. Push notification to both iOS and Android possible using Windows Azure worker roles
  84. 84. Get a good development environment setup with Fiddler/network sniffer</li></ul>Watch out for:<br /><ul><li>Asyncvs Sync operation. Both iOS and Android support sync, but don’t use it!
  85. 85. Very limited support for WS-* on native iOS and Android libraries</li></li></ul><li>
  86. 86. “Many of Microsoft’s server products also expose REST/SOAP. What options exist for consuming these?”<br />
  87. 87. “Let’s start with SharePoint Server”<br />
  88. 88. Custom: Native Client to Services <br />or Mobile Web Middle Tier<br />Packaged: Use AppStore/Market Client<br />iPad/iPhone OS 4.2<br />Basic: Use OOB Mobile Rendering<br />SharePoint Server<br />2007/2010<br />Android 2.2<br />
  89. 89. iPad/iPhone OS 4.2<br />SharePoint Server<br />2007/2010<br />Android 2.2<br />
  90. 90. iPad/iPhone OS 4.2<br />SharePoint Server<br />2007/2010<br />Android 2.2<br />
  91. 91. Basic: Use OOB Mobile Rendering<br />Pros: Easy to setup, works out of the box (with SPS2010)<br />Cons: Basic, non-native CSS. <br />No support for browser-based NTLM from Android. <br />No caching of username/password credentials.<br />iPad/iPhone OS 4.2<br />SharePoint Server<br />2007/2010<br />Android 2.2<br />
  92. 92. Custom: Native Client to Services <br />or Mobile Web Middle Tier<br />Packaged: Use AppStore/Market Client<br />iPad/iPhone OS 4.2<br />Basic: Use OOB Mobile Rendering<br />SharePoint Server<br />2007/2010<br />Android 2.2<br />
  93. 93. iPad/iPhone OS 4.2<br />SharePoint Server<br />2007/2010<br />Android 2.2<br />http://itunes.apple.com/us/app/filamente-sharepoint-client<br />
  94. 94. iPad/iPhone OS 4.2<br />SharePoint Server<br />2007/2010<br />Android 2.2<br />http://itunes.apple.com/us/app/shareplus-office-mobile-client<br />
  95. 95. iPad/iPhone OS 4.2<br />SharePoint Server<br />2007/2010<br />Android 2.2<br />
  96. 96. Packaged: Use AppStore/Market Client<br />Pros: Cheap ($10 – $20 per client). <br />Multiple authentication schemes. <br />Cached credentials. <br />Some offline/sync support.<br />Cons: All site content for mobile users. <br />Leaf nodes are mostly read only HTML (e.g. Announcements). Most solutions are iPhone only (limited Android)<br />iPad/iPhone OS 4.2<br />SharePoint Server<br />2007/2010<br />Android 2.2<br />
  97. 97. Custom: Native Client to Services <br />or Mobile Web Middle Tier<br />Packaged: Use AppStore/Market Client<br />iPad/iPhone OS 4.2<br />Basic: Use OOB Mobile Rendering<br />SharePoint Server<br />2007/2010<br />Android 2.2<br />
  98. 98. SPWeb (2007)<br />ODATA (2010)<br />iPad/iPhone OS 4.2<br />SharePoint Server<br />2007/2010<br />Android 2.2<br />
  99. 99. SPWeb (2007)<br />ODATA (2010)<br />iPad/iPhone OS 4.2<br />Mobile Web Rendering of information<br />useful to Mobile clients<br />SharePoint Server<br />2007/2010<br />ASP.NET MVC<br />Middle Tier<br />(jQueryMobile)<br />Android 2.2<br />
  100. 100. SPWeb (2007)<br />ODATA (2010)<br />iPad/iPhone OS 4.2<br />Mobile Web Rendering of information<br />useful to Mobile clients<br />SharePoint Server<br />2007/2010<br />ASP.NET MVC<br />Middle Tier<br />(jQueryMobile)<br />Android 2.2<br />
  101. 101. SPWeb (2007)<br />ODATA (2010)<br />Custom: Native Client or Middle Web Tier<br />Pros: Complete custom solution. <br />Can even hide fact that back end is SharePoint-based.<br />Cons: More expensive option. <br />Limitations with SOAP client libraries for iPhone/Android.<br />iPad/iPhone OS 4.2<br />Mobile Web Rendering of information<br />useful to Mobile clients<br />SharePoint Server<br />2007/2010<br />ASP.NET MVC<br />Middle Tier<br />(jQueryMobile)<br />Android 2.2<br />
  102. 102. “Do the same options apply to Dynamics CRM?”<br />
  103. 103. Custom: Native Client to Services <br />or Mobile Web Middle Tier<br />Packaged: Use AppStore/Market Client<br />iPad/iPhone OS 4.2<br />Basic: Use OOB Mobile Rendering<br />Dynamics CRM<br />4.0/2011<br />Android 2.2<br />
  104. 104. iPad/iPhone OS 4.2<br />Dynamics CRM<br />4.0/2011<br />Android 2.2<br />
  105. 105. iPad/iPhone OS 4.2<br />Dynamics CRM<br />4.0/2011<br />Android 2.2<br />http://www.microsoft.com/downloads/en/details.aspx?FamilyID=f592ec6c-f412-4fd5-9a80-cd3bcbd26d8b<br />
  106. 106. iPad/iPhone OS 4.2<br />Dynamics CRM<br />4.0/2011<br />Android 2.2<br />
  107. 107. iPad/iPhone OS 4.2<br />Dynamics CRM<br />4.0/2011<br />Android 2.2<br />
  108. 108. Basic: Use OOB Mobile Rendering<br />Pros: Easy to setup, works out of the box. <br />Forms based authentication works with non-NTLM browsers.<br />Cons: Basic, non-native CSS. <br />Controls a little awkward. <br />No user-agent detection. <br />No caching of username/password credentials.<br />iPad/iPhone OS 4.2<br />Dynamics CRM<br />4.0/2011<br />Android 2.2<br />
  109. 109. Custom: Native Client to Services <br />or Mobile Web Middle Tier<br />Packaged: Use AppStore/Market Client<br />iPad/iPhone OS 4.2<br />Basic: Use OOB Mobile Rendering<br />Dynamics CRM<br />4.0/2011<br />Android 2.2<br />
  110. 110. iPad/iPhone OS 4.2<br />Dynamics CRM<br />4.0/2011<br />Android 2.2<br />http://tendigits.com/mobileaccess.html<br />
  111. 111. iPad/iPhone OS 4.2<br />Dynamics CRM<br />4.0/2011<br />Android 2.2<br />http://itunes.apple.com/us/app/cwr-mobile-crm-v4-2-for-microsoft<br />
  112. 112. iPad/iPhone OS 4.2<br />Optimized rendering<br />Dynamics CRM<br />4.0/2011<br />CWR/TenDigits<br />Middle Tier<br />Android 2.2<br />
  113. 113. Packaged: Use AppStore/Market Client<br />Pros: Offline access. <br />Cached credentials.<br />Cons: All site content for mobile users. <br />Most solutions are iPhone only (limited Android)<br />iPad/iPhone OS 4.2<br />Optimized rendering<br />Dynamics CRM<br />4.0/2011<br />CWR/TenDigits<br />Middle Tier<br />Android 2.2<br />
  114. 114. Custom: Native Client to Services <br />or Mobile Web Middle Tier<br />Packaged: Use AppStore/Market Client<br />iPad/iPhone OS 4.2<br />Basic: Use OOB Mobile Rendering<br />Dynamics CRM<br />4.0/2011<br />Android 2.2<br />
  115. 115. SOAP Web Services (4.0)<br />REST Endpoint (2011)<br />Updated Web Services (2011)<br />ODATA (2011)<br />iPad/iPhone OS 4.2<br />Dynamics CRM<br />4.0/2011<br />Android 2.2<br />
  116. 116. SOAP Web Services (4.0)<br />REST Endpoint (2011)<br />Updated Web Services (2011)<br />ODATA (2011)<br />iPad/iPhone OS 4.2<br />Dynamics CRM<br />4.0/2011<br />Android 2.2<br />
  117. 117. Custom: Native Client or Middle Web Tier<br />Pros: Complete custom solution. <br />Can even hide fact that back end is Dynamics-based.<br />Cons: Limitations with SOAP client libraries for iPhone/Android. On CRM 2011, REST endpoint only provides limited CRUD. <br />Web Service (SOAP) endpoint uses WS-Security with Kerberos.<br />SOAP Web Services (4.0)<br />REST Endpoint (2011)<br />Updated Web Services (2011)<br />ODATA (2011)<br />iPad/iPhone OS 4.2<br />Dynamics CRM<br />4.0/2011<br />Android 2.2<br />
  118. 118. Takeaways<br />Recommendations:<br /><ul><li>Think about accessing SPS/CRM three ways
  119. 119. Basic Web
  120. 120. Packaged
  121. 121. Custom
  122. 122. Custom is (IMO) the most interesting to customers</li></ul>Watch out for:<br /><ul><li>Mobile Web is very basic
  123. 123. Packaged solutions are good, but expose whole site
  124. 124. Pains with SOAP libraries on devices
  125. 125. CRM 2011 REST interface only allows certain CRUD operations
  126. 126. CRM 2011 Web Service uses WS-Security w/ Kerberos tokens</li></li></ul><li>“You’ve mentioned ODATA many times. What’s the story?”<br />
  127. 127.
  128. 128. X<br />TDS Protocol<br />iPad/iPhone OS 4.2<br />SQL Server<br />Android 2.2<br />
  129. 129. Native Application<br />OData<br />iPad/iPhone OS 4.2 (ObjC)<br />WCF<br />Data<br />Service<br />SQL Server<br />EDMX<br />
  130. 130. Native Application<br />ODATA.svc<br /> public class ODATA : DataService<SessionModelContainer><br />{<br /> public static void InitializeService(DataServiceConfigurationconfig)<br />{<br />config.SetEntitySetAccessRule("*", EntitySetRights.AllRead);<br />config.DataServiceBehavior.MaxProtocolVersion = DataServiceProtocolVersion.V2;<br />}<br />}<br />ODATA<br />iPad/iPhone OS 4.2 (ObjC)<br />WCF<br />Data<br />Service<br />EDMX<br />SQL Server<br />
  131. 131. Native Application<br />ODATA<br />iPad/iPhone OS 4.2 (ObjC)<br />WCF<br />Data<br />Service<br />EDMX<br />SQL Server<br />http://interoperabilitybridges.com<br />
  132. 132. Native Application<br />odatagen<br />./odatagen /uri=http://sguest01/TRMobile/Services/ODATA.svc /out=.<br />-rw-r--r-- 1 Simon staff 5738 Feb 10 13:09 SessionModelContainer.h<br />-rw-r--r-- 1 Simon staff 14735 Feb 10 13:09 SessionModelContainer.m<br />OData<br />iPad/iPhone OS 4.2 (ObjC)<br />WCF<br />Data<br />Service<br />EDMX<br />SQL Server<br />
  133. 133. iPhoneClientViewController.m<br />-(IBAction)callODATAService:(id)sender<br />{<br />SessionModelContainer *proxy = [[SessionModelContaineralloc] initWithUri:@"http://sguest01/TRMobile/Services/ODATA.svc" credential:nil];<br />QueryOperationResponse *response = [proxy execute:@"Sessions"];<br />NSMutableArray *sessions =[response getResult];<br /> for (id session in sessions)<br /> {<br />NSLog(@"Session Code: %@",[session getCode]);<br />NSLog(@"Session Title: %@", [session getTitle]);<br /> }<br />NSLog(@"Complete");<br />}<br />Native Application<br />OData<br />iPad/iPhone OS 4.2 (ObjC)<br />WCF<br />Data<br />Service<br />EDMX<br />SQL Server<br />
  134. 134. Demo: Consuming an ODATA service on iPhone/iPad<br />
  135. 135. Native Application<br />OData<br />Android 2.2<br />WCF<br />Data<br />Service<br />EDMX<br />SQL Server<br />
  136. 136. Native Application<br />ODATA<br />Android 2.2<br />WCF<br />Data<br />Service<br />EDMX<br />SQL Server<br />http://code.google.com/p/odata4j<br />
  137. 137. Native Application<br />ODATA<br />Android 2.2<br />WCF<br />Data<br />Service<br />EDMX<br />SQL Server<br />http://www.restlet.org<br />
  138. 138. Note: Must be done with the full JSE version of Restlet.jarlibraries (no generator in the Android version)!<br />Native Application<br />Proxy Generation<br />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/<br />---------------------------<br />OData client code generator<br />---------------------------<br />...<br />The source code has been generated in directory: /Users/Simon/Desktop/ARC310/restlet-proxy<br />ODATA<br />Android 2.2<br />WCF<br />Data<br />Service<br />EDMX<br />SQL Server<br />
  139. 139. Main.java<br />TrmobileWebModelsServiceservice = new TrmobileWebModelsService();<br />Query<sessionmodel.Session> query = service.createSessionQuery("/Sessions?$filter=startswith(Code,'VIR')%20eq%20true");<br />for (Session session : query)<br />{<br />// do work<br />}<br />Native Application<br />OData<br />Android 2.2<br />WCF<br />Data<br />Service<br />EDMX<br />SQL Server<br />
  140. 140. Demo: Consuming an OData service on Android<br />
  141. 141. Core Data<br />SQLLite<br />iPad/iPhone OS 4.2<br />OData+Sync<br />WCF<br />Data<br />Service<br />EDMX<br />SQL Server<br />SQLLite<br />Android 2.2<br />
  142. 142. Takeaways<br />Recommendations:<br /><ul><li>Easy to create feeds using OData
  143. 143. Easy to consume through native libraries
  144. 144. Easy to consume lists exposed by SharePoint 2010</li></ul>Watch out for:<br /><ul><li>Anything that looks like SQL library on device
  145. 145. OData+Sync not supported today
  146. 146. Consuming OData feeds from Office 365</li></li></ul><li>
  147. 147. “…but I don’t want to learn Objective C or Java!”<br />“I just want to do C#...”<br />
  148. 148. Mono 1.0<br />(C# 1.0)<br />1.2<br />(C# 2.0)<br />2.0<br />(C# 3.0)<br />2.8<br />(C# 4.0)<br />Mono<br />Touch 1.0<br />Mono<br />Droid <br />Beta<br />Sharp<br />Develop<br />Full <br />AOT<br />Mono<br />Touch 2.0/3.0<br />1.1<br />2004<br />2005<br />2006<br />2007<br />2008<br />2009<br />2010<br />2011<br />
  149. 149. MacOSX/XCode specific<br />MonoDevelop<br />Interface Builder<br />Uses<br />Uses<br />C#<br />UI Kit<br />Mono compiler<br />Saved as<br />MSIL<br />XIB<br />“mscorlib.dll”<br />AOT (Ahead of Time) compiler<br />Native<br />iPad/iPhone OS 4.2<br />
  150. 150. Demo: Building a simple application using MonoTouch<br />
  151. 151. Use MT for library only<br />Interface Builder<br />XCode<br />MonoDevelop<br />Uses<br />Uses<br />Import existing<br />UI Kit<br />Objective C<br />C# Library<br />Saved as<br />Compiles to<br />Mono compiler<br />XIB<br />MSIL<br />AOT compiler<br />Native<br />mylibrary.dll.s<br />iPad/iPhone OS 4.2<br />
  152. 152. Eclipse optional<br />MonoDevelop<br />Eclipse ADT<br />Uses<br />Saved as<br />Android bindings<br />C#<br />main.axml<br />Mono compiler<br />MSIL<br /><application>.apk – includes assemblies and “runtime”<br />Dalvik VM<br />Android 2.2<br />
  153. 153. Takeaways<br />Recommendations:<br /><ul><li>Ability to re-use existing C# skills and business logic
  154. 154. Features of .NET that are easier than ObjC and Java (LINQ, XML Parsing, Generics)</li></ul>Watch out for:<br /><ul><li>No benefits for UI (UI Kit or main.axml)
  155. 155. MonoDevelop is more “Eclipse-like”
  156. 156. Support/roadmap from Novell?
  157. 157. Apple XCode 4 support?
  158. 158. MonoDroid in open preview – no go live license yet
  159. 159. Price Tag ($1000 per MonoDevelop enterprise license)</li></li></ul><li>
  160. 160. The momentum behind iPhone, iPad, and Android continues…<br />
  161. 161. Knowledge and tools to ensure that your mobile applications are able to take full advantage of the Microsoft platform<br />
  162. 162. Gold Certified Microsoft Partner<br />
  163. 163. Thank You!<br />Simon Guest<br />Director, Mobility Solutions<br />simon.guest@neudesic.com<br />

×