自動バックアップ
SharedPreferencesが再インストール時にリセットされない
bmgr
https://stuff.mit.edu/afs/sipb/project/android/docs/tools/help/bmgr.html
Auto Backup for Android codelab
https://codelabs.developers.google.com/codelabs/android-backup-codelab/#0
Data backup overview
https://developer.android.com/guide/topics/data/backup
<manifest
<application
android:allowBackup="true"
adb shell bmgr enabled
adb shell bmgr enable <true|false>
adb shell bmgr list transports
adb shell bmgr backupnow <PACKAGE>
adb shell bmgr backup <PACKAGE>
adb shell bmgr run
adb shell bmgr restore <TOKEN> <PACKAGE>
2019年7月7日日曜日
2019年7月5日金曜日
adb shell dumpsys jobscheduler
adb shell dumpsys jobscheduler
Active jobs:
Slot #0: inactive since -9m38s404ms, stopped because: app called jobFinished
Slot #1: inactive since -11m39s487ms, stopped because: cancel() called by app, callingUid=10049 uid=10049 jobId=43
Slot #2: inactive since -11m39s594ms, stopped because: cancel() called by app, callingUid=10049 uid=10049 jobId=183
Slot #3: inactive since -3h35m29s108ms, stopped because: last work dequeued
Slot #4: inactive since -3h45m4s586ms, stopped because: last work dequeued
Slot #5: inactive since -3h45m4s848ms, stopped because: app called jobFinished
Slot #6: inactive
Slot #7: inactive
Slot #8: inactive
Slot #9: inactive
Slot #10: inactive
Slot #11: inactive
Slot #12: inactive
Slot #13: inactive
Slot #14: inactive
Slot #15: inactive
mReadyToRock=true
mReportedActive=false
mMaxActiveJobs=6
PersistStats: FirstLoad: 78/11/9 LastSave: 67/6/4
Active jobs:
Slot #0: inactive since -9m38s404ms, stopped because: app called jobFinished
Slot #1: inactive since -11m39s487ms, stopped because: cancel() called by app, callingUid=10049 uid=10049 jobId=43
Slot #2: inactive since -11m39s594ms, stopped because: cancel() called by app, callingUid=10049 uid=10049 jobId=183
Slot #3: inactive since -3h35m29s108ms, stopped because: last work dequeued
Slot #4: inactive since -3h45m4s586ms, stopped because: last work dequeued
Slot #5: inactive since -3h45m4s848ms, stopped because: app called jobFinished
Slot #6: inactive
Slot #7: inactive
Slot #8: inactive
Slot #9: inactive
Slot #10: inactive
Slot #11: inactive
Slot #12: inactive
Slot #13: inactive
Slot #14: inactive
Slot #15: inactive
mReadyToRock=true
mReportedActive=false
mMaxActiveJobs=6
PersistStats: FirstLoad: 78/11/9 LastSave: 67/6/4
2019年6月9日日曜日
AdRequest.addTestDevice
AdRequest.Builder builder = new AdRequest.Builder();
builder.addTestDevice("7026FA2EC1DC7E60FBEA02C64D33BD8B");
builder.addTestDevice("53185CF5BFA5B2121DF7FA86E7064C22");
builder.addTestDevice("78957C13BCC9AA1AC5D8462F2DEC083A");
builder.addTestDevice("C9517774AEB25C5D4B40D8175F152E03");
2019年6月6日木曜日
ADBコマンド導入の方法
ADBコマンド導入の方法
https://developer.android.com/studio/releases/platform-tools.html
platform-tools_r29.0.0-windows.zip
adb.exe
fastboot.exe
https://dl.google.com/android/repository/usb_driver_r11-windows.zip
http://adakoda.github.io/android-screen-monitor/
Android Screen Monitor
https://developer.android.com/studio/releases/platform-tools.html
platform-tools_r29.0.0-windows.zip
adb.exe
fastboot.exe
https://dl.google.com/android/repository/usb_driver_r11-windows.zip
http://adakoda.github.io/android-screen-monitor/
Android Screen Monitor
2019年6月4日火曜日
raspberrypi3 Apache2 PHP7 Sqlite3 curl vsftpd
raspberrypi3 Apache2 PHP7 Sqlite3 curl vsftpd
sudo apt-get install apache2
sudo apt-get install php
sudo apt-get install sqlite3
sudo apt-get install php-sqlite
sudo apt-get install php-curl
sudo apt-get install vsftpd
raspberrypi3 の省エネ設定
sudo tvservice --off
sudo ifconfig wlan0 down
ファームウェアのバージョン
$ vcgencmd version
メモリの割り当て
sudo apt-get install apache2
sudo apt-get install php
sudo apt-get install sqlite3
sudo apt-get install php-sqlite
sudo apt-get install php-curl
sudo apt-get install vsftpd
raspberrypi3 の省エネ設定
sudo tvservice --off
sudo ifconfig wlan0 down
2020/11/05
電圧の状態を調べる方法
$ vcgencmd get_throttled
throttled 値 状態
0x0 正常
0x50000 過去に低電圧状態になったが、現在は正常
0x50005 現在低電圧状態にある。
0x80000 過去に熱によりクロックダウンした。
0x80008 現在熱によりクロックダウンしている。
コア電圧を確認
$ vcgencmd measure_volts
volt=1.2000V
CPUの温度
$ vcgencmd measure_temp
temp=42.9'C
CPUの動作周波数
$ vcgencmd measure_clock arm
frequency(45)=600000000
$ vcgencmd version
Aug 15 2019 12:06:42
Copyright (c) 2012 Broadcom
version 0e6daa5106dd4164474616408e0dc24f997ffcf3 (clean) (release) (start)
メモリの割り当て
$ vcgencmd get_mem arm
arm=948M
$ vcgencmd get_mem gpu
gpu=76M
https://www.raspberrypi.org/documentation/raspbian/applications/vcgencmd.md
https://www.raspberrypi.org/documentation/raspbian/applications/vcgencmd.md
end
2019年5月22日水曜日
在自定义的SurfaceView 上打开 DialogFragment
在自定义的SurfaceView 上打开 DialogFragment
myDialogFragment.show(((AppCompatActivity) getContext()).getSupportFragmentManager(), "text");
@Override
public boolean onTouchEvent(MotionEvent event) {
boolean show = true;
if (show) {
AboutDialog aboutDialog = new AboutDialog(getContext());
aboutDialog.show();
Toast.makeText(getContext(), "xxxxxxxxxx", Toast.LENGTH_SHORT).show();
} else {
MyDialogFragment myDialogFragment = new MyDialogFragment();
myDialogFragment.item("99");
myDialogFragment.show(((AppCompatActivity) getContext()).getSupportFragmentManager(), "text");
}
return true;
}
myDialogFragment.show(((AppCompatActivity) getContext()).getSupportFragmentManager(), "text");
@Override
public boolean onTouchEvent(MotionEvent event) {
boolean show = true;
if (show) {
AboutDialog aboutDialog = new AboutDialog(getContext());
aboutDialog.show();
Toast.makeText(getContext(), "xxxxxxxxxx", Toast.LENGTH_SHORT).show();
} else {
MyDialogFragment myDialogFragment = new MyDialogFragment();
myDialogFragment.item("99");
myDialogFragment.show(((AppCompatActivity) getContext()).getSupportFragmentManager(), "text");
}
return true;
}
2019年4月13日土曜日
admob 設定
admob 設定
public class MainActivity extends AppCompatActivity {
private String T = "### MainActivity";
private MySurfaceView3 mySurfaceView;
@Override protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mySurfaceView = new MySurfaceView3(this);
RelativeLayout.LayoutParams rl = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT, RelativeLayout.LayoutParams.MATCH_PARENT);
addContentView(mySurfaceView, rl);
Google_admob();
View view = findViewById(R.id.activity_main);
view.bringToFront();
}
protected void Google_admob() {
MobileAds.initialize(this, "ca-app-pub-3940256099942544~3347511713");
ViewGroup viewGroup = findViewById(R.id.activity_main);
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT);
AdView adView = new AdView(this);
adView.setAdSize(AdSize.BANNER);
adView.setBackgroundColor(ContextCompat.getColor(this, R.color.colorAccent));
layoutParams.addRule(RelativeLayout.CENTER_HORIZONTAL);
layoutParams.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);
adView.setLayoutParams(layoutParams);
adView.setAdUnitId("ca-app-pub-3940256099942544/6300978111");
AdRequest.Builder builder = new AdRequest.Builder();
builder.addTestDevice("7026FA2EC1DC7E60FBEA02C64D33BD8B");
builder.addTestDevice("53185CF5BFA5B2121DF7FA86E7064C22");
AdRequest adRequest = builder.build();
adView.loadAd(adRequest);
viewGroup.addView(adView);
adView.setAdListener(new AdListener() {
@Override public void onAdLoaded() {
super.onAdLoaded();
Log.i(T, "onAdLoaded");
}
@Override public void onAdOpened() {
super.onAdOpened();
Log.i(T, "onAdOpened");
}
@Override public void onAdLeftApplication() {
super.onAdLeftApplication();
Log.i(T, "onAdLeftApplication");
}
@Override public void onAdClosed() {
super.onAdClosed();
Log.i(T, "onAdClosed");
}
});
}
}
//
I / ### MainActivity: onAdLoaded
I / ### MainActivity: onAdOpened
I / ### MainActivity: onAdLeftApplication
I / ### MainActivity: onAdClosed
I / ### MainActivity: onAdLoaded
登録:
投稿 (Atom)