Slot Machine App Tutorial Xamarin


I have been experimenting with Windows Android Development using Xamarin and C#
. I must admit that I have been a little sceptical as I believe that when you buy in expertise in the form of an Android Developer, or for that matter an Apple iOS developer, you are not simply buying in the ability to code in Java or C#, you are contracting in expertise in the user experience, development, testing and deployment of applications to stores and eventually end users. That said I can see the use development environments such Xamarin and Unity3D to provide a platform for rapid prototyping of applications and games for these platforms. They also serve as a gateway for start-ups and ISVs to enter the rapidly maturing phone and tablet app market.

Download and install Xamarin Studio

First step is to head on over to the Xamarin Download page where you can download the single executable, the really nice thing about this executable is it will download and install all of the pre-requisites to get started developing with Xamarin Studio for free. There are limitations on what you can do with the free version of Xamarin studio however you can certainly get started and learn much of what you need to know without spending any money. If you do find yourself bumping up against the lmitations of the free plan or you simply want to explore some of the premium features then you can access a 30-day trial of the Business edition.

Like doodling on the phone book while you are talking on the phone, I doodle code while answering questions on DIC. Yeah, it means I have no life and yes it means I was born a coder. During this little doodle I decided to make a slot machine. But not your standard slot machine per say, but one designed a little bit more like the real thing. Felgo SDK App Development Develop cross-platform apps Embedded Development Develop embedded applications Game Development Develop cross-platform games Tools & Extensions QML Hot Reload Cloud Builds CI / CD Felgo Qt for WebAssembly Plugins for 3rd-party Services.

Turbo charging Windows Android development

If you have jumped the gun and already run one of the Android Virtual Devices (AVDs) then you will probably have been disappointed with the poor performance, long load times and laggy animations. There is a solution to this in the form of the Intel® Hardware Accelerated Execution Manager, “HAXM”. The recommended way of installing HAXM is to use the Android SDK manager to download the latest version of the tool:

1. Execute the Android SDK Manager, “%LOCALAPPDATA%Androidandroid-sdkSDK Manager.exe”.

2. Make sure you have “Sort by: API level” selected.

3. Scroll down to the Android version you are targeting, and select “Intel x86 Atom System Image”

Xamarin App Tutorial

4. Repeat the the above step for each version of the Android API you want to use.

5. Scroll right down to the bottom and select “Intel x86 Emulator Accelarator (HAXM installer)”.

6. Click the “Install packages…” button in the bottom right hand corner of the Android SDK Manager.

7. Accept all of the Licence Agreements, note that you will have to select the top level items on the left hand side and click Accept on each one until all licences have been accepted:

8. Run the Intel HAXM installer from %LOCALAPPDATA%Androidandroid-sdkextrasintelHardware_Accelerated_Execution_Manager9. Follow the steps to install the Hardware Accelerator.

Create a new AVD

Once the steps from the previous section have been completed you should have all of the development components installed on your Workstation, to be able to make use of the Intel HAXM you will need to create a new Android Virtual Device, AVD, in AVD Manager:

Pdf
  1. Windows Azure Execute the AVD Manage, “%LOCALAPPDATA%Androidandroid-sdkAVD Manager.exe”.
  2. Enter a name for your new AVD, for example – Nexus_7.
  3. Select the Device to emulate, in the example on the right that is a Google Nexus 7 (2012 Vesion).
  4. Select the target API, more specifically one for which you have installed the Intel Atom System Image.
  5. Select “Intel Atom (x86)” from the CPU/ABI drop down, this is essential to get the Emulation Acceleration working, I have called attention to it below.
  6. The remain defaults are sufficient to get you started.
  7. Click “OK” to finish up.

Start developing and using your virtual device

  1. Select the AVD you created in the previous step then click “Start…” on the Right Hand Side
  2. Accept the defaults in the following window and click OK.
  3. Your AVD will start up and boot into Android.
  4. You may find that your Android device is too large for your screen, you can rotate it by pressing Ctrl+F11, at present however this seems to result in the screen being rotated but not the Android Viewport. I solved this by simply moving the AVD to my second monitor and rotating it through 90 degrees

Free Slot Machine App

Further reading

Slot Machine App Tutorial Xamarin Tutorial

Pluralsight has exploded over the last 18 months with the acquisition of PeepCode, digital-tutors and TekPub they have enhanced their already comprehensive library with hundreszds of new courses and extended into the Creative, IT Profesional and Open Source communities. I highly recommend you take a look at their 10 day / 200 minute free trial and review some of their excellent Android, Xamarin and Visual studio courses.

  • Pluralsight: Mono for Android by Jon Sonmez
  • Pluralsight: An MVC4, iOS And Android App With ServiceStack, Xamarin and C# by John Sonmez
  • Pluralsight: Cross Platform iOS/Android with Visual Studio and C# – Part 1 by Jim Wilson
  • Pluralsight: Cross Platform iOS/Android with Visual Studio and C# – Part 2 by Jim Wilson

If you are looking for practical hands on experience editing and deploying your an app then you can’t get much easier than the Xamarin “sharp-shirt” challenge and you get a free C# T-Shirt to boot. Finally Xamarin provide extensive documentation to get you up and running with both Android and iOS development in C#.

Also see:

Best Xamarin Apps

Xamarin C# Tutorial

  • Intel Hardware Accelerated Execution Manager