2014-04-01から1ヶ月間の記事一覧

android.compileOptions.targetCompatibility は sourceCompatibility と一致していなければいけない

(追記: 最初targetCompatibilityを1.6, sourceCompatibilityを1.7にするのがベストだと考えたが、ビルドできなかったので修正)Android Studio (as of 0.5.5) で新規プロジェクト作成のとき、Java7を選ぶことができる。しかし、Java7に対応しているのは And…

ASMをつかってdex前にclass fileを覗き見る

Manipulating Java Class Files with ASM 4 - Part One : Hello World! をAndroidのプロジェクトにやってみた。 https://github.com/gfx/Android-AsmExample まず /buildSrc/build.gradle *1 に ASM の依存を書く。 apply plugin: 'groovy' repositories { m…

Android端末でassertを有効にする

以下のやりかたでできました (Android 4.1.1 GenyMotion)。わりと簡単にできるので、検証端末は常にenabledでよさそう。 adb shell setprop debug.assert 1 # enable assert adb shell setprop debug.assert 0 # disable assert

WEB+DB PRESS Vol.79のiOS7特集を読んだ

iOS7特集と題しつつも、iOSの一般的なことにも触れている。特に、実機へのインストールやPUSH通知についての説明がうれしい。全体的には、iOS開発のチュートリアルを何か一つ終えたあたりに読むと良さそうだ。ところで、特集内ではバックグラウンドスレッド…

android.dexOptions.preDexLibrariesを調べた

tips - Improving Build Server performance. : The Gradle based build system has a strong focus on incremental builds. One way it is doing this in doing pre-dexing on the dependencies of each modules, so that each gets turned into its own de…

Q. Gradle Wrapper (gradlew) はリポジトリにコミットするの?

短い答え:コミットする。長い答え:以下参照Chapter 61. The Gradle Wrapper The wrapper is something you should check into version control. By distributing the wrapper with your project, anyone can work with it without needing to install Grad…

android-sdk-managerで必要なSDKやビルドツールを自動インストール

https://github.com/JakeWharton/sdk-manager-plugin builtscriptのdependenciesと apply plugin: "android-sdk-manager" の二行だけで、インストールしたばかりのAndroid SDKしかない状態で ./gradlew assemble ができた。設定が必要ないのはうれしい。同種…

iOS quiz: 以下のdispatch_after()を使ったコードが1, 2, 3, 4という順で実行される理由を説明してください

NSLog(@"1"); dispatch_time_t delay = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)); // 1 sec. dispatch_after(delay, dispatch_get_main_queue(), ^{ NSLog(@"4"); }); dispatch_after(delay, dispatch_get_global_queue(DISPATCH_QUE…