Wednesday, September 23, 2009

Android: android.process.acore has stopped

I've started to receive the infamous message: The process android.process.acore has stopped unexpectedly. Please try again. Is this the android counterpart of the blue screen of death ?


Lately I'm receiving this annoyingly often. Googling for it you can find some links giving some solutions I found unacceptable like hardware resetting the phone.

Notice: There could be many causes for this problem, so follow the steps presented here to determine if you are in this case.

Hence, I decided to take some action and find the reason. After some debugging this is what I've found:
09-23 16:32:13.798: DEBUG/Sync(110): skipping photo edit for unsynced contact
09-23 16:32:13.938: WARN/dalvikvm(110): threadid=37: thread exiting with uncaught exception (group=0x4000fe70)
09-23 16:32:13.938: ERROR/AndroidRuntime(110): Uncaught handler: thread SyncThread exiting due to uncaught exception
09-23 16:32:13.948: ERROR/AndroidRuntime(110): java.lang.NullPointerException
09-23 16:32:13.948: ERROR/AndroidRuntime(110): at com.android.providers.contacts.ContactsSyncAdapter.cursorToContactsElement(ContactsSyncAdapter.java:846)

Unfortunately the problem, a NullPointerException, is in ContactsSyncAdapter.java, a piece of Google maintained code AFAIK and we can only watch it happens and no much more than finding a workaround. Before introducing the workaround let's analyze one of the possible reasons for this problem.

Last message before the exception is

skipping photo edit for unsynced contact

so the problem might be an edition of a contact photo that can't be synced.

On possible workaround is to disable Auto-sync for Google data.
Try to synchronize Gmail, Calendar and Contacts and check if you receive the android.process.acore has stopped unexpectedly message.

Fortunately you can just disable Contacts synchronization. You should remember to synchronize manually your Contacts data until you find another solution, an upgrade is provided by Google, you can delete all of your Contacts and hope for the best or hard reset your phone.


Hope this helps.

Friday, September 04, 2009

Android: Sharing your mobile connection with your computer (tethe









This document can be read in Google Docs (http://docs.google.com/View?id=ddwc44gs_209f9dhxqd6), cut and paste link if you have problems accessing it.






This post shows how easy is to share your mobile network to your Ubuntu 9.04 computer (should work with other Linux distributions as well) using your HTC Hero.
Tethering with no rooting, no drivers to install (as with other OSs), no complex settings...
Too boring, it just works.

enable mobile network sharing in your phone

 
for this option to work USB cable must be connected






that's all

Your phone was detected as an USB network adapter and NetworkManager did all the dirty work for you.
Your computer is now connected to the mobile network !






Conclusion


If everything works just like that this blog would become very boring :-)



If you have comments, ideas, critiques or whatever just drop me a line or leave a comment in the blog.




Copyright © 2009 Diego Torres Milano. All rights reserved.



















































Tuesday, September 01, 2009

Fixing Android NDK permissions

Lately Linux is being treated more as a kind of Windows-like than a UNIX-like operating system it really is.
It seems that everybody has forgotten it is a multiuser operating system and most likely you don't want to install a single copy of every software just because some permissions are wrongly set mainly due to be distributed as a ZIP file which doesn't store this information.

Fixing Android SDK permissions was described in Ooops!..., they did it again. Here, we are fixing Android NDK permissions for your multi-user development environment.

Android NDK is a companion tool to the Android SDK that lets Android application developers build performance-critical portions of their apps in native code.

Other problem you may find during installation in Debian and Ubuntu is that Android NDK installation script invokes /bin/sh expecting to be bash. If you use bash syntax you should invoke it using /bin/bash. This problem will be fixed in next release.

Use this script to fix all of the problems, after unzipping as root:

#! /bin/bash


NDK_DIR=${NDK_DIR:-/opt/android-ndk-1.5_r1}

sudo chmod a+rx $NDK_DIR
sudo find $NDK_DIR/ -type d -exec chmod a+rx {} \;
sudo find $NDK_DIR/ ! -perm -044 -exec chmod g+r,o+r {} \;
sudo find $NDK_DIR/ -type d -name bin -exec chmod -R a+x {} \;
[ ! -d $NDK_DIR/out/apps ] && sudo mkdir $NDK_DIR/out/apps
sudo chmod a+rwx $NDK_DIR/out/apps
( cd $NDK_DIR && sudo bash build/host-setup.sh )


Hope this helps.