2013年4月24日 星期三

apk

http://tieba.baidu.com/p/1267596506
摘要:
android中的apk檔是一個zip壓縮檔,可以用解壓縮軟體解開。

http://zeaster.blogspot.tw/2007/11/how-to-decompile-dex-file-on-android_28.html
http://www.imobilebbs.com/wordpress/archives/1026
摘要:
class.dex  為 Java編譯成Dalvik 代碼(非Java code)。
.apk 打包後的 所以.xml 文件格式為binary XML 文件格式,可以使用AXMLPrinter2.jar
將二進位XML轉迴文本格式:
java -jar AXMLPrinter2.jar AndroidManifest.xml > AndroidManifest.xml.txt

 http://jinnsblog.blogspot.com/2011/10/how-to-use-sdk-to-install-apk.html
http://givemepass.blogspot.tw/2011/11/adb.html
摘要:
安裝格式:「adb install path/file」
預設會安裝在/system/app/ 底下(我的是/factory)

/sdcard/music = 音樂目錄
/sdcard/Download = 下載檔案的預設目錄 

 http://fecbob.pixnet.net/blog/post/35840955-%E5%8F%B2%E4%B8%8A%E6%9C%80%E5%BC%B7android%E5%8F%8D%E7%B7%A8%E8%AD%AF%E5%B7%A5%E5%85%B7%E7%B6%A0%E8%89%B2%E7%89%88v2.0%EF%BC%88%E6%94%B9%E9%80%B2%E7%89%88
 摘要:
android apk反編譯軟體apktool

Android Bluetooth

07.Android之Bluetooth 

http://blog.csdn.net/jjunjoe/article/details/6928913

2013年4月22日 星期一

bluetooth rfcomm

http://www.piaccess.com/trac/wiki/Linux_BlueZ_Bluetooth_Serial_Setup
http://blog.mcuol.com/User/kynot/Article/7049_1.htm
 About rfcomm arugement "channel"
 http://ubuntuforums.org/showthread.php?t=200142

rfcomm  usage:
rfcomm <command> <Bluetooth Device> <BD Address> < Channel>

# rfcomm bind hci0 00:07:A4:D2:03:67 1
#ls -l /dev/rfcomm0
crw------- root root  <time>  rfcomm0
# hcitool cc 00:07:A4:D2:03:67 

2013年4月9日 星期二

2013年4月8日 星期一

extern struct

http://stackoverflow.com/questions/3266580/extern-struct

I'm using extern to fetch variables from another class, and it works fine for int's, float's etc...
But this doesn't work, and I don't know how to do it:

Class1.cpp
struct MyStruct {
 int x;
}

MyStruct theVar;
 
Class2.cpp
extern MyStruct theVar;

void test() {
 int t = theVar.x;
}
 
It doesn't work because Class2 doesn't know what MyStruct is.
How do I fix this? :/
I tried declaring the same struct in Class2.cpp, and it compiled, but the values were wrong.


7 down vote accepted
You put the struct MyStruct type declaration in a .h file and include it in both class1.cpp and class2.cpp.
IOW:
Myst.h
struct MyStruct {
 int x;
};
 
Class1.cpp
#include "Myst.h"

MyStruct theVar;
 
Class2.cpp
#include "Myst.h"

extern struct MyStruct theVar;

void test() {
 int t = theVar.x;
}

gcc -ldl

-ldl 指示连接器连接一个库。这个库里包含了 dlopen, dlsym 等等的函数。也就是说,是支持“在运行时,显示加载使用动态连接库”的函数库。相关的头文件是 dlfcn.h