Installing APK files through ADB

I was having trouble getting adb to recognize my phone.  I found this post that helped.  Here is what I did.

First, I used this command to determine, which device was my phone:

lsusb | grep "High Tech Computer Corp"

The output looked like this:

Bus 002 Device 008: ID 0bb4:0c01 High Tech Computer Corp.

When I look at the device node, I can see that permissions might be an issue.  If you notice from the above statement, the Bus is 002 and the Device is 008 so those are the numbers I will use in looking at the device.  Here is the command:

ls -l /dev/bus/usb/002/008

Here is the output

crw-rw-r-- 1 root vboxusers 189, 135 2010-06-16 09:54 /dev/bus/usb/002/008

Next, the post did not say where to place the rules file to correct this.  I found another article with a little more information on udev rules.

So, I opened the file with this command:

sudo gedit /etc/udev/rules.d/70-android.rules

And, I placed this in the file:

BUS=="usb", SYSFS{idVendor}=="0bb4", GROUP="android", MODE="0660" /* HTC */

Next add the group with this command:

sudo groupadd android

Next add the user (my username is skp) to the group with this command:

sudo usermod -a -G android skp

Then, it was time to test.  I restarted the udev service with this command:

sudo restart udev

Here is the output of the service:

udev start/running, process 23528

Now, I don’t see the phone, but I had VMWare running, so that may have grabbed the device instead.  I don’t know what happened and I had to come back to this later.  Then, after a reboot, my security settings looked better:

crw-rw---- 1 root android 189, 133 2010-06-16 21:25 /dev/bus/usb/002/006

Still, it didn’t work.  The command:

./adb devices

gives this output:

* daemon not running. starting it now *
* daemon started successfully *
List of devices attached
Then, I realized that there is security on the phone. (I felt kind of silly)  I had to turn on the USB debugging option.  In the settings, I enabled Settings > Application settings > Development > USB debugging.
Then, the adb output looks like this:
List of devices attached
HT849GZ65323	device

Now that I have access to the phone, I used this command:

./adb install ~/app/<my program file>.apk

The output looked like this (I had already installed the application from the SDCard, so it makes sense):

383 KB/s (28018 bytes in 0.071s)
	pkg: /data/local/tmp/nehemiahG1.apk
Failure [INSTALL_FAILED_ALREADY_EXISTS]

This command did the reinstall:

./adb install -r ~/app/nehemiahG1.apk

Here is the output

224 KB/s (28018 bytes in 0.121s)
	pkg: /data/local/tmp/nehemiahG1.apk
Success

Success!

Installing My First APK from the SDCard

I finally finished my first Android application to the point that I wanted to try to start using it on my phone.

This post explains how to install applications, but I had some problems:

Bright Hub: How to install APK files on your Google Android Phone

First, with installing from the SD Card, it doesn’t say exactly what application to use.  From the Market, I installed “AppsInstaller” developed by ModMyMobile.com.  When I opened the program, it scanned my card, and found my application that I had uploaded via the USB cable.  But, it said that the applications were blocked and offered to take me to settings.  I check the “Unknown sources” option which is described  as “Allow install of non-Market applications”.  Then, it worked!

Also, I tried to install with adb, but I couldn’t get that to work.  When I ran “./adb devices”, I don’t see any devices listed.  This “G1 usb drivers for linux” post looks promising, but I haven’t finished going through all of the steps.  I will try to post back when I do.

Android Patterns

I came across this post with Android patterns taken from the Twitter App:

Android Developer’s Blog: Twitter for Android: A closer look at Android’s evolving UI patterns

I finally found a post that pointed me to the source code for a pattern application (I don’t think it is the Twitter application like I first thought): IOSched.

While I was at it, I thought I would search for some more patterns that I would come in handy for Android development:

In addition, here are some other links that aren’t really patterns, but I found they were help links with examples for what I was trying to do:

If you have any other helpful links that you like, please comment.

Lirc Remote Revisited

Back in May, I had posted an issue with lirc, Mythbuntu, and my MceUsb2 Remote.  The final solution ended up being just waiting some time, running the update manager to update the machine, and trying again.

If you didn’t see the comments, Orlovsky did post a helpful link to a bug.  My attempt was going to be to try to remove the old kernels and see if that would fix it.  But, like I said, some update fixed it in the meantime — I am grateful to the community.

To be complete, my remote is AVS Gear GP-IR02BK Vista 2 channel IR Remote Control.  It seems to work pretty well with Mythbuntu.  MythTV.org has a good resource for configuring the remote.

Linux at Google

In catching up on my RSS feeds, I found a flurry of articles about Google switching away from Windows because of the Chinese hack.  This sounds exciting to me because it probably means that the Linux community will grow.

The articles say that Google employs more than 10,000 people.  They have a choice of going to Apple, but surely a decent number of them will choose Linux.  The other encouraging thing is that many of them are probably programmers.  So, I would hope that this would mean more contributions to the desktop features of Linux.

Articles:

Possibly related?

Updated MonoDevelop Repository

I have been trying to work with MonoDevelop and GnomeRDP.  I couldn’t get it to open the project because I needed the newer version of Monodevelop as described here.  I figured out how to install MonoDevelop manually.  The problem with all of this is that you have to get all of the dependencies yourself.

So, instead I finally found a repository with Monodevelop 2.2 in it:

How to install MonoDevelop 2.2 on Ubuntu 9.10?

Errors Opening Gnome-RDP Project

I ran into an error opening the Experimental branch of Gnome-RDP, and I wanted to post it in case anyone else ran into the same problem.  Here is what the error looked like:

screenshot_143

Here is the text:

Could not load solution: <solution path>.  Could not set property ‘Policies’ in type ‘Solution’.

Load operation failed. Could not set property ‘Polieis’ in type ‘Solution’

Error while trying to load the project ‘<project path>’: Could not set property ‘Policies’ in type ‘DotNetProject’

Error while trying to load the project ‘<project path>’: Could not set property ‘Policies’ in type ‘DotNetProject’

The solution apparently, as found in this bug post, is to install a new version of Mono-Develop.  I see now that the post has a repository that you can use.  I ran across these instructions, and I detailed my execution of those instructions on my previous posts.