Creating a New Surface Duo Xamarin.Android App Project

%3CLINGO-SUB%20id%3D%22lingo-sub-1865312%22%20slang%3D%22en-US%22%3ECreating%20a%20New%20Surface%20Duo%20Xamarin.Android%20App%20Project%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1865312%22%20slang%3D%22en-US%22%3E%3CP%3EI%20am%20new%20to%20Xamarin%20%26amp%3B%20Android%2C%20coming%20from%20a%20UWP%20background.%20I%20would%20like%20to%20see%20a%20video%20or%20step-by-step%20tutorial%20that%20includes%3A%3C%2FP%3E%3CP%3E1.%20Project%20configuration%20changes%20necessary%20for%20apps%20optimized%20for%20Surface%20Duo%2C%20including%3A%3C%2FP%3E%3CP%3EThe%20Xamarin.DuoSdk%20NuGet%20package%3C%2FP%3E%3CP%3EApp%20Configuration%2C%20such%20as%20Properties%2C%20AssemblyInfo.cs%2C%20%26amp%3B%20AndroidManifest.xml%3C%2FP%3E%3CP%3E2.%20Standard%20code%20changes%3C%2FP%3E%3CP%3EAny%20Attributes%20in%20codebehind%20files%20(such%20as%20MainActivity.cs)%3C%2FP%3E%3CP%3EAdding%20commonly%20implemented%20event%20handlers%20for%20dual-screen%20apps%20(such%20as%20when%20an%20app%20is%20spanned%20or%20unspanned)%3C%2FP%3E%3CP%3EAdjustments%20in%20UI%20files%20(such%20as%20activity_main.xml)%20that%20are%20often%20used%20for%20dual-screen%20apps%20(such%20as%20an%20appropriate%20place%20to%20put%20TwoPaneView)%3C%2FP%3E%3CP%3ELike%20I%20said%2C%20I%20am%20new%20to%20both%20Xamarin%20and%20Android%2C%20but%20I%20think%20most%20developers%20will%20have%20an%20easier%20time%20optimizing%20their%20apps%20for%20Surface%20Duo%20%26amp%3B%20dual%20screen%20once%20they%20are%20confident%20the%20basics%20are%20set%20up%20(since%20like%20everything%20else%2C%20it's%20easy%20to%20forget%20certain%20hidden%20things%20you%20didn't%20need%20before).%20I%20also%20think%20it%20would%20be%20nice%20if%20there%20was%20a%20Surface%20Duo%20Xamarin.Android%20Template%20in%20Visual%20Studio%202019%20(possibly%20as%20part%20of%20the%20Xamarin.DuoSdk%20NuGet%20package).%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1867903%22%20slang%3D%22en-US%22%3ERe%3A%20Creating%20a%20New%20Surface%20Duo%20Xamarin.Android%20App%20Project%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1867903%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F420686%22%20target%3D%22_blank%22%3E%40njsokalski%3C%2FA%3E%26nbsp%3Band%20welcome%20onboard%20%3A)%3C%2Fimg%3E%3C%2FP%3E%3CP%3EJust%20as%20a%20lesson%20learned%20videos%20are%20outdated%20as%20soon%20as%20they%20get%20published.%20Thr%20SDK%20is%20IMHO%20still%20rapidly%20evolving.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20can%20recommand%20you%20the%20samples%20section%20(%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fdual-screen%2Fxamarin%2Fsamples)%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fdual-screen%2Fxamarin%2Fsamples)%3C%2FA%3E.%3C%2FP%3E%3CP%3EAlso%20the%20%22Use%20the%20SDK%22%20provides%20a%20simple%20getting%20started%20with%20all%20you%20need%2C%20including%20the%20first%20event%20handler%20(%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fdual-screen%2Fxamarin%2Fuse-sdk)%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fdual-screen%2Fxamarin%2Fuse-sdk)%3C%2FA%3E.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20you%20have%20any%20other%20question%2C%20let%20us%20know!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1892063%22%20slang%3D%22en-US%22%3ERe%3A%20Creating%20a%20New%20Surface%20Duo%20Xamarin.Android%20App%20Project%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1892063%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F420686%22%20target%3D%22_blank%22%3E%40njsokalski%3C%2FA%3E%26nbsp%3Byou%20might%20be%20interested%20in%20Microsoft%20Learn.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThere%20is%20a%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Flearn%2Fmodules%2Fxamarin-forms-dual-screen%2F%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%22%3Edual-screen%20module%3C%2FA%3E%2C%20which%20is%20part%20of%20a%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Flearn%2Fbrowse%2F%3Fexpanded%3Ddotnet%26amp%3Bproducts%3Dxamarin%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%22%3Eseries%20on%20Xamarin.Forms%3C%2FA%3E.%20Following%20these%20modules%20will%20help%20you%20understand%20the%20basics%20of%20Android%20and%20Xamarin.Forms%2C%20as%20well%20as%20the%20specifics%20of%20developing%20for%20the%20Surface%20Duo.%3C%2FP%3E%3C%2FLINGO-BODY%3E
New Contributor

I am new to Xamarin & Android, coming from a UWP background. I would like to see a video or step-by-step tutorial that includes:

1. Project configuration changes necessary for apps optimized for Surface Duo, including:

The Xamarin.DuoSdk NuGet package

App Configuration, such as Properties, AssemblyInfo.cs, & AndroidManifest.xml

2. Standard code changes

Any Attributes in codebehind files (such as MainActivity.cs)

Adding commonly implemented event handlers for dual-screen apps (such as when an app is spanned or unspanned)

Adjustments in UI files (such as activity_main.xml) that are often used for dual-screen apps (such as an appropriate place to put TwoPaneView)

Like I said, I am new to both Xamarin and Android, but I think most developers will have an easier time optimizing their apps for Surface Duo & dual screen once they are confident the basics are set up (since like everything else, it's easy to forget certain hidden things you didn't need before). I also think it would be nice if there was a Surface Duo Xamarin.Android Template in Visual Studio 2019 (possibly as part of the Xamarin.DuoSdk NuGet package).

5 Replies

Hi @njsokalski and welcome onboard :)

Just as a lesson learned videos are outdated as soon as they get published. Thr SDK is IMHO still rapidly evolving.

 

I can recommand you the samples section (https://docs.microsoft.com/en-us/dual-screen/xamarin/samples).

Also the "Use the SDK" provides a simple getting started with all you need, including the first event handler (https://docs.microsoft.com/en-us/dual-screen/xamarin/use-sdk).

 

If you have any other question, let us know!

@njsokalski you might be interested in Microsoft Learn.

 

There is a dual-screen module, which is part of a series on Xamarin.Forms. Following these modules will help you understand the basics of Android and Xamarin.Forms, as well as the specifics of developing for the Surface Duo.

@njsokalski 

 

Did you have any luck to get started with Microsoft Surface Duo development? If not, maybe we can assist you :).

@tscholzeI sort of threw the Duo part on the back burner for a while as we wait for MAUI near the end of 2021. I have a lot of learning to do before I'd be able to efficiently use a lot of the stuff, so I decided to work more on the basics of Xamarin, since the other stuff will probably be easier to understand and more useful if I do that first. And hopefully there will be more templates for dual-screen stuff in the future as well, so right now I am sort of "practicing" as I make my transition from UWP to Xamarin.Forms & hopefully, at some point, MAUI. Thank you for your help.

@njsokalski 

 

Sounds like a great idea. I hope that MAUI will be production ready with version 1 but I think it is as always "wait and see" how many iterations wie have to wait until we can move from Forms to Maui and if there will be a Duo SDK.

 

Have fun!