Site Tools

RhinoMobile - HelloRhinoMobile

This page presumes you have gone through the Getting Started page and have successfully installed Xamarin Studio, Xcode, and all the requisite libraries. If you're ready, let's get the HelloRhino app building on both iOS and Android, and after we can take a look at how all the pieces fit together to share code between the platforms.

Mac OS X Step-by-Step Instructions

  1. Launch Xamarin Studio and open the HelloRhinoMobile solution.
  2. Add your Apple Developer account to Xamarin Studio's preferences. You can access the Developer Account settings page by navigating to Xamarin Studio > Preferences > Developer Accounts. You will have to register as a developer with Apple if you haven't done so already.
  3. Right-click the HelloRhino.Touch project and select Set As Startup Project from the drop-down menu. This makes HelloRhino.Touch the active project for the build. (HelloRhino.Touch is the iOS target project. The .Touch suffix is a naming convention from Mono that conjures CocoaTouch - the iOS library. It is also a convention that avoids namespace collisions).
  4. Verify that the build is set to Debug and the device to iOS Simulator > iPhone iOS 7. Click the Play/Run button.
  5. Start a Xamarin Trial. The Xamarin Starter edition allows you to unlock a 30-day trial of the full Business Edition, which will be necessary for building and using RhinoMobile. You will need to create a Xamarin Login. If you are unable to start a trial after creating a login, don't worry, Xamarin Studio will prompt you to when you try to build RhinoMobile projects. You may need to clean the project, and build again if you still get errors concerning the eval edition.
  6. Exit and restart Xamarin Studio.
  7. From the Xamarin Studio Home Screen, re-open HelloRhinoMobile solution.
  8. Verify that Xamarin Studio's full edition has been activated. Navigate to Xamarin Studio > About Xamarin Studio > Show Details. Scroll down and make sure the Xamarin.iOS and Xamarin.Android are set to Trial Edition.
  9. Close the About Xamarin Studio window.
  10. Click the Play/Run button again. This time the Build should succeed without errors. After uploading the app bundle to the Simulator, you should see the following:
  11. When you done playing around with the HelloRhino example on the iOS Simulator, click the Stop button in Xamarin Studio to stop the Debug session.
  12. Now let's build and run the Android version. Right-click the HelloRhino.Droid project and select Set As Startup Project from the drop-down menu. As expected, this makes the Android project the default project for the build. (Much like .Touch, .Droid is a Mono naming convention that avoids namespace collisions and denotes the Android target project)…
  13. Verify that the build is set to Debug. The time, the device selection drop-down should be disabled. This is because you don't have an Emulator setup, so let's do that now.
  14. Click the Play/Run button to start the HelloRhino.Droid debug build.
  15. The Select Device window should appear. This is the window where you tell the Android SDK which emulator or device you would like to use for testing. None of the defaults will do, so let's create a faster emulator…
  16. Click the Create Emulator button.
  17. The Android Virtual Device Manager should launch. This is part of the Android SDK and will be familiar to you if you have done any Android development before. This is where you define your Android Virtual Devices (AVDs) that run in the Emulator.
  18. Highlight each of the existing AVD and click the Delete button. These AVDs are much too slow for development.
  19. To create a new AVD: Click the New button. The Create new Android Virtual Device (AVD) window appears. Create a new AVD with the following parameters. AVD Name: Nexus7-API17-IntelHAXM; Device: Nexus 7; Target: Android 4.2.2 - API Level 17; CPU/ABI: Intel Atom (x86); Front Camera: Webcam0; VM Heap: 64 Emulation Options: Use Host GPU enabled.
  20. You should see your new AVD in the list. You have just created your first AVD. More information on creating Emulators can be found in the Android documentation. You can create as many as you need. Tips on using the Emulator can be found in the Simulators & Emulators page. For the moment, quit the Android Virtual Device Manager and return to Xamarin Studio.
  21. You should see the Select Device window again, this time with your new AVD in the list. Highlight the AVD and click the Start Emulator button. If all went well, after a brief startup period (take our word for it, it's much quicker than the standard emulators) you should see Android boot. It may take extra time to launch the first time and it is highly recommended that you leave this window open during your development session. Once Android boots, you are ready to go…you just need to unlock the device by sliding the lock to the right.
  22. Do not close the Android Emulator. Switch back to Xamarin Studio. In the Select Device window, if the not started label has not already disappeared, click the Refresh button. Once you see the AVD in black, selectable type-face, you know that Xamarin Studio is ready to launch the app on the Emulator. Highlight the AVD and click OK.
  23. If all goes well, much like on iOS, you should see the following:
  24. When you are done playing around with the HelloRhino.Droid build, click the Stop button back in Xamarin Studio to stop the debug session. Congrats! You've built a RhinoMobile app for two platforms…with (mostly) the same, shared code…

:!: Tip: Xamarin Studio's trial edition places a 24-hour time limit on app builds. You may get this message that says “Trial executable has expired (24 hour limit)” error dialog. This is an annoyance. To work around this pesky limitation and continue to tinker during you 30-day trial, you need to do the following: Double-click the name of the project you are trying to build in the Solution Pane of Xamarin Studio. This should bring up the Project Options dialog. Under the Build section on the left, select iOS Applications. Change the Bundle Identifier to something else, such as: com.yourdomain.foobar. Click OK. In Xamarin Studio, select Build > Clean All. Finally, reset the simulator.

Windows 8 Step-by-Step Instructions

:!: WARNING: This section is a work-in-progress: Information may be missing or incomplete.


developer/rhinomobile/hellorhinomobile.txt · Last modified: 2014/03/19 by dan