Monday, February 6, 2017

Debugging Xamarin.Android applications on an Acer Netbook

The Netbook

I have an old Acer Aspire One D255 (Atom CPU, 1024x768 display) that’s never really had a proper use. It was a salvaged machine from a relative which arrived needing a new battery and a new screen, followed shortly by a new hard-drive (I suspect it didn’t like being repeatedly dropped). And the little machine got bumped up to 2gig of ram (max capacity) simply because I had a spare stick.

It’s not great running Windows (ok terrible), so it got some use running live versions of Linux ( which worked fairly well. But at the end of the day, I’ve got better hardware for that purpose.

So what else can I try? – let’s see if I can get it running Android!

Android-x86 Project and Remix OS

My first stop was, which provides source code and compiled images for running Android on x86 hardware, and is a popular option for running Android on old PCs. But after a little bit of digging, I decided to try Remix OS It’s another free option for running Android on a PC. The founder of Android-x86 joined the team, which was reassuring, but the most attractive feature to me was the added mouse and keyboard support. The installation walkthrough and installer didn’t hurt either.

Installing Remix OS

Installation was well, easy. I downloaded the 32 bit installation package from within Windows 10, ran the provided installer and selected the 32gig installation option (I had plenty of drive space free).

Once the installer finished on the Windows side, I was prompted to reboot and the installation continued. This is where the re-partitioning and installation actually happens. And it took about 15 minutes on the little netbook.

After another reboot, Remix was added to the boot menu. After selecting it I got the Remix OS logo, and shortly after I was looking at a customized version of Android running on the Acer. Cool!

Android Debug Bridge

Now to deploy an Android application. The steps below require your Android device to be rooted, fortunately that’s done for us with Remix.

First, make sure both your development machine and your Android device are connected to the same Wi-Fi network.

Next, we need to enable adb connections over Wi-Fi in Android. And for that we’ll need the IP address. Open the Settings app, then select About –> Status and note the address.

Open a terminal; Remix OS includes a terminal app named Terminux. If you’re not using Remix you can download a terminal app from the Google Play Store.

Enter the following commands:
setprop service.adb.tcp.port 5555
stop adbd
start adbd
Your device is now ready to accept adb connections on port 5555.

Switch to your development machine and either open a command prompt if using Windows or a terminal on a Mac.
adb tcpip 5555
adb connect <ip address of Android device>
Note – adb.exe may not be in your path on Windows. If so, you’ll need to navigate to the Android SDK platform-tools folder.

With that done, my Acer appeared as selectable device/deployment target in Visual Studio 2015. And I could deploy and debug to it like any other connected Android device.

Final Thoughts

This was a fun project, and I was excited to try out Remix OS. The custom Windowing features and mouse and keyboard support are pretty fantastic. Unfortunately performance on the Acer wasn’t great and it locked up twice during testing. That plus the added hassle of manually connecting adb means it’s just not as useful as a consumer Android tablet for testing. A faster laptop might make a really interesting test device, especially with Remix OS’s ability to resize the window for running Android applications.