Showing posts with label android. Show all posts
Showing posts with label android. Show all posts

Friday, June 10, 2011

HTC Incredible S, Android, Linux, and udev(7)

So it all started because I wanted to take screen captures of my HTC Incredible S (I will not explain how to do that here as you'll find plenty of good tutorials on the interwebs).

One of the steps involved the Dalvik Debug Monitor Server (DDMS) which provides all kind of things you could expect from a debugging tool, including a screen capture feature.Unfortunately, I quickly noticed that it wasn't really working as expected with my new HTC Incredible S device on my Linux laptop (running RHEL):

$ pwd
/full/path/to/android-sdk-linux_x86/tools
$ ./ddms

(ddms:15838): Gtk-WARNING **: gtk_widget_size_allocate(): attempt to allocate widget with width -5 and height 16

(ddms:15838): Gtk-WARNING **: gtk_widget_size_allocate(): attempt to allocate widget with width -5 and height 16
09:01:27 E/DDMS: insufficient permissions for device
com.android.ddmlib.AdbCommandRejectedException: insufficient permissions for device
    at com.android.ddmlib.AdbHelper.setDevice(AdbHelper.java:736)
    at com.android.ddmlib.AdbHelper.executeRemoteCommand(AdbHelper.java:373)
    at com.android.ddmlib.Device.executeShellCommand(Device.java:276)
    at com.android.ddmuilib.SysinfoPanel.loadFromDevice(SysinfoPanel.java:159)
    at com.android.ddmuilib.SysinfoPanel.deviceSelected(SysinfoPanel.java:126)
    at com.android.ddmuilib.SelectionDependentPanel.deviceSelected(SelectionDependentPanel.java:52)
    at com.android.ddms.UIThread.selectionChanged(UIThread.java:1684)
    at com.android.ddmuilib.DevicePanel.notifyListeners(DevicePanel.java:752)
    at com.android.ddmuilib.DevicePanel.notifyListeners(DevicePanel.java:740)
    at com.android.ddmuilib.DevicePanel.access$1100(DevicePanel.java:56)
    at com.android.ddmuilib.DevicePanel$1.widgetSelected(DevicePanel.java:357)
    at org.eclipse.swt.widgets.TypedListener.handleEvent(Unknown Source)
    at org.eclipse.swt.widgets.EventTable.sendEvent(Unknown Source)
    at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Unknown Source)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Unknown Source)
    at com.android.ddms.UIThread.runUI(UIThread.java:492)
    at com.android.ddms.Main.main(Main.java:103)

09:01:32 W/ddms: Unable to get frame buffer: insufficient permissions for device

Not what I expected, but nothing that cannot be fixed. So after googling/fiddling/ranting a bit, udev(7) came to the rescue. Pretty much, it seems I needed another rule to be added. So here's how I did it:

Look at the information that pertain to my HTC Incredible S:

$ lsusb
Bus 002 Device 006: ID 1267:0210 Logic3 / SpectraVideo plc
Bus 002 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 009: ID 0bb4:0cac High Tech Computer Corp.
Bus 001 Device 005: ID 0a5c:217f Broadcom Corp. Bluetooth Controller
Bus 001 Device 003: ID 17ef:480f Lenovo Integrated Webcam [R5U877]
Bus 001 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub




Create a specific android.rules file in custom rules directory /etc/udev (Note that it is one single line in the .rules file below)

$ id
uid=500(xsa) gid=500(xsa) groups=500(xsa),496(desktop_admin_r)

$ sudo -s

# cat > /etc/udev/android.rules
SUBSYSTEMS=="usb", ATTRS{idVendor} =="0bb4", ATTRS{idProduct} =="0cac", MODE="0660", OWNER="root", GROUP="desktop_admin_r"
^D
# ln -s ../android.rules /etc/udev/rules.d/90-android.rules

Reload the udev(7) rules and then launch again DDMS and you should be all set.

# /etc/init.d/udev-post reload
[...]
# exit
$ cd /full/path/to/android-sdk-linux_x86/tools
$ ./ddms

Saturday, January 8, 2011

Sync Birthdays Between Your Google Account and Your Android Native Calendar App

While the sync between my HTC Magic (running Android Eclair - 2.1) and my Google Mail account works as expected, by default I was missing my contacts' birthdays information. To fix this somewhat-lack-of-default-support annoyance, I had to:
  1. Go to my Google Calendar Settings
  2. Browse interesting calendars
  3. Select the More tab
  4. Subscribe to Contacts' birthdays and events
  5. Sync mobile handheld with Google Mail account
Although this does what I wanted, I'm still looking to enable automatic reminders for birthdays. If anyone's got any tips to easily enable that in the native calendar app, shoot me an e-mail. Thanks.

Wednesday, October 6, 2010

Can't Update Google Maps on Android Rooted Phone

Bummer. Every time I tried to update Google Maps via the Market it wouldn't install it. Throwing out an error about package signature or what not. It appears that it just does not work to update an Android stock app on a rooted phone. What then? You will first have to delete/uninstall the Google Maps packages, then just simply go back to the Market, search for the package, and install it. Bam; done.

Below are the commands to use from your ADB shell to remove the package.

adb root
adb remount
adb shell rm /system/app/Maps.apk
adb uninstall com.google.android.apps.maps