Jul 11, 2012

How To Install and Use ADB Tool



Android Debug Bridge (adb) is a useful utility that lets you communicate with Android device, emulator instance, and even Android Virtual Machine. Although adb offers many kinds of features for Android-powered devices like transferring files, installing apk applications, and remounting memory card. It is widely used to root Android smartphones.

There are 2 ways to install adb tool:
  1. Install adb tool in Android SDK
  2. Download adb tool only

  1. Install adb tool in Android SDK
    1. Download and install Android SDK
    2. Open SDK Manager and install Android SDK Platform-tools package
    3. After finished installing, navigate the directory where Android SDK is installed
      1. Press Shift key + right click on platform-tools folder and clickOpen command window here. Or,
      2. you can also use Windows Command Prompt (MS-DOS) navigate to platform-tools (On my computer, adb.exe is locate in C:\Program Files (x86)\Android\android-sdk\platform-tools)
      cd c:\Program Files (x86)\Android\android-sdk\platform-tools
  2. Download adb tool only
    1. Download adb tool here
    2. Extract adb-win.zip
    3. Press Shift key + right click on adb-win folder, then click Open command window here



Some ADB basic commands examples:
  1. To check Android devices which are connected with adb
  2. adb devices
  3. Show adb help message
  4. adb help
  5. Receive "keyable.txt" file from Android device to local PC
  6. adb pull /sdcard/keyable.txt keyable.txt
  7. Send "keyable.txt" file from local PC to Android device
  8. adb push keyable.txt /sdcard/keyable.txt
  9. Install "keyable.apk" application to Android device
  10. adb install keyable.apk
  11. To view Android device's system log
  12. adb logcat
  13. Stop the running adb server
  14. adb kill-server

Dual Boot Android-x86 and Ubuntu

Wanted to run Android 4.0 Ice Cream Sandwich on your laptop/netbook like the Asus Transformer Android Tablet? A brief description for my scenario before setting up dual-booting environment with Android-x86 and Ubuntu. I have Ubuntu 12.04 Precise Pangolin running on my computer and going to dual boot with Android-x86 4.0 RC1 Ice Cream Sandwich. Be sure to readthis if you want to dual boot Android-x86 and Microsoft Windows.

Things you will need:

Let's begin. Assuming you are running Ubuntu on your computer,
  1. Install UNetbootin from Ubuntu Software Center.
  2. Insert USB Pen Drive and run UNetbootin.
  3. Choose Diskimage radio button, then select the Android-x86 ISO. Click OK.
  4. After UNetbootin installed bootloader, click Reboot Now to restart computer.
  5. Enter into BIOS and change USB drive to first to boot USB Pen Drive when computer startup. Save the changes and it will restarts again.
  6. You arrived on the UNetbootin bootloader, choose Installation - Install Android-x86 to harddisk to install Android-x86.
  7. Choose the partition to install. You have to know your computer's harddisk partitions well. Example, sda1 = 1st partition, sda2 = 2nd partition, sda3 = 3rd partition, and so on.
  8. Select Do not format to keep existing data. Else, choose a filesystem to format. Android-x86 should works on ext2, ext3, fat32 and ntfs. Note that the filesystem must match the partition id.
  9. Choose Skip to skip boot loader GRUB installation. Otherwise, you will have to reinstall GRUB again with Live CD Ubuntu.
  10. Choose No, not to let /system be read-write. Choose Yes if it is necessary for you to debug.
  11. After Android-x86 installation is completed, it is optional to create a fake SD card. Having a fake SD card you are able to access apps which requires the existence of memory card like Gallery, Music Player, etc. 2046MB is the maximum size for fake SD card.
  12. Select Reboot to restart computer.
  13. Enter BIOS and change harddisk to boot first. Save and exit.
  14. Boot into Ubuntu and open 40_custom GRUB file by entering the command in terminal:
  15. gksu gedit /etc/grub.d/40_custom
  16. Add the following code at very bottom of the 40_custom GRUB file:
  17. menuentry "Android-x86 4.0 RC1" { set root='(hd0,3)' linux /android-4.0-RC1/kernel quiet root=/dev/ram0 androidboot.hardware=asus_laptop acpi_sleep=s3_bios,s3_mode SRC=/android-4.0-RC1 SDCARD=/data/sdcard.img initrd /android-4.0-RC1/initrd.img}
    Note for code above:
    • I installed Android x86 on sda3, so I use (hd0,3). For example, if you installed on sda5, change it to (hd0,5).
    • Change asus_laptop to which iso you download. For example, if you're using eeepc iso, change it to eeepc.
    • Remove SDCARD=/data/sdcard.img if didn't create fake SD card.
  18. Make it executable and update GRUB:
  19. sudo chmod +x /etc/grub.d/40_custom sudo update-grub
  20. Done. You should be able to dual boot Android-x86 and Ubuntu if you followed the steps above correctly. Note that you have to press and hold Shift key while your computer bootup in order to display GRUB menu. Otherwise, the menu won't shows up.

Run ARM Apps On Android x86 4.0.4 Ice Cream Sandwich



Android x86 early adopters had various compatibility issues running Android on x86 CPU in the past. Now Android on x86 has getting better development and support. Thanks to the developers who spent many hours to hack to make things work. Buildroid's mastermind Daniel Fages who builds "Buildroid for VirtualBox" successfully runs ARM apps on Android x86 platforms.

Due to the Android x86 platforms are incompatibility with NDK apps which are compiled only for ARM processors, we can found lots of popular Android apps like Angry Birds and Acrobat Reader aren't compatible with Android x86. On Android Market/Google Play, it states "Your device isn't compatible with this version" on certain apps, kind of a letdown. Now with Fages' hack, we can download the ARM apps from Google Play app and run them on Android x86.


Fages' hack was based on Intel's Medfield-powered Android smartphone. He looked into the Intel's "binary translation" function that contains "houdini" library and ARM libraries, which enables ARM apps running. Also a modified "Dalvik"'s "libdvm" library. He used the libhoudini, ARM libraries, and libdvm on Android-x86 2.3.7 Gingerbread and the ARM apps works. However, Android Ice Cream Sandwich is much more complex that he can't just simply replace the Ice Cream Sandwich's libdvm. With hours of efforts, Fages managed to make it work finally.

You can read the rest and download the Buildroid OVA on:
http://www.buildroid.org/blog/?p=175

Installation:
Simple as usual, import the Buildroid OVA file to VirtualBox and it is ready to fire up. (Please click here for installation details)

If you get VirtualBox error message while starting Buildroid like this below:

Failed to open a session for the virtual machine
buildroid_vbox86t_4.0.4_r1.1-20120601_gapps_houdini_1.

Nonexistent host networking interface, name 'vboxnet0'
(VERR_INTERNAL_ERROR).

Details
Result Code: E_FAIL (0x80004005)
Component: Console
Interface: IConsole {1968b7d3-e3bf-4ceb-99e0-cb7c913317bb}


To solve this, go to Settings > Network, change Attached to: NAT under Adapter 1tab. Buildroid should able to start. (It works for me)

Thoughts
Although not all ARM apps work correctly, it is a major step for Android x86 to supports huge number of Android applications. I ran Angry Birds Space on Android x86, it is very laggy. The game got slightly better on reduced screen resolution of 640 x 480 - 16 but still not on desired performance. I also installed Samsung Galaxy S3's S Voice on Android x86, the app runs without crashing but no mic supports. Please don't get frustrated if any apps don't work correctly because this is just a test version at this current stage. The whole operating system works without any problem on my computer so far.

Setup Hardware OpenGL for Linux Android x86 VirtualBox (also runs ARM apps)


As the post title, this Android x86 VirtualBox image runs ARM apps like Angry Birds games with OpenGL hardware acceleration. OpenGL is a standard specification cross-platform graphics API for 2D and 3D graphics processing hardware. The video below shows how the OpenGL performing with Angry Birds Space:


Click here to read the rest.

Here's how I setup Hardware OpenGL for Linux Android x86:
First of all, your computer must have graphics chipset with OpenGL hardware acceleration enabled. During this guide, I will setup this VirtualBox image on my HP mini 210 Ubuntu 12.04 Operating System. You'll need an Android x86 OVA file and buildroid_renderer package which can be download here.

  1. Install VirtualBox from Ubuntu Software Center.
  2. Open VirtualBox, click File > Import Appliance... to import the Android OVA. After import, don't start the Android Virtual Machine yet.
  3. If you already have libGL.so in /usr/lib/i386-linux-gnu/ directory, ignore this step. If you don't have it, please install libgl1-mesa-dev package (sudo apt-get install libgl1-mesa-dev) and you should have libGL.so in that directory.
  4. Extract the buildroid_renderer package. (tar -xvzf buildroid_renderer_XXXXXXXX.tgz)
  5. Open Terminal and navigate to buildroid_renderer package location and execute buildroid.sh (./buildroid.sh) and a blank window appear.
  6. Now start your Android Virtual Machine in VirtualBox. Wait for awhile the blank window will show up the Android 4.0.4 ICS user interface.


You can change the window size while executing buildroid.sh For example,./buildroid.sh -width 640 -height 480 the window size will open in 640 x 480 size.

Fix: iTunes Error 3194 When Restoring/Updating iOS

If you've been trying to update or restore your iPhone, iPad, or iPod touch, you might have encountered the iTunes error message saying that your iDevice could not be restored because an unknown error occurred (3194).

Getting error 3194 is most probably because you have been using TinyUmbrella, it has set your system's host file pointing to Cydia's SHSH caching server.

To fix iTunes error 3194, simply open TinyUmbrella, uncheck Set Hosts to Cydia on Exit in Advanced tab. Open iTunes and try upgrade again. The error message shouldn't appear anymore. 

iOS 5.1.1 Untethered Jailbreak With Absinthe 2.0.4


Absinthe 2.0.4 is easy to use but before you jailbreak, there is something you need to know.


Absinthe 2.0 supports:
iPhone 3Gs
iPhone 4
iPhone 4 CDMA
iPhone 4S
iPad 1
iPad 2 Wifi
iPad 2 GSM
iPad 2 CDMA
iPad 3 Wifi
iPad 3 CDMA
iPad 3 Global
iPod 3G
iPod 4G
Apple TV 2

Before jailbreak, make a backup in iTunes.
If you have passcode lock, disable it.
If you have a jailbroken iDevice and don't want to lose all your Cydia apps after jailbreak it, here is to backup them.

Steps:
  1. Download Absinthe 2.0
  2. Absinthe v2.0.4 (Win) Absinthe v2.0.4 (Mac) Absinthe v2.0.4 (Linux)
  3. Extract Absinthe 2.0 and connect your iDevice via data cable. No need to open iTunes.
  4. Open absinthe, once it discover your iDevice, the jailbreak button is available to click. Clicking it Absinthe will begin to jailbreak process.
  5. After it is done, you will see the Cydia app in your iDevice.


[Source]

Add "Open in Chrome" Bookmark in iOS Safari


Google Chrome for iOS platform is the most popular free iOS app since the release in last week. The sign shows Chrome is a welcome addition to iOS users. However, due to the Apple's restrictions to third-party iOS web browsers, the users can't change their default web browser in iOS. It could be the security reason but it seems the actions of Apple allowing third-party web browsers for download in App Store contradict their restrictions for changing the default web browser in iOS. The choice of web browser needs to be universally changeable, otherwise it never feels right to use third party web browser in iOS.

The default web browser in iOS can be changed by a free jailbreak tweak called Browser Changer. It also allows you to open the Home Screen Shortcuts with the browser of your choice. Browser Changer can be found in BigBoss repo. See the Browser Changer in action:


If you don't wish to jailbreak your iOS device, there is a workaround with the helps of javascript code by Jon Abrams which will launch the current page in Chrome by tapping the bookmark. Here's how to do it:

  1. Copy this code:
  2. javascript:location.href='googlechrome'+location.href.substring(4);
  3. Launch Safari and bookmark any webpage you like.
  4. Open Safari bookmarks, tap Edit button.
  5. Rename it to "Open in Chrome" or any name you want.
  6. Replace the URL by pasting the javascript code.

This bookmark will open the current page you are visiting in Safari with Chrome. Not the best solution but definitely come in handy on non-jailbroken devices. For your information, the Home Screen Shortcuts won't work because the URL can't be customized.

How To Run Android 4.0 In Virtualbox (Internet Connection Supported)

UPDATE: "Buildroid for VirtualBox" 20120530 update based on Android 4.0.4 has been released. (Link)


Those who have tried to run Android-x86 on Virtualbox before probably know its Internet connection is not playing well together with Virtualbox. Here's a good news, Daniel Fages is building Android operating system which support to run in Virtualbox named 'Buildroid for VirtualBox'. After trying it, this is the best Android virtual machine I have tried so far. Everything is working, including Internet.  


Before setting up Android in Virtualbox, things you need to prepare are:


Setup Buildroid in Virtualbox:
  1. Install and Open VirtualBox
  2. Click File, then Import Appliance...
  3. Click Choose... button and open the downloaded .ova Android VirtualBox image.
  4. Click Next button.
  5. Click Import button.
  6. Select Buildroid and click Start button.
  7. Done. Have fun with the Android operating system.


Note:
- Press right Ctrl to regain mouse control on computer.
- To unlock screen after being idle, press the ESC key and slide with mouse. Or, you can disable the screen lock (Settings > Developer options > enable Always stay awake).