VPN Hell

Working remotely has allowed me to continue doing what I do best while recovering from back surgery. In these past few months of working a part-time job while living in Ohio, I have experienced VPN Hell, where the VPN randomly cuts out, or even worse, disables my computers internet connection completely.

Looking at you Juniper Networks. I stay up at night in fear that my computer might have gone to sleep while the VPN connection was still active, thus preventing my computer from accessing the internet (with or without VPN) when it wakes up. I have become all too familiar with the restart shortcut.

But working at home has its drawbacks, especially when I’m on the move and trying to get VPN on my Droid Maxx. I tried downloading the Juniper Pulse app, but I have encounter all kinds of errors. Pre KitKat: the app would “pretend” to connect to my VPN. The status would say “Connected”, and even give me a time indicator. But whenever I tried to access the internet on my phone, I would get a connection error, and Juniper Pulse would change to “Disconnected”. Stop getting my hopes up you stupid app!

I thought perhaps my now KitKat Droid Maxx might fare better. I entered my username and password correctly, and then proceeded to the 2-Step Authentication (which only occurs if the user/pass are correct, remember that! Its important). Once I successfully entered my 2-Factor Auth, the application said, “Invalid primary username or password”. Huh.. I know the username and password I gave you was right, since I got as far as the 2-Factor Auth!

But my friends, fear not, for I have found a way to get around this annoying problem. I’m not sure what is wrong with their app and authentication (for a VPN company, that does not give me much hope), but you can still use it. In order to get it to work, I accessed the VPN server url in my Android’s Chrome Browser. Using Chrome, I entered my username and password into the authentication box, and proceeded through the login process, completing the 2-Factor Auth successfully. Once that was done. I was take to a page that offered to launch Juniper Pulse from Chrome. I clicked on the Juniper Pulse option, and was asked which app should handle the request (Juniper Pulse duh!). The Juniper Pulse app opened at which point I had to select “I trust this application” to make VPN connections. Do I? I guess I have no choice, but hey, at least I have a VPN connection on my KitKat Droid Maxx, maybe now I can get some work done.

Remote control your (now) headless Android phone

Last night a terrible thing happened, I dropped my Razr Maxx and shattered the screen. In its defense, I have dropped it on many occasions, including (accidentaly) throwing it across a concrete garage (face down), and kicking it into a wall (from bed). Without even a scratch on the screen, it has withstood my abuse like a champ, but last night it just couldn’t handle the sharp jagged rocks that broke the screen.

Sometimes people get lucky, and even though the screen is shattered, its still usable, (albeit, touch sensitivity probably sucks after that). If that was my case… I wouldn’t have anything to write about. No… my screen no longer turned on. So now what?

Remote control it! It is an android after all (pun intended).
Heres what we need:

First thing I did was start up the Android Screencast java program. This little program detected my plugged in phone and immediately brought up my screen. Apparently  if you have a rooted device, you can also send clicks from the program. Unfortunately, my device was not rooted.

In order to send commands to your phone, you are gonna need to use the Android SDK. Once you have it installed, find the platform-tools folder, cd into it, and run:

 ./adb shell

That should bring you into a shell command to which you can send commands to your phone.

ADB Shell

ADB Shell

shell@cdma_spyder:/ $ input
usage: input ...
       input text <string>
       input keyevent <key code number or name>
       input tap <x> <y>
       input swipe <x1> <y1> <x2> <y2>

My first challenge was getting past my lock screen. I have a PIN number, which I was easily able to enter using the command:

input text 1234

Then, came the more challenging part: hitting the submit button. In order to submit my PIN, I had to guess/determine the X Y coordinates of the enter button, and send a tap via:

input tap 350 750

Remember that the Android coordinates screen starts at the top left. So, (0,0) is the top left, (MaxX, 0) is the top right, (0, MaxY) is the bottom left, and (MaxX, MaxY) is the bottom right.

In order to get the Notification Window, I had to swipe down:

input swipe 350 0 350 700

Another neat trick is sending KEYCODES via the

input keyevent

command. You can find a list of KEYCODES here. I particularly found

input keyevent 3

useful, which is the Home button.

Backing up my SMS messages

Backing up my SMS messages

Luckily, I was able to navigate through Android, launch my SMS Backup program, and backup everything I needed, eventually transfering them all to my computer.

Energy Datapalooza 2012

So I thought I’d talk about my recent trip to Washington D.C. to attend the Energy Datapalooza conference. First thing I noticed in D.C. was this: the Metro system there is really nice. I mean really, really, nice. Cleveland’s RTA system could surely take a leaf out of D.C.’s book when it comes to the cleanliness of its stations.But I digress, the conference was very interesting. It started out like this: waking up at 6 in the morning and trying to not to look like a zombie. Getting to the conference was easy (see above: the Metro there is nice!).

Who is that dashing young man on the left? Oh! Thats me!

Ok ok, the conference. It started out with some really great talks, I especially enjoyed the one by the Found and CEO of WattzOn, Martha Amram. WattzOn has definitely got some good stuff going on, and a new app they just released that helps you choose new appliances that are both low-cost and energy efficient. There were quite a few good talks, and then Secretary of Energy, Dr. Steven Chu, gave a great speech on how there is such a large market of energy related applications that are just waiting to be developed.

Oh, and you see the back of that kid’s head on the right side of the video? Thats me too!

There was also an award ceremony for the Apps For Energy contestants, where we were invited onto the stage to shake Dr. Steven Chu’s hand and get our picture taken.

Ok, so after all the presentations, we went up to the 4th? floor and setup our table. I think we took the prize for the most screens on a single table, 2 phones, two tablets, and my laptop (my gorgeous Retina Macbook Pro). Various people walked around checking out the displays. I got to talk with a lot of people and demonstrate our application. Even Martha Amram (WattzOn) stopped by and gave me her business card (which I was excited about). We definitely got some great feedback, so now its a matter of incorporating those suggestions into our application and releasing an update. When your one of two programmers, that can definitely take some time, but I’m working on it!


Update 10/8/2012:

Another video surfaced about the Energy Datapalooza.

Java’s Quirky Modulus

When it comes to them modulus operator, Java can be kinda quirky. Consider the statement:

a % b

If “a” is negative, the result will be negative. On would expect that -1%12 would return 11, as it does in Python. You can get this desired behavior in Java by doing:

(a % b + b) % b

I definitly wasted 5 minutes  debugging this, but at least now I know.

Reference: http://stackoverflow.com/questions/4412179/best-way-to-make-javas-modulus-behave-like-it-should-with-negative-numbers

Energy Datapalooza

It’s hard to believe that only a few months ago, my team and I won second prize in the Student Division of the Apps For Energy Contest. It still hasn’t quite sunken in yet… we won a national competition….that is just amazing. One of my teammates was talking about it to a friend during a car ride (late Chinese food run), and she was totally amazed. Me?… I was amazed at her amazement. Did my team really just place in this national competition? I still feel like the same person. The whole thing just seems so surreal, like it was all a dream.

As a winning team, we have been invited to Washington D.C. to attend the “Energy Datapalooza”, with a booth demonstrating our application. I just got this in the mail, which drives home the impressiveness of what my team has achieved. I’m really proud of my team, but we have a lot more to accomplish before we can rest.

Unleashing the power of data to advance our energy futureThe White House Office of Science and Technology Policy, Council on Environmental Quality, the U.S. Department of Energy, and the U.S. Environmental Protection Agency cordially invite you to join us for an “Energy Datapalooza,” highlighting innovators and entrepreneurs who are using freely available data from the government and other sources to build products, services, and apps that advance a secure and clean energy future.

Monday, October 1, 2012
8:30 am – 2:00 pm

Eisenhower Executive Office Building
South Court Auditorium
Washington, D.C.

Special Guests:

Steven Chu
U.S. Secretary of Energy

Todd Park
Assistant to the President
U.S. Chief Technology Officer

Bob Perciasepe
Deputy Administrator, EPA

Nancy Sutley
Chair, White House Council on Environmental Quality

Heather Zichal
Deputy Assistant to the President for Energy and Climate Change

Jellybean x86 Released

In a previous post, I talked about how to improve the Android emulator speed by using an Intel x86 System Image. The Jellybean Intel System Image is now available via the Android SDK Manager. Head on over and start downloading the Intel x86 Atom System Image for Android 4.1 (API 16).

Stylish Android QR Codes

I was working on my resume today, when I had this idea of embedding a QR Code for Budget It Yourself. I wanted to somehow distinguish that this QR Code was for an Android application, and not a website or iPhone app (but that’s coming someday I hope). After a little bit of experimenting, I found I could overlay colors and images over the QR Code without affecting its readability. I made a few different mockups, so now I have to decide which one I like best. They all seem to scan perfectly fine on my Razr Maxx and Droid X, but there is always that possibility that another phone may not understand them. I could definitely see using a technique like this to display QR Codes for multiple devices (Android, iOS, etc) on posters or spots where space is limited. There is no need to say “HEY! SCAN THIS ON ANDROID ONLY!”.


Budget It Yourself QR Codes

A Faster Android Emulator on Mac (Android 4.0.3 “Ice Cream Sandwich”)

If you have ever tried developing for Android on the Mac, you will know its painstaking slow. I run an iMac i7 (Hyper-threading) with 16GB of RAM, and I find myself grabbing a beer whenever I am using the Android emulator. Until now, I haven’t cared too much about the lack of speed (Hint: Beer). But recently I have been emulating a lot more devices, including tablets. I stumbled upon a Stack Overflow article which described possible ways of improving performance, and found out there is an Intel System Image for Android 4.0.3 (Ice Cream Sandwich).

Everything has been slow on my computer because I have to emulate an ARM processor, but thankfully there exists a version of 4.0.3 that is for Intel. This system image will allow you to run 4.0.3 natively on your Intel based Mac. Unfortunately, there is no Jelly Bean Intel System Image yet, but I can hope. In order to use this emulator, you can follow the steps below to install it:


Step 1

Open up the Android SDK Manager, and brows for “Intel Atom x86 System Image” under Android 4.0.3
Note: There is also one for Gingerbread under 2.3.3 if you want to run Gingerbread natively too.


Step 2

Download the “Intel Atom x86 System Image
Optional: Grab a beer, cause you won’t have an excuse the next time you launch the emulator


Step 3

Navigate to downloaded file:
<Android SDK Location>/extras/intel/Hardware_Acceleration_Execution_Manager/
and open the IntelHAXM.dmg file


Step 4

Running the .mpkg, and make your selection on how much RAM to use. You can always change your mind later by re-running the installer.


Step 5

Open the AVD Manager in Eclipse, and create a new Device. Select “Android 4.0.3 – API Level 15” as your Target, and choose “Intel Atom (x86)” as your CPU/ABI.
Under “Hardware” add the “GPU Emulation” property, and set it to “yes”. Make sure to have “Snapshots” unchecked. Its GPU Emulation or Snapshots, take your pick.
Fill out any remaining fields you wish.


Step 6

Launch the Emulator, and cry a little on the inside about how much less beer will you be drinking. Your wallet thanks you.

Budget It Yourself wins 2nd Place in Best Student App! [Update]


Location: Cleveland, OH

The Budget it Yourself app is a collaborative project from a team of students at Case Western Reserve University and the Cleveland Institute of Art. The app helps users track their energy usage and make energy-savings goals.

Well, it was just announced today that my team’s app won second place!

This is a great achievement for me, and will no doubt further me interesting in mobile development. As one of the requirements perks of winning, we have to keep the application free for one year, and I plan on making multiple updates and improvements along the way.

I want to give a great big thanks to Robert Karam and Patty Ni, my team members for helping make this possible. I look forward to working with them as we continue to develop Budget It Yourself. You can checkout the full announcement at http://energy.gov/articles/first-round-apps-energy-winners-announced-today


We are now on the front page of the Cleveland Institue of Art website! Direct Link: http://www.cia.edu/news/stories/bma-student-cwru-partners-take-prize-in-app-contest

Budget It Yourself – Apps For Energy Challenge sponsored by the U.S. Department of Energy

The U.S. Department of Energy recently launched a challenge to integrate Green Button data into new/existing software. “Green Button is an open standard for sharing electricity data that is available to millions of utility customers, so mash it up with other public data sources to help homeowners and businesses take action, understand their usage and make better-informed decisions.”

I learned about this in email from the Department Chair at Case Western Reserve University, and I was immediately interested in the idea. After getting a team of close friends together, we spent as much as time as possible (considering finals, exams, graduation, and a 40-hour job) on the project. Thus was born…


Budget It Yourself

View Our Submission

When you can budget, you can save. Simply upload your data then enter the PIN into the BIY Android application. Your device takes care of the rest. Budget It Yourself helps you keep track of your own energy usage by making sense of the Green Button data.

Privacy Policy