一個好用的線上建立Logo或是宣傳圖的網站
https://www.norio.be/android-feature-graphic-generator/
今天寫了一個簡單的純文字筆記APP, google play console要求要有一個宣傳的圖1024×500大小
用上面的連結很方便就能做出來.
https://www.norio.be/android-feature-graphic-generator/
今天寫了一個簡單的純文字筆記APP, google play console要求要有一個宣傳的圖1024×500大小
用上面的連結很方便就能做出來.
StrictMode用來限制App存取disk或是網路, 若要全部開放,可以在主要activity時加上
StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build(); StrictMode.setThreadPolicy(policy);
ps. android開發網站並不建議這樣做
若出現
java.lang.RuntimeException: Can’t create handler inside thread that has not called Looper.prepare()
需要在出現該問題的物件(Toast或是Dialog), 前面加上Looper.prepare(),後面加上 Looper.loop();
Intent mediaScanIntent = new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE); File f = new File(<新檔案名稱(含路徑)>); Uri contentUri = Uri.fromFile(f); mediaScanIntent.setData(contentUri); <your activity>.sendBroadcast(mediaScanIntent);
請參考這個
AndroidX is the open-source project that the Android team uses to develop, test, package, version and release libraries within Jetpack.
舊版架構對應到androidx可在以下連結找到對應
若是全部重來(format), 請注意第一次重開機時, 不要設定pin code , 否則會導致進twrp時, 無法解碼(decrypt data), 請全部開機成功後,再設定pin code .
若是進twrp解碼真的有問題, 請雙清後, 再刪除/data/system/ 裡面 所有.key 檔案, 與locksetting字樣的檔案. 然後重新開機,進入初始狀態(一樣不要設定pin code).
前一陣子突然想在android玩git , 因此測試了一下Eclipse 內的 jgit library
發現原本我的 InMethodJakarta 專案所含的 jgit 4.6 版library 居然無法相容android,
最後終於發現 jgit 4.6以後至少要java 8, 但 android 有些不相容.
測試了好久, 從最新的jgit 5.4版本降測到3.7.1, 終於成功了. 又再往上測試到4.5版也可相容 android , 因此寫下來做個紀念
下載的地方在這裡
Android 6.0(API 21)以後, 搜尋藍芽裝置的方式改成:
BluetoothAdapter.startScan (ScanCallback callback)
這種方式我一直用了很久, 也沒遇到問題.
直到有一個需求是隨時監控廣播封包,
這種寫法就會遇到問題, 無法快速取得周遭藍牙廣播資料, 因此需要修改寫法, 把能下的藥都下下去(但耗電):
final List<ScanFilter> filters = new ArrayList<>(); ScanFilter filter = new ScanFilter.Builder().build(); filters.add(filter); final ScanSettings scanSettings = new ScanSettings.Builder() .setNumOfMatches(ScanSettings.MATCH_NUM_MAX_ADVERTISEMENT).setMatchMode(ScanSettings.MATCH_MODE_STICKY).setCallbackType(ScanSettings.CALLBACK_TYPE_ALL_MATCHES).setScanMode(ScanSettings.SCAN_MODE_LOW_LATENCY).build(); BluetoothAdapter.getBluetoothLeScanner().startScan(filters,scanSettings,mLeScanCallback);