July 08, 2012

ICS Power Management

Moving to ICS on the Samsung SII has been underwhelming for the most part - partly driven by the fact that the UI has been kept relatively stale by Samsung, and made worse by the fact that ICS while powerful, has more than a few hiccups during operation.

But there is one aspect that ICS is really good with - memory management. ICS comes with a Honeycomb inspired task switcher that also doubles as a task killer. Flicking an application in the task switcher kills it, releasing the memory and plausibly making battery usage better.

Well at least that was the theory, till I tried to put it in practice and presto - it worked! Check out the screenshot showing a run time of a day and eight hours with more than 40% of the juice still to go. Yes, the usage was not as heavy as I normally do with the phone, but still a 32 hour run time was not something I had frankly expected.

June 27, 2012

Some Carat Juice

Finally, looks like there is a potential solution for the battery drain problems within the Android eco system. Carat is a research project that aims to detect energy bugs - app behavior that is consuming energy unnecessarily - using data collected from a community of mobile devices. It is an active research project, run out of Berkeley.

For the first week, the tool merely sits around, waiting for you to run it so it can report usage data back to the mother ship. And once you have enough samples sent back, the tool begins to give you personalized recommendations. My biggest recommendation was to kill the “Accuweather” weather widget. I did that and - presto - my battery use graphs seem to have gone flatter than usual.

The most interesting part is the approach taken by the team - not with an analysis of the API calls an application makes or their abuse of wakelocks etc. Instead it is statistical, based on a massive data mining effort of similar devices. Innovative and for the moment, seems effective.

June 25, 2012

Finally - ICS for Galaxy S2

AT&T had been hinting at the Ice Cream Sandwich upgrade to the Samsung galaxy SII for a while now. Last week it even went so far as releasing the update and then rolling it back after some customers were able to get it.

Looks like whatever kinks Samsung had in producing a custom version for the US market seems to have been taken care of and my phone is now running ICS. Here is a screenshot.

The upgrade process itself was smooth - took all of about five minutes once the backups and such were completed. The only nit-pick, was that you had to install Samsung Kies to actual do the update instead of doing it over the air (OTA). But considering this was a major version upgrade, I did appreciate the backup opportunity Kies presented.

First impressions - not that many actually. Because the version of ICS is a Samsung customized, AT&T pre-loaded version, it is not that different from the Gingerbread copy. But, just beneath the surface there are differences. The biggest being the smoothness with which the interface seems to be working. And of course the subtle UI elements, like in the settings menu. It seems like someone actually spent time thinking about the end user while putting these together.

More details later, but for now, screenshots of the upgrade itself.

May 27, 2012

Rooting Thrive ... Done!

Thanks to dalepl and his unbelievably awesome Universal Easy Flash Tool - I now have root on my Thrive.

The best part is the process to get there, it was as easy as

  • Install the correct ADB drivers on your laptop (available within the same zip file from dalepl)
  • Connect the Thrive to the laptop via USB mini and ensure it is connected to the charger at the same time.
  • Run the batch file Universal_Easy_Flash_Tool.bat

Confirm the fact that you want to root the device...

And pick the correct ROM that you are currently on...

And after about 4 reboots of the device - you are done!

Thank you @dalepl and @TurnYourBackAndRun - honestly Toshiba should be paying you for keeping their devices relevant. Now to kick some pre-installed crud off the device.

May 07, 2012

Abstract interfaces

Gimp 2.8 - an important milestone in the road to Gimp 3 - is out. But this post is not about the new single window UI, or about the fact that saving an image is easy for the first time. This post is about the path to get to version 2.8.

Gimp is powerful - not entirely Photoshop powerful - but more than sufficient to handle anything an amateur photography enthusiast might want to throw at it. But overshadowing it's power is a user interface that feels piecemeal and awkward. If I had to summarize it's problems - it would be this: the interface lacks abstraction.

When a programmer builds user interfaces, it is a bit like an engineer trying to sell a product. A programmer knows exactly how piece of functionality works - what the variables are, what the functions do. The user interface reflects that - a list of inputs for the variables, organized into groups of functions. This would be perfect, if the goal of a user was to run the various functions - but when the user comes in to perform a task, the interface begins to get in the way.

A great abstraction bridges the gap between the user task and tool functionality.

And Gimp is taking it's first steps in that direction. Starting with a brutal evaluation of the current state of the interface, the Gimp team is doing what any good built-by-consensus project would. Reach out to the community for ideas.

But there is many a step before Gimp begins to resemble a polished UI. While that in no way means copying the Photoshop interface, but it involves coming up with a way to interact with the user in such a way as to provide capability and not functions. Of taking all available ideas and distill them into a coherent experience. But again, just like consensus might not be the best way to build a program, it might not be the best way to polish an interface. Maybe it just takes singular vision.

April 28, 2012

The Cyanogen Mod

It has been about two years since we bought the Nexus One. Which is great timing for the two-year itch - that starts something like “Now that the phone is not under warranty, do you think we should ...”.

To add to the itch was a real problem - Nexus One's fatal flaw so to speak. The phone has a minuscule amount of memory on board - a paltry 512MB which not only included the entire Android installation, but other pre-installed crud disguised as system applications. This meant even after moving some of the applications to the SD card, we were forever playing a game of whack-a-mole trying to free up just enough disk space for the phone.

That is when I decided to replace the original firmware with CyanogenMod 7(CM7). And since this was a phone that was not going to be customized heavily - the reasons to modify were fairly light.

  • Because I could
  • So that I could uninstall the various system applications like the Amazon MP3 for instance
  • So that I could get App2SD capability inbuilt
  • Because I could

The process I followed was the official process prescribed in the wiki over at the CM site. Here are some notes to go with the instructions in the wiki, that I am not planning to leech over.

Backup

Always important to backup. Especially since the process of unlocking the bootloader will reset your device to factory settings.

I used GO SMS Pro to backup SMS. Which by the way, is a great replacement for the custom SMS app. Astro File Manager to backup all applications. Then connect the phone to a computer and copy over the entire SD card as well.

Unlocking the Bootloader

A couple of things to keep in mind while unlocking the bootloader - firstly the phone is going to reset to factory settings. Don't ever think that you will be able to keep it like-for-like. Secondly a by-product of the reset is that if you have had to enable the developer mode to access the SD card via USB, you will need to re-enable that.

Custom Recovery Image

While the wiki mentions this in passing, once you reboot this step is essentially undone. So moving from this step to the next must occur without a reboot. Which brings us to the second question - how does one then “boot into recovery”? The process varies by phone, but in the case of the Nexus One - briefly click the power button after installing the recovery image. This will refresh the options on screen giving you a recovery mode to boot into.

Flashing CyanogenMod

If you were following along, here is where you need a lot more preparation than the wiki lets you in on. In reality you are already in step 4 of this section by the time you are done with the previous section. So if you were planning on downloading the zip files at this point - tough luck. Maybe that is something you do when you backup? Or at least when you get the recovery images in, make sure you copy the CyanogenMod version you want to install onto the root of the SD card. Otherwise, you might have to re-boot into the factory fresh device to do that.

Restore from backups

Final bit of a heads-up. When you restore from backups using Astro File Manager, it has a tendency to restore all applications to the phone internal memory. So after the first few, the rest of them are going to fail. So you might have to restore them one-by-one, moving the big apps to SD along the way.

That is it, more than a week into the installation, and the phone is still going strong. A detailed view of CM is probably going to follow - but so far really good.

March 03, 2012

Configuring PPTP VPN

This post is the last in the series of upgrades I completed on my router running the new TomatoUSB router firmware. Most data for this post is thanks to this tutorial

Requirements:

  • A router running TomatoUSB
  • Install and configure Optware on the router
  • A way to address the router from outside the home network - like setting up a dynamic DNS maybe
  • A VPN client to connect to the router

Installation

Log onto your TomatoUSB via SSH and run the following on the shell

ipkg install poptop

That is it. Wait for ipkg to do it's thing and you are done installing.

Configuration

Edit the file /opt/etc/pptpd.conf

I installed what is called a Single-Net configuration, after logging in, the entire network is available to the VPN. This was a home network, and I wasn't going to implement any sort of zoning on it.

Ensure the following line is commented

logwtmp

Establish the list of available IP addresses. Here is what I have

localip 192.168.1.1 #This is the local IP address of the router remoteip 192.168.1.245-254 #These are the available remote IPs to be used when a remote VPN connection is made

Edit the file /opt/etc/ppp/options.pptpd

Here is what I have as the final configuration. I have removed the prompts & help text to keep it clean(er).

name pptpd #chapms-strip-domain # BSD licensed ppp-2.4.2 upstream with MPPE only, kernel module ppp_mppe.o # {{{ refuse-pap refuse-chap refuse-mschap # Require the peer to authenticate itself using MS-CHAPv2 [Microsoft # Challenge Handshake Authentication Protocol, Version 2] authentication. require-mschap-v2 # Require MPPE 128-bit encryption # (note that MPPE requires the use of MSCHAP-V2 during authentication) require-mppe-128 # }}} # OpenSSL licensed ppp-2.4.1 fork with MPPE only, kernel module mppe.o # {{{ #-chap #-chapms # Require the peer to authenticate itself using MS-CHAPv2 [Microsoft # Challenge Handshake Authentication Protocol, Version 2] authentication. #+chapms-v2 # Require MPPE encryption # (note that MPPE requires the use of MSCHAP-V2 during authentication) #mppe-40 # enable either 40-bit or 128-bit, not both #mppe-128 #mppe-stateless nomppe-stateful # }}} # Network and Routing ms-dns 192.168.1.1 #ms-dns 10.0.0.2 #ms-wins 10.0.0.3 #ms-wins 10.0.0.4 proxyarp # Logging #debug #dump # Miscellaneous lock nobsdcomp

Authentication & Credentials

Create the file /opt/etc/ppp/chap-secrets with the VPN setup credentials. My file looks like below, of course with a valid username & password.

# Username Server Password AllowedIPs myusername * myawesomepassword *

As with any password file, ensure it is only readable by root by running the following as root.

chmod 600 /opt/etc/ppp/chap-secrets

Configure Firewall

Create the file /opt/etc/config/vpn.fire and put the following in it

#!/bin/sh iptables -A INPUT -p gre -j ACCEPT iptables -A INPUT -p tcp --dport 1723 -j ACCEPT iptables -A INPUT -i ppp+ -j ACCEPT iptables -A FORWARD -i ppp+ -j ACCEPT iptables -A FORWARD -o ppp+ -j ACCEPT

Make the script executable by running the following

chmod +x /opt/etc/config/vpn.fire

Restart the firewall service

service firewall restart

Start VPN server

This is the last step. Create the file /opt/etc/config/vpn.wanup and add the following

#!/bin/sh if [ ! -f /tmp/ppp/chap-secrets ]; then mkdir -p /tmp/ppp ln -s /opt/etc/ppp/chap-secrets /tmp/ppp fi /opt/etc/init.d/S20poptop restart

Make this script executable

chmod +x /opt/etc/config/vpn.wanup

That is it, this will ensure the vpn always runs whenever the WAN comes back up. The VPN is up and running.

Testing it may end up being a bit tricky. You cannot log into the network while you are on it. I used my phone, disabled WiFi, and configured it to log in via the mobile network to ensure that the VPN was indeed accessible and working. Presto, I could log into my home network from anywhere in the world.

Check out the original post about ways to configure a VPN client on an iOS or Android device.