Friday, November 06, 2009

Android Testing: Instrumentation name

I was asked this question many times, so I think it should be present in a kind of FAQ in the future. Meanwhile...

Q: Where does the Instrumentation name come from ?
We here refer to the name that appears on the Instrumentation list in DevTools -> Instrumentation as showed in this screenshot.
By default we see android.test.InstrumentationTestRunner for all of our tests, so it would be very difficult to identify them


A: From the attributes of android.test.InstrumentationTestRunner in AndroidManifest.xml
That is, if the Label is not set in the manifest the default name is used. To set something meaningful for your tests set the label. In this case we shot Eclipse Android ADT manifest editor screen.

Wednesday, October 28, 2009

Upgrading to android SDK 2.0

This time the upgrade is much simpler than with previous versions. Upgrading is now supported from inside android tools itself.
Assuming you have already configured your installation to be able to install as root and run as unprivileged users as was described in previous posts, upgrading is a simple task, just run

$ sudo android


the select the desired components to install (i.e.: SDK Platform Android 2.0) and click Install Selected

Once you upgrade you still need to fix the permissions again, to do it run

$ wget -qO - http://android.codtech.com/android-tools/android-fixperms | sudo bash -s -- --sdk --sdk-dir=/opt/android

If you have installed android SDK to a different directory replace /opt/android in previous command by the correct location.

Hope this helps.

Tuesday, October 27, 2009

Japan Linux Symposium 2009 pictures





Photos from the Japan Linux Symposium. Some of them were taken at the VIP Reception at the MADO LOUNGE, which is located on the 52nd floor of Mori Tower in the Roppongi Hills. From 250 meters above sea-level, you can enjoy amazing views of Tokyo.

One of the photos taken by Keiko, who sent me the photo later, shows Klaas, Linus and me. There are other photos of Tokyo from the tower. They were taken with my Android HTC Hero, so you may understand they are not the best.
Finally, photos from the presentation that were kindly taken by Scott Trent.

Sunday, October 25, 2009

Android Tutorial at 1st Japan Linux Symposium

I would like to thank Linux Foundation for the invitation to present the Android Tutorial at the 1st Japan Linux Symposium.
A successful event indeed, and I was gladly surprised by all the interest in Android development attendees demonstrated.
Some requested me the presentation slides and I wrongly assumed they could be located at the official site. My fault. Anyway, you can find the presentation and other resources at http://android.codtech.com/jls2009 or if you prefer at slideshare.

This newest Linux Foundation event in Asia Pacific brought together developers, managers, executives, students and end users from Japan, Korea, China and many International countries.

I have had a great time in Tokyo and I hope to be here for 2010 too.

I would also thank Scott Trent, who took this and other great pictures of the event. You can find them at day 1, day 2 and day 3.

Friday, October 09, 2009

Android SDK: one step closer

Starting with the latest android 1.6 SDK release 1, Google is distributing the Linux version as a TGZ file instead of ZIP.
We mentioned the problem of distributing the Linux version as a ZIP file in previous posts, loosing ownerships and file permissions is a problem when you install the SDK or NDK in a multiuser environment.

Well, we are halfway there, still there's some permission problems that you can fix using android-fixperms that can be downloaded from this site.

Use it like this, for example to change the SDK installed at /opt/android-sdk-linux_x86-1.6_r1

$ android-fixperms --sdk --sdk-dir=/opt/android-sdk-linux_x86-1.6_r1

Hope this helps.

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.

Saturday, September 05, 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.