編輯:關於Android編程
打開Android BlueZ Debug 開關:
Enable Bluetoothd debugging
Way1:
In file external/bluetooth/bluez/src/log.h
Redefine DBG as follow:
1)
#define DBG(fmt, arg...) __android_log_print(ANDROID_LOG_DEBUG, "BlueZ", fmt, ## arg)
2)
add file as header in log.h:
#include <android/log.h>
3)
void __btd_toggle_debug()
{
struct btd_debug_desc *desc;
// for (desc = __start___debug; desc < __stop___debug; desc++)
// desc->flags |= BTD_DEBUG_FLAG_PRINT;
}
void __btd_log_init(const char *debug, int detach)
{
int option = LOG_NDELAY | LOG_PID;
struct btd_debug_desc *desc;
const char *name = NULL, *file = NULL;
if (debug != NULL)
enabled = g_strsplit_set(debug, ":, ", 0);
/*
for (desc = __start___debug; desc < __stop___debug; desc++) {
if (file != NULL || name != NULL) {
if (g_strcmp0(desc->file, file) == 0) {
if (desc->name == NULL)
desc->name = name;
} else
file = NULL;
}
if (is_enabled(desc))
desc->flags |= BTD_DEBUG_FLAG_PRINT;
}
*/
Way 2:
In file external/bluetooth/bluez/src/log.h:
1.
Add
#include <cutils/logd.h>
2.
Before:
#define BTD_DEBUG_FLAG_DEFAULT (0)
#define BTD_DEBUG_FLAG_PRINT (1 << 0)
After
#define BTD_DEBUG_FLAG_DEFAULT 1
#define BTD_DEBUG_FLAG_PRINT 1
3.
Before:
#define DBG(fmt, arg...) do { \
static struct btd_debug_desc __btd_debug_desc \
__attribute__((used, section("__debug"), aligned(8))) = { \
.file = __FILE__, .flags = BTD_DEBUG_FLAG_DEFAULT, \
}; \
if (__btd_debug_desc.flags & BTD_DEBUG_FLAG_PRINT) \
btd_debug("%s:%s() " fmt, __FILE__, __FUNCTION__ , ## arg); \
} while (0)www.2cto.com
After:
#define DBG(fmt, arg...) do { \
static struct btd_debug_desc __btd_debug_desc \
__attribute__((used, section("__debug"), aligned(8))) = { \
.file = __FILE__, .flags = BTD_DEBUG_FLAG_DEFAULT, \
}; \
if (__btd_debug_desc.flags & BTD_DEBUG_FLAG_PRINT) \
__android_log_print(ANDROID_LOG_DEBUG, "BlueZ",fmt, ##arg); \
} while (0)
End.
14條Android Studio常用的的配置1,修改idea.properties文件找到\bin\idea.properties文件,打開,改成這樣:#禁止第一次運行
自Android x86出來後,很多人開始在虛擬機上安裝繼續體驗,但是安裝並不是很簡單,隨之網上各種安裝教程就出現了,Virtualbox虛擬機下Andro
這篇博客主要介紹的是 Android 主流各種機型和各種版本的懸浮窗權限適配,但是由於碎片化的問題,所以在適配方面也無法做到完全的主流機型適配懸浮窗適配懸浮窗適配有兩種方
上篇講到了Fragment的基礎應用,現在給大家演示一下Fragment的生命周期是什麼樣子的。關於Fragemnt的基礎應用,請見http://blog.csdn.ne