Before writing applications for Xamarin.Forms, you’ll need to install the Xamarin platform on your Mac, PC, or both (if you’re using that setup). See the articles on the Xamarin website at:
You’re probably eager to create your first Xamarin.Forms application, but before you do, you’ll want to try creating normal Xamarin projects for the iPhone and Android and normal Windows, Windows Phone, and Windows 10 Mobile projects.
This is important: if you’re experiencing a problem using Xamarin.iOS, Xamarin.Android, or Windows, that’s not a problem with Xamarin.Forms, and you’ll need to solve that problem before using Xamarin.Forms.
Creating an iOS app
If you’re interested in using Xamarin.Forms to target the iPhone, first become familiar with the appro-priate Getting Started documents on the Xamarin website:
This will give you guidance on using the Xamarin.iOS library to develop an iPhone application in C#. All you really need to do is get to the point where you can build and deploy a simple iPhone application on either a real iPhone or the iPhone simulator.
If you’re using Visual Studio, and if everything is installed correctly, you should be able to select File > New > Project from the menu, and in the New Project dialog, from the left, select Visual C# and iOS and then Universal (which refers to targeting both iPhone and iPad), and from the template list in the center, select Blank App (iOS).
If you’re using Xamarin Studio, you should be able to select File > New > Solution from the menu, and in the New Project dialog, from the left, select iOS and then App, and from the template list in the center, select Single View App.
In either case, select a location and name for the solution. Build and deploy the skeleton application created in the project. If you’re having a problem with this, it’s not a Xamarin.Forms issue. You might want to check the Xamarin.iOS forums to see if anybody else has a similar problem:
Creating an Android app
If you’re interested in using Xamarin.Forms to target Android devices, first become familiar with the Getting Started documents on the Xamarin website:
If you’re using Visual Studio, and if everything is installed correctly, you should be able to select File > New > Project from the menu, and in the New Project dialog, from the left, select Visual C# and then Android, and from the template list in the center, select Blank App (Android).
If you’re using Xamarin Studio, you should be able to select File > New > Solution from the menu, and in the New Project dialog, from the left, select Android and App, and in the template list in the center, select Android App.
Give it a location and a name; build and deploy. If you can’t get this process to work, it’s not a Xamarin.Forms issue, and you might want to check the Xamarin.Android forums for a similar problem:
Creating a Windows app
If you’re interested in using Xamarin.Forms to target Windows, Windows Phone, or Windows 10 Mo-bile, you’ll need to become familiar with at least the rudiments of using Visual Studio to develop Windows applications:
In Visual Studio 2015, if everything is installed correctly, you should be able select File > New > Project from the menu, and in the New Project dialog, at the left, select Visual C# and Windows. You’ll see a hierarchy under the Windows heading something like this:
The first Universal heading under Windows is for creating a Universal Windows Platform applica-tion that can target either Windows 10 or Windows 10 Mobile. Select that, and from the center area select Blank App (Universal Windows) to create a UWP app.
The other two project types supported by Xamarin.Forms are under the Windows 8 header. The Universal item actually creates two projects—a Windows desktop application and a Windows Phone application with some shared code. For creating just a Windows application, choose Windows and then from the center section Blank App (Windows 8.1). For a Windows Phone application, choose Windows Phone and Blank App This creates a project that targets Windows Phone 8.1.
These are the three project types supported by Xamarin.Forms.
You should be able to build and deploy the skeleton application to the desktop or to a real phone or an emulator. If not, search the Microsoft website or online forums such as Stack Overflow.
All ready?
If you can build Xamarin.iOS, Xamarin.Android, and Windows applications (or some subset of those), then you’re ready to create your first Xamarin.Forms application. It’s time to say “Hello, Xamarin.Forms” to a new era in cross-platform mobile development.
I hope I have helped in something. Until the next opportunity!
Twittear
No hay comentarios:
Publicar un comentario