23
Research on Xamarin By Rong Zhuang August 19, 2015 1. Introduction 1.1 Main Features Cross-Platform(C#) Ø iOS(Xamarin.iOS) Ø Android(Xamarin.Android) Ø Mac(Xamarin.Mac) Xamarin Insights Xamarin Test Cloud(Xamarin.UITest) 1.2 IDE Mac: Xamarin Studio, Xcode Windows: Xamarin Studio or Visual Studio+Xamarin’s plug-in for Visual Studio, Mac, Xcode, Xamarin.iOS Build Host 1.3 Xamarin Account(per developer, per device platform) Trail(30days)-free Indie-$25/Month($300/Year) Business-$83/Month($999/Year) Enterprise-$158/Month($1899/Year) For Student-Free(Need to apply) 2. iOS Development

Research on Xamarin · Native Xamarin Development Community Matured mobile platform with plenty of materials/documents. Lack of resources, like, books, third-party libraries, etc

  • Upload
    others

  • View
    4

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Research on Xamarin · Native Xamarin Development Community Matured mobile platform with plenty of materials/documents. Lack of resources, like, books, third-party libraries, etc

ResearchonXamarinByRongZhuangAugust19,2015

1. Introduction1.1 MainFeatures

• Cross-Platform(C#)Ø iOS(Xamarin.iOS)Ø Android(Xamarin.Android)Ø Mac(Xamarin.Mac)

• XamarinInsights• XamarinTestCloud(Xamarin.UITest)

1.2 IDE• Mac:XamarinStudio,Xcode• Windows:XamarinStudioorVisualStudio+Xamarin’splug-inforVisualStudio,Mac,

Xcode,Xamarin.iOSBuildHost1.3 XamarinAccount(perdeveloper,perdeviceplatform)

• Trail(30days)-free• Indie-$25/Month($300/Year)• Business-$83/Month($999/Year)• Enterprise-$158/Month($1899/Year)• ForStudent-Free(Needtoapply)

2. iOSDevelopment

Page 2: Research on Xamarin · Native Xamarin Development Community Matured mobile platform with plenty of materials/documents. Lack of resources, like, books, third-party libraries, etc

TherearetwooptionstosetupthedevelopmentenvironmentforiOS:• XamarinStudioonMac• VisualStudioonPC(withanothermacconnectedtothesamenetworkofPC),seebelow.

Note:XamarinStudioonPCcannotbeusedforiOSdevelopment.

2.1 Installation(Windows)• XamarinPlatformforWindows• Xamarin.iOSBuildHostonMac

2.2 DevelopinginVisualStudio2013

Page 3: Research on Xamarin · Native Xamarin Development Community Matured mobile platform with plenty of materials/documents. Lack of resources, like, books, third-party libraries, etc

Note:MustbeconnectingtoBuildHostofMacwheneditingthelayout.

2.3 TestinsimulatoronMac.

Page 4: Research on Xamarin · Native Xamarin Development Community Matured mobile platform with plenty of materials/documents. Lack of resources, like, books, third-party libraries, etc

2.4 Testonrealdevice.

Page 5: Research on Xamarin · Native Xamarin Development Community Matured mobile platform with plenty of materials/documents. Lack of resources, like, books, third-party libraries, etc

Note:PluginyouriphoneoripadtoMACbeforerunningthetest.

2.5 DevelopinginXamarinStudio(Mac)

Page 6: Research on Xamarin · Native Xamarin Development Community Matured mobile platform with plenty of materials/documents. Lack of resources, like, books, third-party libraries, etc

2.6 Deployment

PublishingtotheAppStorehttp://developer.xamarin.com/guides/ios/deployment,_testing,_and_metrics/app_distribution_overview/publishing_to_the_app_store/

3. AndroidDevelopmentTherearethreeoptionstosetupthedevelopmentenvironmentforAndroid:• XamarinStudioonMac• XamarinStudioonPC• VisualStudioonPC

3.1 Installation(Windows)• XamarinPlatformforWindows• AndroidSDKandEmulator

3.2 DevelopinginVisualStudio2013.

Page 7: Research on Xamarin · Native Xamarin Development Community Matured mobile platform with plenty of materials/documents. Lack of resources, like, books, third-party libraries, etc
Page 8: Research on Xamarin · Native Xamarin Development Community Matured mobile platform with plenty of materials/documents. Lack of resources, like, books, third-party libraries, etc

3.3 Testinemulator,AVD(AndroidVirtualDevice).

3.4 DevelopinginXamarinStudio(Mac)

3.5 PublishandDeploymentinVisualStudio.

Page 9: Research on Xamarin · Native Xamarin Development Community Matured mobile platform with plenty of materials/documents. Lack of resources, like, books, third-party libraries, etc
Page 10: Research on Xamarin · Native Xamarin Development Community Matured mobile platform with plenty of materials/documents. Lack of resources, like, books, third-party libraries, etc

4. XamarinInsights

Page 11: Research on Xamarin · Native Xamarin Development Community Matured mobile platform with plenty of materials/documents. Lack of resources, like, books, third-party libraries, etc
Page 12: Research on Xamarin · Native Xamarin Development Community Matured mobile platform with plenty of materials/documents. Lack of resources, like, books, third-party libraries, etc
Page 13: Research on Xamarin · Native Xamarin Development Community Matured mobile platform with plenty of materials/documents. Lack of resources, like, books, third-party libraries, etc

5. XamarinTestCloud• Xamarin.UITest(C#)• Calabash(Ruby)

Costs:

6. Cross-Platform6.1 Separatedcomponents

• Xamarin.Android• Xamarin.iOS• Xamarin.WP8

Page 14: Research on Xamarin · Native Xamarin Development Community Matured mobile platform with plenty of materials/documents. Lack of resources, like, books, third-party libraries, etc

6.2 Xamarin.Form(UnifiedUIdevelopmentprocess)Xamarin.FormsintegrateswithXamarin.iOSandXamarin.Android.

Page 15: Research on Xamarin · Native Xamarin Development Community Matured mobile platform with plenty of materials/documents. Lack of resources, like, books, third-party libraries, etc

6.3 SharingCodes

• PortableClassLibrary(PCL):dlls• SharedAssetProject(SAP):codeandassetsfiles

Page 16: Research on Xamarin · Native Xamarin Development Community Matured mobile platform with plenty of materials/documents. Lack of resources, like, books, third-party libraries, etc

TheiOSandAndroidprojectshaveaccesstoprettymuchthesameversionof.NET,butitisnotthesameversionof.NETthataWindowsPhoneprojectuses.Thismeansthatany.NETclassesaccessedbythesharedcodemightbesomewhatdifferentdependingontheplatform.Asyou’lldiscoverlaterinthisbook,thisisthecaseforsomefileI/OclassesintheSystem.IOnamespace.

7. StoreData7.1 TransientData

• Application.Properties(stringkey,objectitem)• ApplicationEvents(OnStart,OnSleep,OnResume)

Page 17: Research on Xamarin · Native Xamarin Development Community Matured mobile platform with plenty of materials/documents. Lack of resources, like, books, third-party libraries, etc

Note:IfeachitemofthisdataisanentryinthePropertiesdictionary,eachitemneedsadictionarykey.However,ifaprogramneedstosavealargefilesuchasaword-processingdocument,itshouldn’tusethePropertiesdictionary,butin-steadshouldaccesstheplatform’sfilesystemdirectly.

7.2 LargeFilePlatform’sfilesystem:Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); Xamarin.Forms.DependencyService

Page 18: Research on Xamarin · Native Xamarin Development Community Matured mobile platform with plenty of materials/documents. Lack of resources, like, books, third-party libraries, etc

8. PrototypeofCoursePlayer8.1 Layout

Useaslider,labelandbuttontosimulatevideoplaying.

8.2 Components• COL.Corecontainsthecorefunctiontogetandconvertdata.• CoursePlayeriPhonecontainsthecourserelatedfilesandrendertheUI.

Page 19: Research on Xamarin · Native Xamarin Development Community Matured mobile platform with plenty of materials/documents. Lack of resources, like, books, third-party libraries, etc

8.3 UMLclassdiagram

Page 20: Research on Xamarin · Native Xamarin Development Community Matured mobile platform with plenty of materials/documents. Lack of resources, like, books, third-party libraries, etc

9. ImportantConcerns9.1 DoesXamarinprovidethesupportofthethird-partylibraries?How?

Yes,Xamrainsupportsnotonly.NETbasedclasslibraries,butalsoObjective-C,Java,HTMLorJavascripttoreuseinXamarin.Walkthrough:BindinganObjective-CLibraryhttp://developer.xamarin.com/guides/ios/advanced_topics/binding_objective-c/Walkthrough_Binding_objective-c_library/1) First,we'llcreateanObjective-CstaticlibraryusingXcode.2) Thenwe'llbindingthisstaticlibrarywithXamarin.iOS.3) Next,showhowObjectiveSharpiecanreducetheworkloadbyautomaticallygenerating

some(butnotall)ofthenecessaryAPIdefinitionsrequiredbytheXamarin.iOSbinding.4) Finally,we'llcreateaXamarin.iOSapplicationthatusesthebinding.

9.2 IOinterfaces,eg.fileread/write

Page 21: Research on Xamarin · Native Xamarin Development Community Matured mobile platform with plenty of materials/documents. Lack of resources, like, books, third-party libraries, etc

9.3 Whatfeatures,especiallythesystemrelevantfunctionalities,doesXamarinprovide?

Briefly,Xamarinsupportsunifiedcross-platformfeatures.Separately,itsupportsplatformaimedfeatures.http://developer.xamarin.com/recipes/

Page 22: Research on Xamarin · Native Xamarin Development Community Matured mobile platform with plenty of materials/documents. Lack of resources, like, books, third-party libraries, etc

9.4 HowdoesXamarinfollowthenewreleasesofnativeplatforms,iOSandAndroid?

10. OverviewConclusion

1) Xamarinhasgreatsupportforcross-platformmobiledevelopment.2) ThedevelopmentcostishighbyusingXamarin.3) DevelopersarerequiredtohavetheknowledgeofC#(.Net),Xamarin(Mono),iOS

developmentandAndroidDevelopment.4) ForiOS,thelayoutdesignisnotsupportedenough(eg.autolayout),maybeneedto

createseparateprojectsforiPhoneandiPad.

Page 23: Research on Xamarin · Native Xamarin Development Community Matured mobile platform with plenty of materials/documents. Lack of resources, like, books, third-party libraries, etc

11. FeatureComparisonfromPortfolioPerspective Native XamarinDevelopmentCommunity

Maturedmobileplatformwithplentyofmaterials/documents.

Lackofresources,like,books,third-partylibraries,etc.

Features/Functionalities

Cangettheentirefeatures/functionalitiesprovidedbytheSDK.

Someofthenativefeaturesarenotsupportedverywell(eg.Autolayout).

Third-PartyLibrary Fullysupported Needssomeextraefforttoachievethesamepurpose.

Coding Purenativecodes HybridofMono,iOSandAndroid

Debugging ComfortablewithXcode,AndroidStudio

ComfortablewithVisualStudio

Deployment Standardprocedure Alittlemoreextraworkrequired.

Extendibility Easytoaddnewfeatures Inmostcases,itispossibletoaddnewfeature,butneeddosomeresearchingworkfirst.

Reusable Low High,ifmoreplatformsarerequired.Besides,thesharedlibrarycanbeenhancedtosupportwebapplication.

EffortinDevelopmentphase

High Low,ifmoreplatformsarerequired

Effortinmaintenancephase

High Low,especiallywhenthebugisnotrelevantwithUI.

RequiredDevelopers 2(1foriOS,1forAndroid) 3(1forXamarinsharedlibrary,1foriOSUI,1forAndroidUI)

Developer’sQualification

Platformspecifiedknowledge Cross-platformknowledge,Xamarinplatform,plusC#,Mono

LicenseFee(PerYear) iOS$99;Androidfree iOSdeveloperaccount$99XamariniOS:$999XamarinAndroid:$999

PotentialRisk None UncertaintyofXamarin’sfuture.ThecomparisonisbasedontheassumptionthatourAPPonlysupportsiOSandAndroid.

12. Reference• http://xamarin.com/faq• https://components.xamarin.com/• http://developer.xamarin.com/recipes/ios/general/file_system/load_a_file/• http://developer.xamarin.com/recipes/android/data/files/• http://developer.xamarin.com/recipes/• http://developer.xamarin.com/guides/cross-platform/insights/