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
# if /proc/config.gz does not exist, load configs module | |
modprobe configs | |
zcat /proc/config.gz |
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
# monitor property changed on the remote bt device | |
dbus-monitor --system "path=/org/bluez/hci0/dev_3C_28_6D_0A_99_FB,member=PropertiesChanged" |
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 ast | |
from ast import Assign, Name, Call, Store, Load, Str, Num, List, Add, BinOp | |
from ast import Subscript, Slice, Attribute, GeneratorExp, comprehension | |
from ast import Compare, Mult | |
import codegen | |
import random | |
import sys | |
def random_string(minlength, maxlength): |
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
#define TAG "TAG" | |
#define LOG_VERBOSE(...) __android_log_print(ANDROID_LOG_VERBOSE, TAG, __VA_ARGS__) | |
#define LOG_DEBUG(...) __android_log_print(ANDROID_LOG_DEBUG, TAG, __VA_ARGS__) | |
#define LOG_INFO(...) __android_log_print(ANDROID_LOG_INFO, TAG, __VA_ARGS__) | |
#define LOG_WARN(...) __android_log_print(ANDROID_LOG_WARN, TAG, __VA_ARGS__) | |
#define LOG_ERROR(...) __android_log_print(ANDROID_LOG_ERROR, TAG, __VA_ARGS__) | |
#define LOG_FATAL(...) __android_log_print(ANDROID_LOG_FATAL, TAG, __VA_ARGS__) |
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
void saveBitmapToSd(Bitmap mBitmap) { | |
try { | |
// sdcardフォルダを指定 | |
File root = Environment.getExternalStorageDirectory(); | |
// 日付でファイル名を作成 | |
Date mDate = new Date(); | |
SimpleDateFormat fileName = new SimpleDateFormat("yyyyMMdd_HHmmss"); | |
// 保存処理開始 |
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
public Bitmap getViewBitmap(View view){ | |
view.setDrawingCacheEnabled(true); | |
Bitmap cache = view.getDrawingCache(); | |
if(cache == null){ | |
return null; | |
} | |
Bitmap bitmap = Bitmap.createBitmap(cache); | |
view.setDrawingCacheEnabled(false); | |
return bitmap; | |
} |
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
public static boolean isServiceRunning(Context context) { | |
ActivityManager manager = (ActivityManager)context.getSystemService(Context.ACTIVITY_SERVICE); | |
for (RunningServiceInfo service : manager.getRunningServices(Integer.MAX_VALUE)) { | |
Log.v(LOGTAG, "service name:" + service.service); | |
if (MyService.class.getName().equals(service.service.getClassName())) { | |
return true; | |
} | |
} | |
return false; | |
} |