adb kill-server
adb start-server
adb reboot
adb reboot recovery
public static void takeScreenshot(Activity activity) { | |
Date now = new Date(); | |
android.text.format.DateFormat.format("yyyy-MM-dd_hh:mm:ss", now); | |
try { | |
// image naming and path to include sd card appending name you choose for file | |
String mPath = Environment.getExternalStorageDirectory().toString() + "/Screenshot_" + now + ".jpg"; | |
// create bitmap screen capture | |
View v1 = activity.getWindow().getDecorView().getRootView(); |
public static void toast(Context context) { | |
Toast toast = Toast.makeText(context, "This is a Toast.", Toast.LENGTH_SHORT); | |
View toastView = toast.getView(); | |
TextView toastMessage = (TextView) toastView.findViewById(android.R.id.message); | |
toastMessage.setTextSize(19); | |
toastMessage.setTextColor(Color.BLACK); | |
toastMessage.setGravity(Gravity.CENTER); | |
toastMessage.setCompoundDrawablesWithIntrinsicBounds(R.drawable.icon_small, 0, 0, 0);// Add an icon to textView | |
toastMessage.setCompoundDrawablePadding(16); // Add padding to icon | |
toastView.setBackgroundColor(Color.WHITE); |
curl https://api.bintray.com/search/packages/maven\?g\=co.pushe.plus | python3 -mjson.tool | grep -i name | |
# Bintray REST: https://bintray.com/docs/api | |
# ?g is group | |
# python3 -mjson.tool will beautify the output json | |
# grep name will get only module names |
public static void cancelJob(Context c, int jobId) { | |
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { | |
JobScheduler jobScheduler = | |
(JobScheduler) c.getSystemService(Context.JOB_SCHEDULER_SERVICE); | |
jobScheduler.cancel(jobId); | |
} | |
} | |
// Call it like this |
""" | |
Prerequisites: | |
1. Scrapy: python3 -m pip install scrapy | |
2. Youtube-dl: python3 -m pip install youtube-dl | |
(Use conda or miniconda for windows to install scrapy. Or use WSL and install python3 on it) | |
It's also possible to modify this to get other courses from caster.io or even other sites. | |
""" | |
from scrapy.spiders import Spider | |
from scrapy.crawler import CrawlerProcess | |
import youtube_dl |
<script src="https://static.pushe.co/pusheweb.js"></script> | |
<script> | |
Pushe.init("app_id"); // App_id is retrieved via console.pushe.co | |
Pushe.subscribe({"showDialog":true,"showBell":false,"icon":"https://static.pushe.co/d/webpush/default-icon.png","title":"Get the latest news bro :D","content":"You want to be notified of every new event happenning to My site? Click OK then.","position":"top-center","direction":"ltr","acceptText":"OK, sure","rejectText":"Nuh","promptTheme":"pushe-prompt-theme2","mobilePosition":"top","dialogRetryRate":0}); | |
</script> |
<body> | |
<!-- region Add pushe before your Flutter script --> | |
<script src="https://static.pushe.co/pusheweb.js"></script> | |
<script> | |
Pushe.init("app_id"); // App_id is retrieved via console.pushe.co | |
Pushe.subscribe({"showDialog":true,"showBell":false,"icon":"https://static.pushe.co/d/webpush/default-icon.png","title":"Get the latest news bro :D","content":"You want to be notified of every new event happenning to My site? Click OK then.","position":"top-center","direction":"ltr","acceptText":"OK, sure","rejectText":"Nuh","promptTheme":"pushe-prompt-theme2","mobilePosition":"top","dialogRetryRate":0}); | |
</script> | |
<!-- endregion--> | |
<!-- region Flutter's own code --> |
// TAG: pushlog | |
2020-09-17 13:54:34.677 10602-10602/? I/SEMS:DataAdapterLog_11.1.0: [SEMS][PushLog][2][SmpManager] Instance created | |
2020-09-17 13:54:34.677 10602-10602/? I/SEMS:DataAdapterLog_11.1.0: [SEMS][PushLog][2][SmpManager] registerMessageCallback - 0 | |
2020-09-17 13:54:34.677 10602-10602/? I/SEMS:DataAdapterLog_11.1.0: [SEMS][PushLog][2][SmpManager] registerTokenCallback | |
2020-09-17 13:54:34.837 10602-10602/? I/SEMS:DataAdapterLog_11.1.0: [SEMS][PushLog][2][SmpManager] registerMessageCallback - 9 | |
2020-09-17 13:54:34.850 10602-10602/? I/SEMS:DataAdapterLog_11.1.0: [SEMS][PushLog][2][SmpManager] registerMessageCallback - 7 | |
2020-09-17 13:54:34.850 10602-10602/? I/SEMS:DataAdapterLog_11.1.0: [SEMS][PushLog][2][SmpManager] registerMessageCallback - 8 | |
2020-09-17 13:54:34.863 10602-10602/? I/SEMS:DataAdapterLog_11.1.0: [SEMS][PushLog][2][SmpManager] registerMessageCallback - 12 | |
2020-09-17 13:54:34.872 10602-10602/? I/SEMS:DataAdapterLog_11.1.0: [SEMS][PushLog][2][SmpManager] registerMessageCallback - 13 |
//// pushlog | |
2020-09-19 17:47:36.806 24125-24569/? I/PushLog50002300_HMS: [I/PushKit/PushLog50002300_HMS 24125:7415 null:81] MainEntry register success | |
2020-09-19 17:47:36.836 24125-24569/? E/PushLog50002300_HMS: [E/PushKit/PushLog50002300_HMS 24125:7415 null:139] HwCfgFilePolicy ClassNotFoundException | |
2020-09-19 17:47:36.836 24125-24569/? I/PushLog50002300_HMS: [I/PushKit/PushLog50002300_HMS 24125:7415 null:58] push jarFile is not exist | |
2020-09-19 17:47:36.839 24125-24569/? I/PushLog50002300_HMS: [I/PushKit/PushLog50002300_HMS 24125:7415 null:64] getEmuiLevel:0 | |
2020-09-19 17:47:37.803 24125-24583/? I/PushLog50002300_HMS: [I/PushKit/PushLog50002300_HMS 24125:7424 null:8] process hms token for EMUI, return | |
2020-09-19 17:47:37.955 24125-24583/? W/PushLog50002300_HMS: [W/PushKit/PushLog50002300_HMS 24125:7424 null:40] genarate hmstokensign:hmsToken is null. | |
2020-09-19 17:47:37.979 24125-24678/? I/PushLog50002300_HMS: [I/PushKit/PushLog50002300_HMS 24125:7452 null:41] update xml data, old version is 0,new versi |