September 22, 2017

Android SDK not recognizing debug-able HTC one V device

My HTC one V was not detecting in the Ubuntu 12.04  while connected through USB cable for application development and debugging.

1) First connect the mobile(HTC one V ) to the USB of the PC
2) Check using command lsusb , below one print will come
Bus 002 Device 011: ID 0bb4:0ce5 High Tech Computer Corp. 
3) Add the below lines to the end of the file/etc/udev/rules.d/51-android.rules

## Rule for an HTC One V Android Phone

SUBSYSTEMS==”usb”, ATTRS{idVendor}==”0bb4″, ATTRS{idProduct}==”0ce5″, MODE=”0666″

SUBSYSTEMS==”usb”, SYSFS{product}==”Android Phone”, MODE=”0666″

4) After this reinsert the device , you should be able to see the below print while typing adb devices

$ root@dino-Satellite-C665:~# adb devices
List of devices attached
SH258TV06083 device

 

Happy Application Development and Debugging :) :) :)

Android Compilation in Ubuntu 12.04 LTS (precise) for pandaboard

 

Below are the steps followed for compiling the android in Ubuntu 12.04 for pandaboard. I had compiled by referencing the following links

http://source.android.com/source/index.html

http://blog.markloiseau.com/2012/07/how-to-compile-android-on-ubuntu-12-04/

 

Making ready the Ubuntu 12.04 for compiling Android

1) Installing JDK

Since Sun JDK is no longer in Ubuntu’s main package repository, we have to manually install it in ubuntu 12.04 from oracle website

Please go the below link and download the JDK

http://www.oracle.com/technetwork/java/javase/downloads/jdk6-downloads-1637591.html

Follow the below steps to install the java and configuring it for the usage

$ chmod +x jdk-6u33-linux-x64.bin

$ sudo ./jdk-6u33-linux-x64.bin
$ sudo mv jdk1.6.0_33 /usr/lib/jvm/
$ sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.6.0_33/bin/java 1
$ sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk1.6.0_33/bin/javac 1
$ sudo update-alternatives --install /usr/bin/javaws javaws /usr/lib/jvm/jdk1.6.0_33/bin/javaws 1
$ sudo update-alternatives --config java
$ sudo update-alternatives --config javac
$ sudo update-alternatives --config javaws

To verify the isntallation is proper do the belwo steps. It should now show that the Sun JDK is running instead of IcedTea

$ java -version
java version "1.6.0_33"
Java(TM) SE Runtime Environment (build 1.6.0_33-b04)
Java HotSpot(TM) 64-Bit Server VM (build 20.8-b03, mixed mode)

 2) Installing the required packages for Ubuntu 12.04

$ sudo apt-get install git-core gnupg flex bison gperf build-essential \ 
zip curl libc6-dev libncurses5-dev:i386 x11proto-core-dev \ 
libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-glx:i386 \ 
libgl1-mesa-dev g++-multilib mingw32 openjdk-6-jdk tofrodos \ 
python-markdown libxml2-utils xsltproc zlib1g-dev:i386
 $ sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so

3) Configuring USB Access

 

Under GNU/linux systems (and specifically under Ubuntu systems), regular users can’t directly access USB devices by default. The system needs to be configured to allow such access.

If you do not do this, when u insert the pandaboard it wont be detected and you wont be able to do any file trasnfer for u-boot and other system files

The recommended approach is to create a file /etc/udev/rules.d/51-android.rules (as the root user) and to copy the following lines in it. <username> must be replaced by the actual username of the user who is authorized to access the phones over USB.
# adb protocol on panda (PandaBoard)
SUBSYSTEM==”usb”, ATTR{idVendor}==”0451″, ATTR{idProduct}==”d101″, MODE=”0600″, OWNER=”<username>”
# fastboot protocol on panda (PandaBoard)
SUBSYSTEM==”usb”, ATTR{idVendor}==”0451″, ATTR{idProduct}==”d022″, MODE=”0600″, OWNER=”<username>”
# usbboot protocol on panda (PandaBoard)
SUBSYSTEM==”usb”, ATTR{idVendor}==”0451″, ATTR{idProduct}==”d00f”, MODE=”0600″, OWNER=”<username>”
# usbboot protocol on panda (PandaBoard ES)
SUBSYSTEM==”usb”, ATTR{idVendor}==”0451″, ATTR{idProduct}==”d010″, MODE=”0600″, OWNER=”<username>”
# adb protocol on grouper (Nexus 7)
SUBSYSTEM==”usb”, ATTR{idVendor}==”18d1″, ATTR{idProduct}==”4e42″, MODE=”0600″, OWNER=”<username>”
# fastboot protocol on grouper (Nexus 7)
SUBSYSTEM==”usb”, ATTR{idVendor}==”18d1″, ATTR{idProduct}==”4e40″, MODE=”0600″, OWNER=”<username>”

 If the username is dino, the line should look like

SUBSYSTEM==”usb”, ATTR{idVendor}==”18d1″, ATTR{idProduct}==”4e40″, MODE=”0600″, OWNER=”dino”

Downloading the Source Tree

4) Create a bin/ directory in your home directory

$ mkdir ~/bin
$ PATH=~/bin:$PATH

5) Download the Repo script and make it executable

$ curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
$ chmod a+x ~/bin/repo

6) Downloading the master branch for pandaboard

pandaboard is supported in master branch of the android. So now we will now download the android master branch

First we will create a directory for he android source

$mkdir android_master
$cd android_master

now we will initialize the repo to bring the latest version of the repo

$ repo init -u https://android.googlesource.com/platform/manifest

When prompted, please configure Repo with your real name and email address. To use the Gerrit code-review tool, you will need an email address that is connected with a registered Google account. Make sure this is a live address at which you can receive messages. The name that you provide here will show up in attributions for your code submissions.


Now we will pull down the source code from the repository which we initialized

$repo sync

Now the download of the source code will start, this will take some hours to download the whole files . Make sure you have good internet speed :)

……..

 

Compiling the Android

 7) Initialize the enviornment

$ source build/envsetup.sh

8) Choose the Target as panda

$ lunch full_panda-userdebug

 

9) Installing binary driver for pandaboard

We need to now download the graphics driver for pandaboard, click the below link

https://developers.google.com/android/nexus/drivers#panda and download the binary corresponding to the android version . I used 4.0.4

$ tar xvzf imgtec-panda-imm76i-67545da7.tgz

the above will untar the driver

10) now we are all ready to start the compilation. type make and go for some snacks and tea

$ make -j4

It took 2 hours in my Toshiba C665 laptop, the configuration is Core i3(i3-2330M CPU@ 2.20GHz), 6GB RAM

Build everything with make. GNU make can handle parallel tasks with a -jN argument, and it's common to use a number of tasks N that's between 1 and 2 times the number of hardware threads on the computer being used for the build. E.g. on a dual-E5520 machine (2 CPUs, 4 cores per CPU, 2 threads per core), the fastest builds are made with commands between make -j16 and make -j32.

 11) Writing to the pandaboard the Android Bootloader image

# Initial setup,

# With no SD card inserted, plug USB first, then the power cord,
# and load fastboot over USB:
device/ti/panda/usbboot device/ti/panda/bootloader.bin

# Initial setup,
# Once in fastboot, insert and initialize an SD card (4GB or greater):
fastboot oem format
fastboot flash xloader device/ti/panda/xloader.bin
fastboot flash bootloader device/ti/panda/bootloader.bin

# Build and flash, part 1: Do a build
source build/envsetup.sh
lunch full_panda-userdebug
make

# Build and flash, part 2: Flash
# Reboot into the SD card’s fastboot (hold GPIO_121 and press PWRON_RESET)
# and flash the system:
fastboot erase cache
fastboot flash userdata
fastboot flashall

# Post-boot setup, part 1: Set the date on the board:
adb shell date $(date +%s)

# Post-boot setup, part 2: (optional) Configure Ethernet
adb shell dhcpcd eth0

 

 

 

Unlocking HTC One V bootloader

Read this before doing !!!

  • Read and understand the whole instruction
  • The instructions in this guide are intended for use with the HTC One V. Applying these instructions on another device or model may produce undesired outcomes.
  • Use these instructions at your own risk. Understand the instruction first before actually executing

Things to do before starting

  • Download HTC Sync to your computer. You will be needing this to install the USB drivers for HTC One V on the computer.
  • Download the Fastboot package here (Fastboot.zip, 404.46 kB).
  • WinRAR or 7-Zip installed on your computer.
  • Charge your phone’s battery to 70% or more.
  • Backup all personal data on your phone to make sure you have a copy of your personal data (e.g., contacts, SMS, MMS, Internet settings, Wi-Fi passwords, and the like) in case the procedure in this guide erases such data.

Instructions

  1. Download HTC Sync from the link above and install it on your computer. This will be needed to install the USB drivers for HTC One V.
  2. Download the Fastboot package from the link provided above.
  3. Extract Fastboot.zip to a folder on your computer.
  4. Go to HTC Development page and make an account. Use your account to log into the site.
  5. Go to HTC’s Unlock Bootloader page.
  6. Go to the list of supported devices and select All Other Supported Models.
  7. Click Begin Unlock Bootloader and select Yes when a warning message appears. On the next page, you will see on-screen instructions on how to unlock your HTC One V’s bootloader. You can use this as your guide.
  8. Switch off your HTC One V.
  9. Press the Volume Down key and Power button simultaneously to reboot your phone into Bootloader Mode.
    • NOTE: Once in Bootloader Mode, you will be using the Volume keys to navigate and the Power button to select an option.
  10. Select Fastboot from the Bootloader menu.
  11. Using your USB cable, connect your HTC One V to the computer.
  12. Open a command prompt window on the computer. Navigate it to where the Fastboot program is located.
    • NOTE: For Windows 7 users, you can easily navigate a command prompt from a specific folder. Open the desired folder. Press the Shift and right mouse button in any vacant portion in the folder. A menu will appear. Select Open Command Window here and a command prompt will appear with the location of the selected folder.
  13. To make sure that your HTC One V has successfully connected to the computer, type the command fastboot devices. Your phone’s serial number will be displayed on the screen.
  14. Type the command fastboot oem get_identifier_token. The command prompt will display your HTC One V’s Token ID.
  15. Copy the Token ID. When copying the Token ID, start from the line <<<< Identifier Token Start >>>> and end at the line <<<<< Identifier Token End >>>>>.
    • NOTE: To copy the Token ID from the command prompt window, right-click on the command prompt window. A menu will appear. Select Mark and highlight the Token ID. After highlighting your Token ID, click the right mouse button to copy it.
  16. Go back to HTC Development page and submit your Token ID. You will receive a file Unlock.code.bin via your email. Further instructions will also be attached to the email. You may use this as your guide.
  17. Download the Unlock.code.bin and paste it into the Fastboot package folder.
  18. Go back to the command prompt window and type the command  fastboot flash unlocktoken Unlock_code.bin then hit the Enter key.
  19. Your HTC One V will receive an Unlock Bootloader request. Use the Volume keys to select Yes and tap the Power button to confirm your action.
  20. Your HTC One V will automatically reboot and perform a factory reset.
  21. To confirm that your phone’s bootloader has been unlocked, reboot your phone into Bootloader Mode. The word UNLOCKED will be displayed on top of the menu.

That’s all,  you are done.  Now enjoy your mobile with unlocked bootloader and do what ever you want.