This code detects left/right swipes, with consideration to scaling of DPI and screen sizes. It also correctly detects single clicks on the calendar.

It also has some "error detection" in terms of maxSwipeOffPath (accidental swipes in the wrong direction) and minSwipeVelocity/minSwipeDistance (too slow or too short) to be consistent with swipe detection on your whole Android device.

One of the more interesting features of Sublime Text 2 was the ability to view a file in two places at once. I saw this in a video tutorial on Lynda and wondered if it was possible to do in Eclipse also.

This becomes VERY useful when editing HTML files where CSS/JS declarations are in the header and the content is in the body.

Sublime Text 2

Since I saw this feature here first, I'll write about it Sublime before Eclipse.

Open up the file you wish to edit. Then click on File > "New view into file".

Eclipse

My old trusty Eclipse. Slow and hefty, but it's the Swiss army knife of development for me.

As before, open up the file you wish to edit. This time, click on Window > "New Editor".

If you're doing Android dev, most likely you're working on a computer with an x86 compatible CPU.

Unfortunately the older versions of Android SDK images (including 2.3, still one of the most popular in the play store at time of writing) are optimised for ARM chips. The ARM optimised commands are run in the emulator and then translated into x86 commands. This is very slow, but you since you're reading this you already know that.

Even with the Intel chipset improvements from Icecream Sandwich onwards, the emulator still leaves much to be desired in terms of performance.

Android x86, as the name suggests, was originally made to run Android on x86 computers. A wonderful side-effect of this is that it runs incredibly fast in a virtual machine compared to the standard Android emulator.

Amazingly fast!

And getting it to work for debugging isn't that hard either.

Setup

Grab a copy of Android X86. There seems to be customised builds, but the EEEPC Asus ones worked fine for me.

Been toying around with Sublime Text 2 for the past week, a pretty damn good editor so far. Ran into a strange problem which made it impossible to use.

It took a bit of guess work but it was due to the nature of my workflow. The project files are located on a remote folder, mapped to a network drive via ExpanDrive. There are other reports of people with this issue using Samba, so I'm guessing it's mostly related to working remotely.

While setting up my Android x86 emulator on VirtualBox, I had some issues getting the networking right. VMWare would get this working easily, but it's quite an expensive and heavy handed piece of software if you think about it.

What I wanted was to have my Android x86 guest be able to fetch information from a server running on the host. Also, the host had to be able to connect to the guest for debugging.

After a few searches, I found that some guides only let you connect from host to guest. Others only let you connect from guest to host.

This one says you can connect between the two only if there is a router/internet connectivity. This was a bit of a deal breaker as I do a lot of my work on the train.

After a few hours of tinkering I had great success using "NAT", but only with port forwarding enabled. Two way communication between host/guest, and internet connectivity as well!

To do that:

Go to the VM settings

Network

Ensure that "NAT" is selected

Click on "Advanced"

Port forwarding

Click on the + icon on the right side

Name it (in this case Android Emulator), select either TCP or UDP, you can leave the IPs blank and match the ports you want to forward.

OK to save

Some screenshots of it working

Host to guest for debugging and guest with internet connectivity.

Guest to host connectivity.

How to connect?

You still connect from guest to host via 10.0.2.2, but to connect from host to guest you'll have to port forward the request from host to the guest. From host to guest you use "localhost" or 127.0.0.1 instead of the actual guest IP.