Showing posts with label visual studio. Show all posts
Showing posts with label visual studio. Show all posts

Wednesday, June 10, 2015

Manually install Google Apps on Hyper-V Android emulator

    One of the "hot" new features of Visual Studio 2015 is the new Android Hyper-V emulator. It is an awesome feature as you have a highly performant Android emulator running on the same virtualization engine as the Windows Phone emulator. 
   It is an x86 virtual machine and similar to other Android Virtual machines like Genymotion, Xamarin Android Player the Google applications and services are not installed by default.
     For the other engines they usually support installing Google applications by drag-drop. You just have to download the Google Apps specific for the version of Android your emulator is running (you can download it from here ) and drop the package on the emulator running. For the moment this feature is not supported in the Hyper-V version (might still coming) but you can do it manually with a simple sequence of instructions. 
    
    This is what you need to do:

1. Download the GApps packages specific for the Android version your emulator is running
2. Unzip the file
3. Open an adb command prompt (if you have the Xamarin Tools installed in Visual Studio 2015 open the menu Tools->Android->Android Adb Command Prompt) and navigate where you have unzipped your files and go to the system folder from the archive.
4. Execute this set of commands:
  • adb remount
  • adb shell chmod 777 /system
  • adb push . /system

What this commands do is remount the system partition of the emulator to be writable and pushes the contents of the system folder from the unzipped package to the system folder on the emulator. This is the only things that you have to do. Just wait a little bit and you will see that the emultator starts to install everything needed. You might need to soft reset the Hyper-V emulator to make everything work (you should be actually prompted to login with your Google account). Before pushing the System folder content you can also delete the packages that you are not using.

Let me know if you have problems or if i works via email or twitter (disabled the comments on the blog because of all the SPAM I am getting)

P.S. If the links to the google apps package are not working just copy the package name and paste it in a search engine of you choice and you will easily find a mirror for the package.

Monday, October 8, 2012

Farseer Physics for Windows Store Apps using Monogame

  Last week I did a session on porting XNA Windows Phone 7.x games to Windows Store apps using MonoGame. I have to thank Dean Ellis from the MonoGame project team for all the help. 
 While XNA is not a framework directly supported by Microsoft for Windows Store apps the current version of MonoGame is compatible with Windows 8 and, the most important thing, the applications pass the WACK. There are already several games available in the Windows Store developed using MonoGame (Armed, Skiddy, Rune Legend and I guess there are more). 
   For the session I ended up using the Simple Animation sample but seeing how easy is to share the code between the platforms (Windows, Windows Phone,PC, MAC, iOS, Android, Playstation, Linux) I started looking for a physics engine. The most used Open Source physics engine seems to be Farseer Physics but it was too late to do the porting for my session. On Sunday I tried the porting and everything went pretty smooth. The only thing I've changed was the serialization/de-serialization of the "World" state. I compiled the engine and also the sample. For the Sample project the Content Project was compiled using Visual Studio 2010 (for the moment Visual Studio 2012 doesn't recognize this type of project) and added the xnb's to a Content folder inside the Visual Studio 2012 solution. 
 You can see the result in this YouTube video:


I've used SnagIt to capture the movie and it influenced the frame rate (when running without capturing the framerate is always at 60 fps). The test device was the Samsung Slate which has a powerful cpu. I would love to know if a WinRT device will be able to run at the . If any of my readers has access to a WinRT device please deploy the sample to the device and let me know if the framerate is as expected. For the sample you will have to use an external keyboard and mouse as the touch screen is not working in this version. I will try to fix it for the next release (the problem seems to be inside the MonoGame framework as I only receive the move event and not the pressed and released from the touch screen).
   
Use this link to download the full project (engine and sample): 

NAMASTE