JSON の処理速度を4倍以上にアップできる「LoganSquare」

The fastest JSON parsing and serializing library available for Android. Based on Jackson's streaming API, LoganSquare is able to consistently outperform GSON and Jackson's Databind library by 400% or more1. By relying on compile-time annotation processing to generate code, you know that your JSON will parse and serialize faster than any other method available.

benchmarks

For the curious, the buildscript and apply plugin lines add the apt plugin, which is what allows us to do compile-time annotation processing. The first dependency is what tells Gradle to process your JSON annotations, and the second dependency is our tiny 19kb runtime library that interfaces with the generated code for you.

hvisser / android-apt — Bitbucket

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.neenbedankt.gradle.plugins:android-apt:1.4'
    }
}
apply plugin: 'com.neenbedankt.android-apt'

dependencies {
    apt 'com.bluelinelabs:logansquare-compiler:1.1.0'
    compile 'com.bluelinelabs:logansquare:1.1.0'
}

bluelinelabs/LoganSquare


W/Resources﹕ Converting to string: TypedValue が連発

端末によって連発されることがある.

converting_to_string

W/Resources﹕ Converting to string: TypedValue

ログのフィルタを設定しなければいけないのか,

なにか記述が何か正しくないのか厳格に?

実際のアプリの挙動はおかしくないように見えているが.

Try going into developer options on the phone and uncheck the box for "Enable view attribute inspection"

Ah, good deal. This is expected behavior for view attribute inspection. You'll want to keep it off unless you're actually using the feature in hierarchyviewer as it degrades layout inflation performance.

Issue 78322 - android - Resources﹕ Converting to string: TypedValue - Android Open Source Project - Issue Tracker - Google Project Hosting

「開発者向けオプション」-「表示属性検査を有効にする」をOFFにすると消える.

20150719-011716

開発者オプションのなかに「表示属性検査を有効にする」という不思議な項目があります。これは英語表記のほうがわかりやすいかもしれません。英語では「Enable view attribute inspection」、Viewクラスの属性情報を監査するという意味だと思いますが、直訳したのでしょう。
利用には、チェックボックスを有効にしてから、Android Studio(またはEclipse)のAndroid Device Monitorから「Dump View Hierarchy for UI Automator」を選択します。

View Hierarchyでは、Viewの階層構造をダンプして構造やViewのもつ属性値を視覚化します。Viewの入れ子を減らすことはパフォーマンスに貢献するほか、現在のViewに何が設定されているか、その場でチェックできます。

Android 5.0 Lollipopの開発者オプション詳細解説 | TechBooster | Tech Booster

とりあえず今は, 「Dump View Hierarchy for UI Automator」を使う時だけONにする, と.


Google Play Services 7.5 にアップしたら 権限要求が増えた

少しサイズがでかいけど, 全部まとめて入れていました.

compile 'com.google.android.gms:play-services:7.5.0'

apk を Play Store にアップすると必要権限が増えているといわれる.

Google_Play_Developer_Console

結構ヘビーな権限が追加されてる.

コードはもちろん, AndroidManifest.xml もそのまま.

全部まとめ版 をやめて, 必要なものだけ入れましょう.

compile 'com.google.android.gms:play-services-ads:7.5.0'

これで, 実際に必要な権限だけで apk を作成, アップロードできます.

Setting_Up_Google_Play_Services_ ___ _Google_APIs_for_Android_ ___ _Google_Developers

Setting Up Google Play Services   |   Google APIs for Android   |   Google Developers


Google API 関連は フツーにググらずに

フツーに Google検索で検索すると なんとなくみつからなと思ってました.

SDKなりAPIなりのバージョンアップが早すぎて, 最新の情報がなかなか見つけられない.

そのときは正しいことでも今となっては間違い的なことばかりなど.

または, Android / iOS / WEB 向けなのかも混合されててたどりつけない.

Google_Maps_API_使い方_android_-_Google_Search

検索のさまざまな記述を織り交ぜながら探そうとするが, それもまたググることになる.

今気づいたが, こんなのあったのですね.

Google_Developers

サービス_ ___ _Google_Developers

Google_Maps_API_ ___ _Google_Developers

Google_Maps_Android_API_ ___ _Google_Developers

Try_Cloud_Messaging_for_Android_ ___ _Cloud_Messaging_ ___ _Google_Developers

Google_Maps_Android_API_ ___ _Google_Developers

とりあえずブックマークしておきます.

Google Developers


Android Studio の ビルド がやけにトロい

イライラすぎるので キンキンに調べてやろうと, でまずぐぐって糸口.

gradle.properties ファイルを変更
gradle をオフラインモードに変更

Android Studioのgradleビルドを高速化する - Qiita

org.gradle.jvmargs=-Xmx10248m -XX:MaxPermSize=1024m -XX:+HeapDumpOnOutOfMemoryError - Dfile.encoding=UTF-8
org.gradle.parallel=true
org.gradle.daemon=true
org.gradle.configureondemand=true

[AndroidStudio] 機能実装のビルド時間を減らしたい

.gradle/gradle.propertiesに
org.gradle.daemon=true
と書いておけばGradleデーモンが使われるので立ち上がりが速くなる、というのはあちこちに書いてあるが、実はGradleデーモンが使われていない可能性がある。

また、Gradleの引数が一致していない場合には、IntelliJのSettings->Gradle->Gradle VM Optionsの値を、手動で起動したGradleと合わせておく必要がある。私の場合には、以下を設定してある。
-XX:MaxPermSize=256m -XX:+HeapDumpOnOutOfMemoryError -Xmx1024m

夜でもアッサム: AndroidのGradleでのビルドが遅いのをちょっと速くする

Android開発を爆速にする10のコマンドラインスクリプト - クックパッド開発者ブログ

Android/Gradleのビルド高速化実験 #potatotips - diary ichigotake

いろんな方法があるようなので gradle.properties の方法をまずは.

プロジェクトによってあったりなかったりした, gradle.properties.

別プロジェクトからコピーしてくるか, ユーザーガイドサンプルにもある.

~/.gradle $ find . -name gradle.properties

プロジェクトディレクトリの直下に以下1行だけコメントインしたものを置いて,

# Project-wide Gradle settings.                                                                                                                                 

# IDE (e.g. Android Studio) users:                                                                                                                              
# Gradle settings configured through the IDE *will override*                                                                                                    
# any settings specified in this file.                                                                                                                          

# For more details on how to configure your build environment visit                                                                                             
# http://www.gradle.org/docs/current/userguide/build_environment.html                                                                                           

# Specifies the JVM arguments used for the daemon process.                                                                                                      
# The setting is particularly useful for tweaking memory settings.                                                                                              
# Default value: -Xmx10248m -XX:MaxPermSize=256m                                                                                                                
org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8

# When configured, Gradle will run in incubating parallel mode.                                                                                                 
# This option should only be used with decoupled projects. More details, visit                                                                                  
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects                                                                 
# org.gradle.parallel=true

ビルドしてみたら, 数十秒かかってたのが 2秒くらいになったけど.

gradle.properties

なんでかな(笑)

わたしは今までなにをしてたのかな(笑)

75%速度向上という Gradle 3.0 を Android Studio で試す

【Android Studio】idea.vmoptions の設定

オプションに「–profile」をつけて Run時間が1分から2秒になった話

Android お手軽なビルド時間の短縮メモ