Profile cover photo
Profile photo
Hiroshi Sakurai
71 followers
71 followers
About
Hiroshi's posts

Post has attachment
Golangのchannelとselectの機能を提供するJavaのライブラリ。
https://github.com/anolivetree/goncurrent

Channelとselectの機能がどうしても欲しかったので作りました。
まだjarすら置いていないので、そのうち置きます。

Channelの機能だけなら簡単なのですが、selectを実現するのは苦労しました…。

Androidの作るJPEG画像がiOSの作るものに比べて品質が悪いという記事、きっと盛大に間違っていると思う。
http://qiita.com/KeithYokoma/items/c7f32a77402410545edb

huffman符号化は可逆なので、huffman tableを調整したとしてもhuffman符号化による画質の差はないはず。

おそらく、optimize_coding以外にも量子化のパラメータなども一緒に変えていたのだと予想。

Implementing ContentProvider is a pain in the ass especially when SQL's JOIN is used in the ContentProvider. It's much easy to access SQLite database directly.

It's not difficult to create a Loader to access SQLite database in place of CursorLoader.  

Post has attachment

Post has attachment
長年悩んでいたActivityのrecreationの対処方法に関して、ようやく自分なりに納得できる解が見つかった。

Post has attachment

Android 5.0(Lollipop)では現状Go(golang.org/x/mobile)が落ちますが、とりあえず落ちなくするパッチです。

--- a/src/runtime/malloc.c Tue Dec 02 14:39:23 2014 +1100
+++ b/src/runtime/malloc.c Wed Dec 03 23:30:47 2014 +0900
@@-199,6 +199,8 @@
  // of address space, which is probably too much in a 32-bit world.
  bitmap_size = MaxArena32 / (sizeof(void*)*8/4);
  arena_size = 512<<20;
+ bitmap_size /= 4;
+ arena_size /= 4;
  spans_size = MaxArena32 / PageSize * sizeof(runtime·mheap.spans[0]);
  if(limit > 0 && arena_size+bitmap_size+spans_size > limit) {
  bitmap_size = (limit / 9) & ~((1<<PageShift) - 1);

Post has attachment
I like the idea of using protocol buffer to pass data between Java and C. It simplifies a code drastically. As a bonus, it's a little bit faster than Pojo JNI.
http://askldjd.wordpress.com/2013/02/19/protobuf-over-jni/

#Android  #Jni

Post has shared content
Android Studio now uses Gradle daemon the way it's supposed to do. It's been a irritating bug that made build time around 15 secs longer without any reason.
Prior to version 0.6.0 there was a severe bug in Android Studio, where Gradle daemons were kept alive for 1 minute. This means that pretty much every project build or sync created a new Gradle daemon (a pretty expensive operation.)
In Android 0.6.0 we fixed that: Gradle daemons are kept alive for 3 hours (the default value.) This fix will make it possible for project builds to reuse daemons.
We'd appreciate if you could please pay extra attention to build performance and let us know if you perceive any improvements.
Thanks.

Post has attachment
Golang won't come to Android anytime soon.

At 33:20 of the GopherCon video, Brad says he would add Android and iOS support if he would add one thing to the toolchain. That means there's no plan to support #Android in #golang at least for now.
http://confreaks.com/videos/3439-gophercon2014-inside-the-gophers-studio
Wait while more posts are being loaded