endflow.net blog

/* programming and programming */

Android: Eclipse crashes when opening Resource Chooser dialog on Mac OS X

with 2 comments

/* .DS_Store file in “res” directory */

Yesterday, I wanted to see the list of internal icon resources of Android SDK, so I put a dummy ImageView widget to a screen in Graphical Layout and it opens the dialog named “Resource Chooser”. But it causes crash and freeze of Eclipse IDE suddenly. Why? When I previously used Resource Chooser dialog, it works perfect without any error.

In short: The cause is .DS_Store file in “res” directory (incl. all sub directories)

ADT plugin tries to read something from .DS_Store file in “res” directory (especially “drawable” directory) and causes crash. Okay, so I just remove it using Finder… WAIT! If you remove .DS_Store file using Finder, Finder will generate .DS_Store file again. Really scare infinite-loop.

Use Terminal. Remove them using “rm” command from Terminal application. While you’re using Resource Chooser dialog, don’t touch the Finder app which shows “res” directory or its children.

Written by kuy

October 2nd, 2011 at 1:30 pm

Posted in Uncategorized

Tagged with , ,

Android: Subclass of BroadcastReceiver must be declared as public

with one comment

/* BroadcastReceiver */

I wanted to send and receive my own broadcast intent, so I defined MyBroadcastReceiver class in MyAndroidActivity class which is the main activity class launched by Android. Since Java language doesn’t allow to define two or more public classes in same Java source file, I declared MyBroadcastReceiver class with no modifier (package-private). As a result, I got cryptic exception “IllegalAccessException”:

DalvikVM[localhost:8600]
	Thread [<1> main] (Suspended (exception RuntimeException))
		ActivityThread.handleReceiver(ActivityThread$ReceiverData) line: 1773
		ActivityThread.access$2400(ActivityThread, ActivityThread$ReceiverData) line: 117
		ActivityThread$H.handleMessage(Message) line: 981
		ActivityThread$H(Handler).dispatchMessage(Message) line: 99
		Looper.loop() line: 130
		ActivityThread.main(String[]) line: 3683
		Method.invokeNative(Object, Object[], Class, Class[], Class, int, boolean) line: not available [native method]
		Method.invoke(Object, Object...) line: 507
		ZygoteInit$MethodAndArgsCaller.run() line: 839
		ZygoteInit.main(String[]) line: 597
		NativeStart.main(String[]) line: not available [native method]
	Thread [<8> Binder Thread #2] (Running)
	Thread [<7> Binder Thread #1] (Running)

After a bit struggling, I found out the answer: subclass of BroadcastReceiver must be declared with public modifier

A subclass of BroadcastReceiver is called from Android system, so I had to define it with public modifier. This means you can’t define it in same Java source file. I tried to define it as public inner class of MyAndroidActivity but failed.

Thanks to this page: [StackOverflow] Android: java.lang.IllegalAccessException when attempting to use a custom “Application” class

Written by kuy

September 28th, 2011 at 11:02 am

Posted in Uncategorized

Tagged with , ,

Illustrator crashes on saving if Print Spooler service is disabled

with one comment

/* OMG… */

illustrator_crash

I have been bothering that Adobe Illustrator always crashes on both Windows XP and 7 when I save the file with AI (Adobe Illustrator) extension to the local disk. Finally, I dug up the way to resolve that annoying problem; just enable Print Spooler service! I can’t believe this… but it’s true. You can enable that service from: Control Panel -> Administrative Tools -> Services, then change “Startup Type” of Print Spooler service to “Automatic”. Of course, you should enable it manually right now!

Thanks for great tip: http://forums.majorgeeks.com/showthread.php?p=1346117

Written by kuy

April 26th, 2010 at 1:52 am

Posted in Uncategorized

Tagged with , ,

Make an issue ID a clickable link on TortoiseHg

with 6 comments

/* Integrate with Issue Tracker */

Unfortunately, TortoiseHg doesn’t have the feature that integrates with an external issue tracker now. That feature was filed long before, but Bitbucket supports the integration of a repository and an issue tracker, so most developers couldn’t have strong motivation.

To implement functionality of issue tracker integration is hard for us, so one developer introduced “Commit Message Parsing” feature to Repository Explorer for TortoiseHg 1.0, which makes issue IDs clickable URLs.

issueurl

Yeah, this feature is written in the manual, but most users didn’t know it since we didn’t provide friendly user interfaces for it. So I’d like to describe how to configure and use this in here.

Read the rest of this entry »

Written by kuy

March 28th, 2010 at 6:26 pm

Posted in Uncategorized

Tagged with ,

Checkout SVN repository using TortoiseHg

with 3 comments

/* Well done… */

I didn’t know Clone dialog of TortoiseHg 1.0 can be used to checkout Subversion repository without any hack. Did you know?

Anyway, this is a blog entry, not a tweet of Twitter, so I’ll put some explanation how to setup hgsubversion and TortoiseHg on Windows.

thg-hgsvn

Read the rest of this entry »

Written by kuy

March 21st, 2010 at 4:25 pm

Lazy-Loading mechanism of Django i18n

with 2 comments

/* Why? */

I’d like to introduce i18n (internationalization) framework to TortoiseHg website. So I looked around a template system for Python, then found Django’s template system and i18n framework. In the process, I got interested in Lazy-Loading of Django’s i18n framework.

I don’t know whether this entry helps someone, but anyway I try to explain it with a little sample code. Welcome any comment! I’m Django newbie :)

Read the rest of this entry »

Written by kuy

February 26th, 2010 at 10:25 pm

Posted in Uncategorized

Tagged with , ,

Detect 32/64-bit platform using JavaScript (Failed!)

with 2 comments

/* Why? */

I wanted to detect the platform which visitors use 32-bit or 64-bit using JavaScript on various browsers, for dynamically changing download URL of the new TortoiseHg 1.0 installers. Unfortunately, I couldn’t achieve that goal, but I’d like to put my result for future reference.

Read the rest of this entry »

Written by kuy

February 24th, 2010 at 11:21 pm

Posted in Uncategorized

Tagged with

Using MQ with TortoiseHg

without comments

/* MQ support: Newly introduced in 0.9 */

A while ago, TortoiseHg 0.9.2 was released and I’m focusing the development for 0.10. It’s too late, but I would like to explain about MQ support on TortoiseHg. We already supported a part of MQ features, but you know it’s not enough to use MQ for daily work. So I had to open command prompt.

MQ Panel

TotoiseHg Manual is well written documentation expected MQ features since I didn’t describe it… I hope you learn MQ support of TortoriseHg with this article.

Read the rest of this entry »

Written by kuy

January 5th, 2010 at 3:36 pm

Posted in Uncategorized

Tagged with , ,

Flickr Fav Set: #1 Create new FavSet

with 2 comments

/* Introduction */

This series is a tutorial for greasemonkey script Flickr Fav Set introduced in previous blog entry. In this tutorial, I’d like to explain about the overview of user interface, creating new FavSet and add your favorites to FavSet.

create new favset

If you didn’t installed the script yet or don’t know about Flickr Fav Set, please see this entry first.

Read the rest of this entry »

Written by kuy

February 22nd, 2009 at 8:33 pm

Posted in Uncategorized

Tagged with , , , ,

Flickr Fav Set: Manage your Favorites on Flickr

without comments

/* How does it work ? */

Using this greasemonkey script, you can manage your favorites with “FavSet” (likes “Set” or “Category”) on Flickr.

FavSet Selector

In Flickr, the user can put star mark “Favorite” on a photo taken by other peoples. However, it’s difficult to look for favorite one since we have a lot of favorite photos. So I created this.

Read the rest of this entry »

Written by kuy

February 21st, 2009 at 8:01 pm

Posted in Uncategorized

Tagged with , , ,