Froyo

Several readers have recently reported that they’ve managed to run out of free space, even with the Froyo implementation of Apps2SD.  The way Google implemented it was poor to start with, but what makes it worse is that many apps in the Market still haven’t been updated to allow installation to SD card.

This guide shows you how to force all applications to be installed to your SD card.

Requirements

  1. Phone running Froyo
  2. ADB installed – how to

Instructions

  1. Ensure you have debugging enabled on your phone (Settings > Applications > Development > USB Debugging > Turn On)
  2. Connect your phone to USB
  3. Open Command Prompt/Terminal
  4. Type: adb shell pm setInstallLocation 2
  5. Press Enter
  6. That’s it!

FAQs

  1. My widgets keep disappearing, help!
    To prevent widgets from being removed, you’ll have to move their associated application back onto phone memory – to do this see FAQ #2
  2. How do I move certain apps back onto phone memory?
    You can move any application onto phone memory by going to Settings > Applications > Manage Applications > On SD card, select the app you want and press Move to Phone
  3. How can I revert to the original settings?
    Just open Command Prompt/Terminal and type: adb shell pm setInstallLocation 0
  4. Any other hidden commands?
    There’s one more to force all apps to install to phone memory, but I doubt you’ll ever want to use it: adb shell pm setInstallLocation

[via Androinica]

Today I received my 16GB MicroSD to replace my now full 8GB.  Normally to transfer contents it’s quite straightforward – just copy everything to computer then back onto the SD card (or from SD to SD if you’ve got a card reader).  However, if you’ve got a rooted phone running apps2sd (also known as Apps2Ext) then there’s slightly more work involved to make sure that you end up transferring all your apps too.  The method below describes how I managed it, and under that I’ve listed a few alternatives…

Requirements

  1. Rooted phone
  2. SD card with ext partition
  3. ADB installed – how to

Instructions

  1. Make sure you’ve still got your old SD card in
  2. Create a new folder on your computer called SD Card Backup
  3. Create 2 subfolders, one called FAT and another called EXT
  4. Connect your phone to computer and set to Disk Drive mode
  5. Copy all your SD card contents (FAT partition) into the FAT folder
  6. Open Command Prompt/Terminal on your computer
  7. Type: cd<space>
    Make sure you use a space character, don’t type <space> and don’t press Enter yet!
  8. Drag and Drop the EXT folder into your command window, and you’ll notice that the full path to your EXT directory appears
  9. Press Enter
  10. Set your phone USB connection to Charge Only
  11. Type: adb pull /sd-ext/app .
    Don’t forget that “.“!
    Press Enter
  12. Wait while all your apps are copied into your EXT folder
  13. Once copied, insert your new SD card and use the same method you previously used to partition your new SD card as you want
    I use the Amon RA recovery, flashed using Unrevoked.  My partitions are: 4GB ext, 32MB swap (not really needed) and the rest as FAT
  14. Connect your phone via USB again
  15. In the command window, type: adb push . /sd-ext/app/
  16. Wait whilst all your apps are copied back to your ext partition
  17. Copy all your FAT files back onto the FAT partition

Alternate Methods

  1. Use Linux.  Mounting your SD card in Linux will mount your ext partition too.  It’s then a simple case of just copy and pasting your files from old SD to computer, then computer to new SD
  2. Titanium Backup.  You can use Titanium Backup’s Batch feature to backup all the apps to the phones Fat partition, then copy the backups to new SD and do a batch restore
  3. MyBackupPro – similar to Titanium Backup, MyBackupPro allows you to backup all apps and their data, then restore them.

Why My Method?

I chose doing it the adb way because it doesn’t involve copying everything onto the SD card first – otherwise you’re waiting for everything to be backed up to SD, then to computer, then back to SD and then restoring using Titanium/MyBackupPro.  It’s also good to have a copy of your apps saved on your computer just in case something goes wrong with your phone or SD card.  If you already have adb installed, then it’s really quick to just run the adb command and grab all your apps.

Background

Yesterday I was trying to install the adb drivers on my work computer, which runs Windows XP.  Naturally, I tried the steps I posted up in a previous article but when it tried finding the drivers I got an error saying “Cannot install this hardware” because it could not find the necessary software.  I correctly assumed that the problem was with the drivers themselves (which worked on my home XP install), and a quick search led me to a topic on XDA-Developers where one of the users has uploaded working ADB Drivers for HTC phones.

Download

You can download the drivers from here.  Use the instructions in this guide to install them (skip steps 8-12)

Credits

sh500 on XDA-Developers.  That’s the post which contained the working drivers.

This guide was initially part of the How to Take Screenshots tutorial but has been separated out because it’s going to be referenced in a few upcoming tutorials.

Instructions – Mac users can skip to step 5

  1. Go to the Java Runtime Environment (or the JDK if you intend to develop your own apps) page
  2. Select your Operating System, agree to terms and click Continue
  3. Download the file shown below (the version number may differ, this is the latest at time of writing this article)
    JRE Download
  4. When the download completes run the file to install it
  5. Get the Android SDK – free download available from here.  Downloads are at the top of the page, just choose your relevant operating system – no need to follow the instructions on that page!
  6. When the download has completed extract the file:
    • Windows – Right Click -> Extract All -> Follow the onscreen prompt.
    • Mac – Double click the file
  7. Open the extract android-sdk-rXX-<os> folder, the android-sdk-<os> subfolder within it (if it’s there).  You should see something like this:
    Android SDK Files
  8. Windows: install the latest Android phone drivers using the instructions here
  9. That’s it.  You’ve now got the Android SDK setup on your computer.

Here’s a clearer guide on how exactly to setup the ADB drivers on Windows, with screenshots for each step.

  1. Follow the installation section of this post.  Ignore step 8 (“Windows: install the latest Android phone drivers using the instructions”)
  2. Browse to the android-sdk-windows folder:
    Windows SDK Folder
  3. Run SDK Setup:
    SDK Setup
  4. Close the Refresh Sources box (pictured above) if it opens.
  5. Close the Choose Packages to Install box if that’s open too.
  6. Click the Settings option on the right
  7. Under Misc, check the box which says: “Force https://… sources to be fetched using http://…”
  8. Go on Available Packages and click the + (plus) sign next to the long URL (http://dl-ssl.google.com/android…) to expand it
    Available Packages
  9. Select Usb Driver package and press Install Selected
  10. Select Accept under the terms and then press Install
    Install USB Driver Package
  11. When the installation is completed, close the Installing Archives window
  12. IMPORTANT: In your SDK folder you’ll now have a new folder called usb_driver.  This is the location to search in the rest of the tutorial when you’re required to locate the driver
    USB Driver Folder
  13. Make sure you have Device Debugging enabled on your phone by going to Settings > Applications > Development > USB Debugging and ticking the checkbox.
  14. Connect your phone via the USB cable.  You’ll notice the Debugging icon in the notification bar, and opening the notification bar will show “USB debugging connected”
    Debugging Notification
  15. If you’re on Windows XP, follow the steps described in the Perform A Fresh Installation section here
    If you’re on Windows Vista or Windows 7, follow the steps described in the Perform A Fresh Installation section here
    REMEMBER: Where it says “Click “Browse…” and locate the folder where you copied the installation package.” it’s the directory in Step 12 above
  16. The drivers should now be fully installed.

Installing the drivers lets you connect your phone in debug mode.  This allows you to take advantage of the SDK tools, such as ddms which lets you take screenshots.  It also lets you easily install applications from your computer, browse files on your phone and if you start developing Android applications you can quickly test them out on your phone.

UPDATE: If the drivers don’t work for you then try using these drivers instead

There’s no easy way to take screenshots with an Android phone.  This is due to security issues that could arise if applications were capable of taking screenshots.  For example, imagine an app that would run in the background, take a screenshot every 2 minutes and upload the image to a remote server.  For now, two methods exist but neither are as straightforward as we’d like them to be:

1) Use a rooted phone. Rooting your phone gives you full access to your phone system and therefore it’s possible to access the screenshot functionality.  If you’ve rooted your phone just download ShootMe from the Market and all you need to do is shake the phone to capture a screenshot.

2) Using the Android SDK and a USB cable.

This method involves a few steps but once you’ve completed the setup, taking future screenshots is very easy.

Installation

  1. Install the Android SDK using the instructions provided here
  2. On your HTC Desire go on Settings > Applications > Development.  Check the USB debugging option

Taking Screenshots

  1. Browse to your SDK locations and open the tools folder
  2. Make sure your phone is connected via USB, and run the ddms tool.  You should see something like this:
  3. Make sure you select your device from the box on the right, then go on Device > Screen Capture
  4. The new window will grab your current phone screenshot and display it:
    DDMS Grab
  5. You can use the Refresh, Rotate, Save and Copy options to take the respective action with your screenshot.

Every time you want to take a new screenshot, just follow the 3 steps in the Taking Screenshots section.