Android: Uninstall Factory Applications

After I rooted my Android phone, via the steps here, my first task was to un-install the bloat-ware.  Before removing apps, I made sure to Google my phone to see what apps were safe to remove.  Here’s a sample list I referenced.

Though there are GUI apps available in the Play store, I chose to use Android Terminal Emulator (ATE).   This is a command-line tool for entering Linux commands.  Here are the key commands to use:

1.  Open ATE and give yourself administrative/super user access by typing:

  • su

2.  Navigate to the application directory and list the currently installed applications (Note that *.apx are the main application files):

  • ls /system/app
3.  To remove an app, type the following command variant:
  •  rm /system/app/(APPNAME).apk
Note:  There is no resulting prompt identifying that the file was deleted.

4. It is likely that you will receive the following message: 

  • rm failed for /system/app/com.amazon.mp3.apk, Read-only file system

If this occurs, you need to mount your /system as read-write before you can delete.  This is the command I used for my ROM:

  • mount -o,remount -t yaffs2 /dev/block/mtdblock4 /system

5.  Many .apk apps have a related *.odex file.  It is beyond the scope of this post to explain the filetypes but you can remove them after you remove the *.apk :

  • rm /system/app/(APPNAME).odex

Once you’re done with the app removals, you may notice that you have not acquired more free space.  This is because the applications’ space are still being held in the Dalvik cache.  This cache is a temporary space used by the Java virtual machine to run Android applications. No worry, you can reclaim this space by utilizing the ATE:

1. Again, open ATE and give yourself administrative/super user access by typing:

  • su

 2.  Navigate to the Davik cache:

  • cd data/dalvik-cache

3.  Clear the cache:

  • rm *

4.  Leave ATE by typing:

  • exit

5.  Reboot your device.

Android: Root Your Device

Lately, I’ve been receiving allot of “Phone Almost Out Of Memory” messages on my Android 2.2.1.  I was frequently having to delete text messages and clearing browser cache, etc.   Interestingly (and suspiciously) enough, at this time I also became eligible for my “new-every-two” phone.  I saw this as a perfect opportunity to do some rooting and other experimentations.  After all, if I bricked the phone I would just get a new one.  Here are the steps that I would advise before rooting:

1.  PREPARE YOUR BRAIN:

  • If you’ve never heard of rooting, Linux, .NET Framework, or “command line” then STOP NOW, STEP AWAY from your device, and continue no further. 

2.  PREPARE YOUR WINDOWS PC:

  • Make sure you have at least .NET Framework 2.0 installed (I used Win7 with .NET 4.0.)
  • Download the drivers for your Android device from the manufacturer’s website or, if available, the CD that came with your device.
  • Download SuperOneClick via the developers blog. (I used v2.3.3.)  If you prepare to do all the heavy-lifting instead of using a software solution then continue no further. 

3.  PREPARE YOUR ANDROID DEVICE:

  • Back up your SD card.
  • It is also advised that you back up your entire system by using Titanium Backup or similar software. I skipped this step. Like I mentioned, mine is an old phone that is headed to my graveyard of disassembled devices.
  • Enable USB Debugging mode on your Android by navigating Android: Tap Menu > Settings > Applications > Development.
  • Unmount your SD card: Tap Menu > “SD Card & Phone Storage” then “Unmount SD Card.” 

4. ROOT IT

  • Connect the device to your PC via USB.
  • On your PC, navigate to and click on SuperOneClick.exe.
  • Finally, the SuperOneClick software opens up and you then click “Root.” 

You’ve done it.  You can now get SuperUser access, uninstall bloat-ware, replace your ROM, or whatever your imagination desires.    See “Un-installing Apps.”

SQL Server Error: Recover [DBNAME] From Suspect Mode

This error can occur when the error log file does not match the database file or when the .mdb file is detected as being corrupt.

There are multiple ways to fix the problem and the solution depends on whether or not your database has data that is critical for you to keep. For me, I only get this error on my local box where I’m conducting allot of experiments and tests so that there is no need for me to worry about critical data. This makes the restoration task much more simple.

First, I try the following canned stored procedure : sp_resetstatus. If this fails then the following always works:

  1. Stop the SQL Server database & services
  2. Rename or move the “msdblog.ldf” & “msdbdata.mdf” files
  3. Copy “msdblog.ldf & msdbdata.mdf” files from any other working database installation to the same path
  4. Start the SQL Server database

Intro to XML and Serialization

XML (Extensible Markup Language) is a set of rules for encoding documents sent across the internet. In simpler terms, I tend to view XML as more of a format for passing data. Let’s say you were online shopping for a calculator. The website would collect your data. For example,

Name: Master Chief
Address: 50 Forerunner Lane 98356
Item: Calculator
Price 76.98

The data above is easy for you to read if you are human, speak English, and live in America; however, if you are in France then it would need to look different for you to understand. That is one reason we have internet standards, formats, languages, etc. — we want computers “anywhere to be able to read your data and translate it to human verbatum.

If we were to translate your data into read-able XML, then it would first look something like this:

<name>Master Chief</name>
<address>50 Forerunner Lane 98356</address>
<item>Calculator</item>
<price>76.98</price>

Now, for the complicated part — serializing and de-serializing the data. Once your computer is ready to actually send the data to it’s destination, it must be serialized. Serialization is the process of converting the data into a format that can be easily sent across the internet. My definition of serialization is the breaking up of data into small parts so that it can be sent more quickly and efficiently. Once the data reaches it recipient, then it must be deserialized back into the format above.

The data above may seem pretty simple to send so why bother with serialization? Most data is not so simple. What if you want to send a whole book or an entire database? It could take forever! Also, serialization can implement encryption of your private data so that it is more secure and not easily seen by anyone else — handy for credit card information !

And that’s XML and Serialization simplified.

St. Louis Day Of .NET

This is late coming, but I wanted to make sure I comment on this year’s St. Louis Day of Dot Net . It was awesome! Microsoft “Lightswitch” was introduced. I caught up to HTML5 technology, as well as many others, and it was great.

The yearly event was started in 2008 by the St Louis .NET user group. Many props to this group and the generous sponsors. This year, 800 people attended the conference — ranging from developers, architects, quality assurance, managers, designers, DBAs and other technology positions.

It seems that most went away happy, satisfied, with a better understanding and encouragement to learn more about new technologies in .NET, databases, website development, architecture principles and software development in general.

Also, thanks to my company for letting me attend these types of events. They are short enough to attend but provide enough information that I get my motivation re-charged.