• Create Xamarin Android App Solution and Project Structure for MyBookStore Sample App

    by  • November 29, 2016 • Android with C# and .NET, Xamarin Mobile App Development • 0 Comments

    In the initial post, we saw a basic overview of developing Android Apps using Xamarin, Visual Studio and C#. While, in the last post, we created a sample HelloWorld Android App and then ran it using Android Emulator. In this post, we’ll start developing an actual Android App using Xamarin and Visual Studio. This App will be called MyBookStore, which will show categories of books, list of books under each category, and will allow users to purchase the books using their Android device. It will be a fully functioning Android app. As there is a lot to cover in this area, so it will span across multiple posts. I’ll explain everything step by step and at the end of this series you’ll be able to build Android Apps using your current .NET, Visual Studio, and C# skills. So let’s get started with setting up our solution and project structure.

    Create Blank Solution using Visual Studio

    As the first step, we’ll create a blank Visual Studio solution and name it MyBookStore.

    01-create-blank-solution

    Add Blank Android App Project

    Right click on your solution in the Visual Studio solution explore and add a blank Android app project in the solution. You can also add a new project using “File -> New Project” option and selecting Android as a template category.

    02-add-blank-app-android-project-in-the-solution

    Add Portable Class Library (PCL) Project

    In this step, you’ll add a portable class library project in your solution. This library will contain some common code which can be shared across multiple projects like Android, iOS, and Windows Mobile. Do not worry about other options for now as we’re only focusing on Android and later on I’ll explain in detail how to use a PCL in multiple projects.

    03-add-portable-class-library

    When you add a Portable Class Library (PCL) project in your solution, it will ask you to select the platforms which you want to support with this library. You can select the platforms as selected in the following image.

    04-select-platforms-this-pcl-will-support

    Add Folders to Organize Code in Shared Library

    Your Portable Class Library is a shared library project, which can be shared and used with multiple projects for multiple platforms. We’ll add many different classes in this project, so it is better to organize all that code in folders to make it more manageable.

    05-add-required-folders-to-organize-your-code-in-pcl

    Final Look of Solution, Projects, and Folder Strucutre

    Once you have completed all the above steps as shared successfully, you’ll see a structure of the solution, projects, and folders as shown in the below screenshot. This will be our starting point for this project. We’ll later on add code, classes, and other artifacts in this solution and these projects to build our Xamarin Android App with Visual Studio and C#.

    06-this-is-show-our-solution-look-like-so-far

    I hope you were successful in creating this solution and enjoyed this post as well. 🙂 If you find difficulty with any of the above steps, you can freely add your comment below and I’ll answer your questions.

     




    Namecheap.com
    Avatar of admin

    About

    GetCodeSnippet.com provides you high quality Microsoft .NET development related articles, tutorials and sample code for ASP.NET, C#, VB.NET, AJAX, WCF, WPF, Web Services, Windows Services, SQL Server and other technologies.

    Leave a Reply