公式「Guide to App Architecture」のサンプルコードに Retrofit が登場している件

きっと開発者は見たくなる

公式が言うところの「おすすめのアーキテクチャ」.

Guide to App Architecture | Android Developers

眺めているとこんなコードが..


public interface Webservice {
    /**
     * @GET declares an HTTP GET request
     * @Path("user") annotation on the userId parameter marks it as a
     * replacement for the {user} placeholder in the @GET path
     */
    @GET("/users/{user}")
    Call<User> getUser(@Path("user") String userId);
}

ん?

Retrofit だ.

Retrofit

サードパーティであるSquare産の通信ライブラリを公式のサンプルコードに利用している.

Volley じゃないんだ!?

interface を見せながらの構成説明が明快に伝わりやすいとしても.

今どきガチガチ社内でサードパーティライブラリ利用の話が進めやすくなっていく方も多いのではと想像.


アイコン叩いても何も反応しない Android Studio

[Help] - [Edit Custom VMOptions..]

GUI上から編集できるようになっておりますが.

ふと

AndroidStudio自体が起動できなくなりました.


$ open -a Android\ Studio.app
LSOpenURLsWithRole() failed for the application /Applications/Android Studio.app with error -10810.

なんだこれ...


$ open /Applications/Android\ Studio.app
LSOpenURLsWithRole() failed with error -10810 for the file /Applications/Android Studio.app.

直で叩く.


$ /Applications/Android\ Studio.app/Contents/MacOS/studio
2017-05-21 22:03:57.938 studio[3424:190690] Value of STUDIO_JDK: /Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home
2017-05-21 22:03:57.939 studio[3424:190690] allVms required 1.8*,1.8+
2017-05-21 22:03:57.941 studio[3424:190695] fullFileName is: /Applications/Android Studio.app/Contents/bin/studio.vmoptions
2017-05-21 22:03:57.941 studio[3424:190695] fullFileName exists: /Applications/Android Studio.app/Contents/bin/studio.vmoptions
2017-05-21 22:03:57.941 studio[3424:190695] Value of STUDIO_VM_OPTIONS is (null)
2017-05-21 22:03:57.942 studio[3424:190695] Processing VMOptions file at /Applications/Android Studio.app/Contents/bin/studio.vmoptions
2017-05-21 22:03:57.942 studio[3424:190695] Done
2017-05-21 22:03:57.942 studio[3424:190695] Processing VMOptions file at /Users/maochanz/Library/Preferences/AndroidStudio2.3/studio.vmoptions
2017-05-21 22:03:57.942 studio[3424:190695] Done
2017-05-21 22:03:57.942 studio[3424:190695] Processing VMOptions file at
2017-05-21 22:03:57.943 studio[3424:190695] No content found
Invalid maximum heap size: -Xmx4096m ###
2017-05-21 22:03:57.947 studio[3424:190695] JNI_CreateJavaVM (/Applications/Android Studio.app/Contents/jre/jdk) failed: 4294967290

コメントのつもりの ### が原因でした.


$ cat ~/Library/Preferences/AndroidStudio2.3/studio.vmoptions
# custom Android Studio VM options, see http://tools.android.com/tech-docs/configuration
-Xms1024m
-Xmx4096m ###
-XX:MaxPermSize=1024m
-XX:ReservedCodeCacheSize=440m
-XX:+UseCompressedOops
-XX:+HeapDumpOnOutOfMemoryError
-Dfile.encoding=UTF-8

直接テキストエディタで書き換えればよしとな.

お年寄りは自動車運転なんかよりマニュアル車のがいいと思います.


Gradle 3.5 に更新する方法

Gradle 3.5 released : androiddev


./gradlew wrapper --gradle-version 3.5 --distribution-type all

ちなみに以下を書き換える方法については


distributionUrl=https\://services.gradle.org/distributions/gradle-3.5-all.zip

Jake がコメント.

That's mostly fine, but it doesn't update the bootstrap script nor the bootstrap jar. Basically you just miss out on improvements to those two components which can help with things like OS compatibility and caching of the Gradle runtime.

コマンドラインから更新したほうが良さそうです.