Skip to content

Instantly share code, notes, and snippets.

View YukiMatsumura's full-sized avatar

Yuki312 YukiMatsumura

View GitHub Profile
@YukiMatsumura
YukiMatsumura / file0.txt
Last active August 29, 2015 14:17
UIAutomator2.0を使ったAndroid UI Testの準備 ref: http://qiita.com/Yuki_312/items/c4e2138aff9fcaf02afd
android {
defaultConfig {
minSdkVersion 18 // Requires Android 4.3 (API level 18)
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
packagingOptions {
exclude 'LICENSE.txt' // Duplicate files copied
}
}
private void disableConnectionReuseIfNecessary() {
// HTTP connection reuse which was buggy pre-froyo
if (Integer.parseInt(Build.VERSION.SDK) < Build.VERSION_CODES.FROYO) {
System.setProperty("http.keepAlive", "false");
}
}
// Java7 non-Lambda
Runnable r = new Runnable() {
public void run() {
System.out.println("Howdy, world!");
}
};
r.run();
// Java8 Lambda
Runnable r2 = () -> System.out.println("Howdy, world!");
<uses-permission android:name="android.permission.BLUETOOTH"/>
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
@YukiMatsumura
YukiMatsumura / .gitignore
Created April 12, 2015 15:00
.gitignore on AndroidStudio
# built application files
*.apk
*.ap_
# files for the dex VM
*.dex
# Java class files
*.class
@YukiMatsumura
YukiMatsumura / file0.groovy
Created April 15, 2015 13:40
gradleからdeploygateへアップロードする ref: http://qiita.com/Yuki_312/items/1a0991e45a9bff1cc9a4
dependencies {
// ...
classpath 'com.deploygate:gradle:0.6.2'
}
keytool -exportcert -alias androiddebugkey -keystore path-to-debug-or-production-keystore -list -v
@YukiMatsumura
YukiMatsumura / file0.groovy
Created April 28, 2015 14:17
AndroidStudio + PowerMock でstaticメソッドをmockする ref: http://qiita.com/Yuki_312/items/80e0cda79731eb56c769
// UnitTestにはtestCompileキーワードを使用
testCompile 'junit:junit:4.12'
// PowerMockのライブラリを指定
testCompile 'org.powermock:powermock-module-junit4:1.6.2'
testCompile 'org.powermock:powermock-api-mockito:1.6.2'
@YukiMatsumura
YukiMatsumura / file.rb
Created May 20, 2015 23:32
google keep 公開 - Google 検索
https://www.google.co.jp/search?q=google+keep+%E5%85%AC%E9%96%8B&oq=google+keep+%E3%81%93%E3%81%86%E3%81%8B%E3%81%84&aqs=chrome.1.69i57j0.11915j0j4&sourceid=chrome-mobile&espv=1&ie=UTF-8
@YukiMatsumura
YukiMatsumura / file.rb
Created May 20, 2015 23:34
Android Wear 5.1.1へのアップデートが配信中! Wi-Fiサポートなど新機能が複数追加
Android Wear 5.1.1へのアップデートが配信中! Wi-Fiサポートなど新機能が複数追加
http://octoba.net/archives/20150520-android-news-wear-5-1-1.html