
サイトマップ
色の定義
ADBコマンド
| コマンド | 説明 | 例 |
connect | 接続 | adb connect 192.168.0.10:5555 |
tcpip [ポート番号] | tcpip接続のポート指定 | adb tcpip 5555 |
disconnect | 切断 | adb disconnect |
version | バージョン指定 | adb version |
devices | 接続している端末の確認 | adb devices |
kill-server | adbの停止 | adb kill-server |
start-server | adbの起動 | adb start-server |
Android Studioにおいて、コンパイルオプションを指定する方法
allprojects {
repositories {
jcenter()
}
tasks.withType(JavaCompile){
options.compilerArgs << "-Xlint:deprecation"
}
}
非推奨のメソッド
| 非推奨 | 推奨 |
ActionBarActiviActivity | pandroid.support.v7.app.AppCompatActivity |
gitのignore(無視)リスト
# Android Studio
.gradle
/local.properties
/.idea/workspace.xml
/.idea/libraries
.DS_Store
/build
build.gradle
/captures
gradlew
gradlew.bat
*.iml
画面の向き固定
静的に指定するには、
AndroidManifastで指定
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:screenOrientation="portrait">
| 縦固定 | android:screenOrientation="portrait" |
| 横固定 | android:screenOrientation="landscape" |
| 自動(指定しなくても良い) | android:screenOrientation="unspecified" |
動的に指定するには、Activity#setRequestedOrientationを呼び出す。
| 縦固定 | ActivityInfo.SCREEN_ORIENTATION_PORTRAIT |
| 横固定 | ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE |
| 自動 | ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED |
activityのライフサイクル
fragmentのライフサイクル
画面サイズの判定 (タブレットかどうかなど)
content.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK ;
== Configuration.SCREENLAYOUT_SIZE_XLARGE ; // 求めたいサイズで選ぶ
CopyRight© 2009- 2025 Veanford All Rights Reserved