Mirror mobile device screen to your computer

I needed to perform a demo of a tool where I would utilize my mobile device (phone) to perform an action, and it caused a reaction on my laptop.  However, part of the “WOW” factor is to mirror my mobile device screen onto my laptop so the viewer can see both the mobile device and the web browser.

Thanks to Apple’s AirPlay this is relatively easy for the iPhone with the purchase of 3rd part software like Air Squirrels Reflector, but I don’t have an iPhone. (I can never figure out how to switch between apps, or how to go back if the app developer didn’t include a back button in the app.  But I digress.)  Instead I have an Android device, which has a much larger user base, and I really didn’t want to switch.  Unfortunately nobody has created a 3rd party application that utilizes the Cast Screen functionality of Android in the same manner as the AirPlay.

In searching I found many solutions that required the user to “root” their mobile device.  This really wasn’t an option for me.  I have a Google Nexus device, so I’m not really held back by mobile vendor limitations, lock downs, or pre-installed software.  No need to “root” my device.  I’ve rooted/unlocked other mobile devices in the past, and since I’m not a mobile developer, I feel no need to tinker with what works for me.

I did manage to find a couple other solutions (one with the help of my co-workers) that did work without altering my device software, or installing applications on my laptop.  Well, that is not entirely true.  Both of the solutions I’m about to share did require the Java runtime environment to be installed, but I consider that a mute point since most computers these days already have it installed for one reason or another. (Most developer IDE’s already require it, so I already had it.)

Step 1 – Ensure you have JRE

As I said, for this to work you will need to have the Java Runtime Environment of some sort installed on your system.  If you don’t already have the JRE installed you can do it at http://java.com.

Step 2 – Connect with USB

You must connect your Android device to your PC via USB connection for this to work.  As of this writing I have not found a way to make this wireless.

Step 3 – Enable Developer Mode

By default Android devices do not come with Developer Mode enabled.  This mode is needed so we can take advantage of debugging via USB tether.

On Android devices prior to 4.2 you could set USB Debugging from the settings…easy-peasy.

To enable this on Android 4.2+ go into Settings->AboutPhone and tap the Build Number 7 times.  The device will inform you that Developer Mode is now enabled.  Click back to hit the previous screen and you will now see Developer Options available.  Check the box for USB Debugging and you’re done.

Step 4 – Download the Android developer tools

For simplicity sake I only downloaded the standalone Android SDK Tools Only. (I had no use for the Studio.) I did this at the URL http://developer.android.com/sdk/index.html#Other, then unzipped the file to a place of my liking.

After making the file ‘/tools/android’ executable I ran it on the system.  This opens the Android SDK Manager window.  The purpose for this is to download and install the needed packages to allow us to “develop” Android apps.  I didn’t change a thing and simply clicked the button that said “Install n packages”. (Note: n will be some sort of number.)

It took awhile for the manager to do the update/download, but after it was completed I simply closed it.  This would have downloaded a bunch of things, but the most important for us is ‘/platform-tools/adb’ which is required to mirror our device screen to the PC. (Make sure this file is executable as well.)

Step 5 – Add locations to the PATH

For this screen sharing to work you will need to add two folders of the Android SDK to your PATH: ‘/platform-tools’ and ‘/tools’.  I did this by editing my .bashrc file as follows:

export PATH=$PATH:/home/aculp/android-sdk-linux/platform-tools:/home/aculp/android-sdk-linux/tools

Step 6 – Download Apps

There are two possible apps to use to do this:

Both carry the same sorts of functionality, however Droid @ Screen is a bit more mature and makes additional options a little easier.  One thing I didn’t like was the need to have an extra window open for the settings.  Due to my being a fan of simplicity I have been using Android-Screen-Monitor.

Both apps are a simple matter of executing the jar file using java and they just work.

Step 7 – Launch it!

Now it is simply a matter of launching either the Android-Screen-Monitor or [email protected] application. I did this via CLI like so:

$ java -jar asm.jar

NOTE: This command assumes we changed directory to where we downloaded the Android-Screen-Monitor jar file.

Conclusion

If you have questions or comments please post them.  I will return to this post and tweak it a bit more to become really easy to use, but for now this is mostly what I did.

Tether Android to Ubuntu for free Internet

A couple of weeks ago I was without Internet (thanks to AT&T), and was forced to go to Starbucks to check email and commit work I had done. While I like going to Starbucks, it was not the best working situation for someone who works from home.

Since I have an Android (HTC Evo) I thought about USB tethering the device to my laptop and Internet sharing, but Sprint hits you with a $29.95/month fee to use that option.  Since I am completely able to work locally without a connection to the Internet, I decided to tough it out and wait until AT&T figured out their mess and got me turned back on.

Fast forward a couple of weeks later… (yes, I am back on the net)

I found some neat applications for my phone that enable someone to bypass the tethering options that Sprint charges for.  One popular application is PdaNet, but it is limited to Windows and Mac. (For those who are still limited by those two platforms, give PdaNet a try.)  Another application I stumbled across called EasyTether has Linux support, so I gave it a try. (I am actually writting this blog post while using it)

The application for the Droid was available on the Droid Market Place, and their website has the Ubuntu file available for the PC connection. http://mobile-stream.com/easytether/drivers.html

I installed the “Lite” version from the Droid Market Place (FREE!!! but limits you to non-SSL pages, unless you pay the $9.99 for the full version) The application walks you through the couple of simple steps needed to use it, and even gives you the address above to get your Windows/Mac/Ubuntu/Fedora up and running.

Once I installed the DEB file on my laptop, after downloading it, all I had to do was connect my phone to USB and open the connection via command line.

The command to link up is:

easytether connect

Now the next time I am without Internet I am ready. 🙂

HTC Evo com.htc.bg problem

So about a month ago my HTC Evo started giving me an error message almost every time I looked at the phone. The message was “The process com.htc.bg has stopped unexpectedly. Please try again.” or something similar to this. It didn’t seem to cause any problems, so I simply clicked the “OK” button and moved on. However, it was a pain the butt to do this almost every time I tried to do something on the phone.

There was nothing that jumps out at me as a single cause for this new error. Some on the web stated it was due to the 2.2 upgrade, but I upgraded to 2.2 almost 3 months prior to getting this error so I know that was not it. I tried un-installing a few apps that I installed around the time it started, but that didn’t work.

I searched the web and found many solutions ranging from turning off the Facebook auto sync, turning off the weather auto sync, and other such things. But basically I think it is a shame to turn off features on the phone to fix a problem. I mean why would I buy a super cool phone, then turn off features that caused me to buy it in the first place to solve a problem? It just didn’t make sense to me.

A couple of days ago I finally had enough and decided it was time to back up the contacts and other data to the SD card and reload the phone to the factory settings. Doing it was easy. Simply click the Menu button, then select Settings. Then I selected the SD & phone storage option, and at the bottom is the Factory data reset. From there you follow the prompts and watch the phone reboot a couple of times. After about 10 minutes I had a brand new phone again.

Of course it took me a bit longer to reload the apps i wanted, and restoring the contacts. But it is done.

So, I still am not sure what caused the error, but it is not happening any more. Problem solved, and I still have all of the nice features I wanted without disabling them.