This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<activity | |
android:name=".SampleActivity" | |
android:exported="true" | |
android:allowEmbedded="true" | |
android:label="@string/app_name" | |
android:taskAffinity="" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private GoogleApiClient mGoogleApiClient; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_explain); | |
mGoogleApiClient = (new GoogleApiClient.Builder(this)).addApi(Wearable.API).build(); | |
mGoogleApiClient.connect(); | |
Wearable.NodeApi.getConnectedNodes(mGoogleApiClient).setResultCallback(new ResultCallback() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SharedPreferences defaultSharedPreferences = PreferenceManager.getDefaultSharedPreferences(context); | |
if(defaultSharedPreferences.getBoolean(PREF_KEY,true)){ | |
defaultSharedPreferences.edit().putBoolean(PREF_KEY,false).apply(); | |
//初めての時の処理 | |
}else{ | |
//二回目以降の処理 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
new FirstTimePreference("PREF_KEY").action(CareActivity.this, new FirstTimePreference.FirstTimePreferenceListener() { | |
@Override | |
public boolean onFirstTime() { | |
//初めての時の処理 | |
return true;//次回このメソッドを呼ぶかどうか | |
} | |
@Override | |
public void onNotFirstTime() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.content.Context; | |
import android.content.SharedPreferences; | |
import android.preference.PreferenceManager; | |
/** | |
* 初めて使うときは〜というのを実現するためのクラス | |
* Created by tmen on 2014/07/17. | |
*/ | |
public class FirstTimePreference { | |
private final String mKey; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apply plugin: 'com.android.application' | |
android { | |
compileSdkVersion 20 | |
buildToolsVersion "20.0.0" | |
defaultConfig { | |
applicationId "com.xxxx.xxxx" | |
minSdkVersion 18 | |
targetSdkVersion 20 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.content.Context; | |
import java.lang.reflect.Method; | |
public class JudgeAndroidWear { | |
public static boolean isWear(Context context){ | |
String defaultCharacteristics = ""; | |
String characteristics = get(context, "ro.build.characteristics", defaultCharacteristics); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mkdir work_for_gif | |
ffmpeg -i $1 -an -r 15 -s `ffmpeg -i $1 2>&1 | perl -lane 'print $1 if /(\d{2,}x\d+)/'` work_for_gif/%04d.png | |
convert work_for_gif/*.png output.gif | |
rm -rf work_for_gif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ls -F | grep /|awk ' | |
BEGIN{libraryPrefix="support-v4-"} | |
NR%2==1 {a=$0;sub("/","",a)} | |
NR%2==0 {b=$1;sub("/","",b)} | |
NR%2==0{print "jardiff.py " a "/" libraryPrefix a ".aar " b "/" libraryPrefix b ".aar > "a"-"b".patch"} | |
NR%2==1&&length(b)!=0{print "jardiff.py " b "/" libraryPrefix b".aar " a "/" libraryPrefix a ".aar > "b"-"a".patch"}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
adb devices|grep -v "List of devices"|awk 'NF==2{print $1}'|awk 'BEGIN{all=""} {all =$0"\n"all} END{if(NR==1) {print($0)} else{system("echo \""all "\"|peco") } }' |
OlderNewer