Site Tools


RhinoMobile - HelloRhinoMobile

Overview | Get Started | HelloRhinoMobile | Your Project | Simulators | Devices | Profiling | Notes


This page presumes you have gone through the Get 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. (NOTE: The first time you build RhinoMobile.Touch, the libopennurbs library must be compiled. Subsequent builds will be much, much faster). 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. (NOTE: The first time you build RhinoMobile.Droid, the libopennurbs library must be compiled…this can take up to 20 minutes. Subsequent builds will be much, much faster).
  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…


Windows 8.1 Step-by-Step Instructions

:!: WARNING: This section is a work-in-progress: Information may be missing or incomplete.
  1. Launch Visual Studio and open the HelloRhinoMobile solution. (These instructions presume you are using Visual Studio 2013 Professional).
  2. Right-click the HelloRhino.Droid project and select Set As StartUp Project from the drop-down menu. This makes HelloRhino.Droid the active project for the build. (HelloRhino.Droid is the Android target project. The .Droid suffix is a naming convention from Mono that avoids namespace collisions with the main Android libraries).
  3. Open the Android Emulator Manager: Navigate to Tools > Open Android Emulator Manager. A window called the Android Virtual Device (AVD) Manager should appear. 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.
  4. The default AVDs are much too slow for development; Highlight each of the existing AVD and click the Delete button.
  5. To create a new AVD: Click the Create button. The Create new Android Virtual Device (AVD) window appears. Create a new AVD with the following parameters. AVD Name: Nexus7-API17; Device: Nexus 7 (7.02“, 1200 x 1920:xhdpi); Target: Android 4.3 - API Level 18; CPU/ABI: Intel Atom (x86); Skin: Skin with dynamic hardware controls; Front Camera: Webcam0; VM Heap: 64 Emulation Options: Use Host GPU enabled
  6. 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.
  7. Close the AVD Manager. Switch back to Visual Studio.
  8. Click the Info button in the Xamarin.Android Toolbar.
  9. This brings up the Android Device Logging window. Click the Change Device button
  10. This brings up the Select Device window, listing all running devices (emulators and physical devices). Click the Start emulator image button.
  11. This brings up the same list of Available AVD images that you saw in the Android Virtual Device (AVD) Manager window. Select the Nexus7-API18 AVD that you just created above. Click OK.
  12. 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. We are now ready to send the app to the emulator.
  13. In the Solution Explorer, right-click the HelloRhino.Droid project, and select Deploy. HelloRhino.Droid will build, along with its dependency, RhinoMobile.Droid. (NOTE: The first time you build RhinoMobile.Droid, the libopennurbs library must be compiled…this can take up to 20 minutes. Subsequent builds will be much, much faster).
  14. Once the app has been deployed to the running emulator, you can now run the app. In Visual Studio, click the Start button. If all goes well, you should see something like this…
developer/rhinomobile/hellorhinomobile.txt · Last modified: 2014/07/17 by 199.48.48.98