Tuesday, October 25, 2011

Rooting a Motorola MB502 Charm On Android 2.1 Eclair to Store Apps On SD Card

Another post here outside the '.NET Realm' but I wanted to post some information to help users with the same or similar phone and issue. So I recently got a new unlocked Motorola Charm MB502 for $99 from NewEgg.com (here) so I don't have to be under contract for another 2 years with AT&T. This was my 1st experience with an Android based phone and I quickly found out its idiosyncrasies. However overall this is a fantastic phone for its capabilities and price so I am happy with it.

The phone has a miniscule 200mb or so internal memory and came with no MicroSD card. I starting going hog wild downloading all kinds of cool apps (for free of course) and in no time the phone memory was full. It was to the point where the phone would freeze and I couldn't even send or receive texts. So I had already planned to get a MicroSD Card so I got a Class 10 32GB PNY MicroSD card from NewEgg (this model). The card is amazing and has some crazy read/write speeds. So that's it I am all fixed right? 32GB is plenty of space. WRONG!

The Android 2.1 platform (codenamed Eclair and released January of 2010) only allows storing apps on the internal memory, and music and pictures can go on the external memory. Well that's a bit limiting, but there is a work around. Android 2.2 streamlines this quite a bit to a single command line statement, but on 2.1 it’s quite a bit more involved. However, everything I read for was a complete mess of steps and awfully written walk-throughs so I am mostly writing this post in case search engines pick it up to help out users of this phone or with a phone containing Android 2.1.

So let’s begin with the overall steps that have to take place to allow the phone to store apps downloaded to the external SD card:

1. Download the USB drivers for your phone and install them.
2. Buy a MicroSD card
3. Partition the MicroSD card into 2 parts using 'Mini Tool Partition'
4. Install the MicroSD card into the device.
5. Place the phone in 'Debug' mode when connected via USB
6. Connect the phone to the computer via the USB cable.
7. Root the phone with 'Super One Click'
8. Reboot the phone
9. Link the apps to the SD card using 'Link2SD'

It’s not that difficult to accomplish (can all be done in order in < 30 minutes depending on partitioning size on card), but the forum posts detailing these steps are incomplete. This process was compiled by about 6-8 different sources. Before getting started it is important to note, that while this is not an overly difficult procedure it is probably not for you if you do not have some savvy working with computers and mobile devices. The potential exists here to completely screw up your phone and have a mess on your hands. I am just posting this 'as-is' and have no real expertise on Android phones, so advanced follow up questions for anything related here are better directed to one of the Droid forums and not here. So let's get into each step:

1. Download the USB drivers for your phone and install them: You need to connect your phone to your computer and have it recognized. For the MB502 Charm, you can download the USB drivers at the following link -> Drivers for MB502 After installing the drivers, go ahead and connect the phone to the computer and make sure it worked.

2. Buy a MicroSD card: If you are only planning on installing apps and taking a few pictures then 8GB or 16Gb is plenty of space. However if you plan on dropping the entire MP3 library on your phone (as I did) then go for the 32GB size. As for Class? I recommend a Class 10 card because of the 10mb/s write speeds. Nice for transferring MP3 files to the phone and reducing lag time after taking a picture when being written to the device. If just doing simple apps and no music a Class 4 or 6 should suffice. I highly recommend getting a SD card adapter or something to plug in the MicroSD card via USB for partitioning outside the device in Step # 3.

3. Partition the MicroSD card into 2 parts using 'Mini Tool Partition': Download the 'Mini Tool Partition' (for Windows not the phone) utility to partition the MicroSD card from this here: Download Mini Tool Partition Once downloaded and installed, insert your SD Card adapter into a USB slot containing the MicroSD Card so it can be partitioned. The card must contain 2 partitions: 1 for the main externally written files (pictures and music), and the 2nd partition is for the downloaded apps. Before partitioning make sure to copy off an data on the card (unless it's new and has nothing on it). Open up Mini Tool Partition, right click on the drive representing the card (make sure you select the right drive!!) and say 'Delete'. Now let's make our (2) partitions. The 1st should be named 'primary' and be set as a 'Primary' partition. As for the 'File System': if you have a MB502 Charm then you have to use FAT32 for both partitions. The phone does not recognize the other format types. On other Android phones you can try ext2, ext3, or ext4. It is not a limitation of the Super One Click program, but rather the individual phone. As for size, most say 500mb to 1GB is enough for the apps since they are so small. I did 25GB for my primary, and did 5GB for the apps. You can divide the partitions how you feel is needed. Below are the properties for Partition 1:

Now create the 2nd partition; I named it 'Apps_Data'. It too must be created as a 'Primary' partition as displayed below:

Finally, when all selections have been made select 'Apply' in the upper-left hand corned to have the partitions made on the MicroSD card.

4. Install the MicroSD card into the device: Easy enough. Take the back cover off the MB502 and install the MicroSD card. It is not a requirement but I powered off my device, inserted the card, and then turned the power back on just to do the process cleanly.

5. Place the phone in 'Debug' mode when connected via USB: Consult your manual on how to do this. For the MB502 on the home screen tap the 'Menu' button (left soft key) and select 'Settings'. Scroll to and select 'Applications', select 'Development', and then turn on (check) 'USB Debugging'.

6. Connect the phone to the computer via the USB cable: I usually have my phone unlocked and on when I connect via USB. Give it a few minutes and make sure Windows (or whatever OS) recognizes the device.

7. Root the phone with 'Super One Click': In order for apps to eventually be placed on the MicroSD card, we need to have 'SuperUser' permissions for the Link2SD app. In order to gain this level of access we 'Root' the phone. Rooting the phone also allows you to uninstall any 'System' installed apps. I quickly learned one of the apps I downloaded installed a ton of junk as system apps, and I couldn't uninstall them...until I rooted the phone that is. The easiest way to do this is with an app named 'Super One Click' which runs on Windows (not the phone). Download the application from here: Download Super One Click Install the application and open it up in Windows. All you have to do is press the 'Root' button (displayed below). When asked if you want to install the app, I stated 'Yes' which allows SuperUser to work on the device. Once complete the device will be rooted. For a full list of phones which Super One Click works with, check out the following link: Compatibility List for Super Once Click

8. Reboot the phone: If the Super One Click does not prompt for a reboot after disconnecting the USB cable, then go ahead and disconnect the USB cable after the rooting process is complete, and power off and back on the phone.

9. Link the apps to the SD card using 'Link2SD': Go to the Market, and search and download 'Link2SD'. This application will allow you to manually select installed apps and move them over to the SD card. This process does not happen automatically, so make sure to move apps over to the SD card after installation. Sounds like it might be a pain, but it is really easy and takes only about 5 seconds to do. Once 'Link2SD' is installed, open it up. It is going to go through a series of steps to gain 'SuperUser' access and may ask you to reboot the phone after creating some boot scripts to be used. Follow all on-screen instructions including reboot if required. These steps are only 1 time and not required after completed successfully. I think the 1st time I tried Link2SD it didn't work so I rebooted the phone and tried again and it worked, so keep this in mind. After Link2SD finishes it configuration (including reboot), you are done! Open up the Link2SD app and scroll to any app you want to move over to the SD card and select it. Scroll down to select 'Create Link', and the press 'OK'. You will see a message about Link2SD getting 'SuperUser' access and then your app will be moved to the SD card! You can also use Link2SD to uninstall those pesky spam installed system apps if this happened to you. An app is installed on the system if you see its path start with /system/app/.... Don’t uninstall important apps, but it is useful to uninstall something that was never originally wanted.

That's it! If it didn't work, you probably want to go back through step by step and make sure everything worked properly. The Link2SD app is very picky about those partitions so make sure to get them right. If it is not working it might be because it does not recognize the type of partition you created. FAT32 is the safest bet and the only working one I found on the MB502 Charm. If you need more help, I recommend seeking out one of the Android User Forms where you can ask questions and get further help. ...or just fork out the money and buy a newer phone. :P

Thursday, October 13, 2011

Specifying Document Compatibility Modes for ASP.NET Intranet Sites using IE8

I noticed some oddities on the way an ASP.NET website I was working with was rendering on the intranet, but not through the Cassini development server in VS.NET 2010. This of course makes sense because the development server does not parse and render identical to IIS, but it was still puzzling.

After a bit of research I found that the following setting in Internet Explorer 8: Tools -> Compatibility View Settings -> ‘Display intranet sites in Compatibility View' was checked by default. This ends up having your site render in IE7 mode and was the cause of the odd rendering in my case (i.e. entire dropdowns scrolling along with the screen, HTML header tags not sizing properly, etc.).

The initial thought is just to deselect the option and allow the browser to work in IE8 standards mode. However since we are discussing 'intranet' applications, this problem would persist to all clients of the application unless a mass update was pushed out via group policy which is unlikely.

The easiest fix is to set the document compatibility mode for the site in the Master Page(s) or main page of the site to the browser standard you wish to use. The post is almost outdated as soon as it was published because it is speaking about a browser that is 2.5 years old, but as many enterprises are still on IE8 because of Windows XP, this unintended switch may not be favorable to the developer. All that must be done is add the following meta tag in the header of the webpage (the HEAD section) before all other elements except for the title element and other meta elements:
<!-- Enable IE8 Standards mode -->
<meta http-equiv="X-UA-Compatible" content="IE=8" />
After updating the site on the IIS server and bringing it back up in IE8, you will notice your site render properly even with the default IE8 settings to display 'intranet' sites in ‘Compatibility View’. This topic is actually much more involved than the specific piece of advice covered here, so look to the following if you need any further information.

Defining Document Compatibility