积累日常生活的点滴,开发过程的心得。

访问Android的OTG设备

https://developer.android.com/guide/topics/connectivity/usb/host.html#di...
追记:

发现了更简单的办法,参考Anexplorer的代码,里面用到了反射通过一个私有的api,可以直接得到usbotg的mount path.然后就可以像访问普通路径一样访问里面的文件,而不需要用usb的api. USB的api有很多问题,不好用.

Android上访问外部存储的方法

从Android4.4开始,只能访问
/Android/data/<アプリのパッケージ名>

http://qiita.com/ariarijp/items/aa365ff47b6e572be3d4

例子程序
https://github.com/ariarijp/SDCard44Sample

WEBRTC的编译

Windows的编译
1.
set GYP_DEFINES='build_with_chromium=0 include_tests=0 disable_glibcxx_debug=1 linux_use_debug_fission=0'
set DEPOT_TOOLS_WIN_TOOLCHAIN=0
gclient runhooks
ninja -C src/out/Debug

2.另外windows下面编译时,必须将系统语言和区域设为英文.

//64bit编译
set GYP_DEFINES="target_arch=x64 build_with_chromium=0 include_tests=0 disable_glibcxx_debug=1 linux_use_debug_fission=0"

IOS下webrtc输出日志

// console output

RTCSetMinDebugLogLevel(kRTCLoggingSeverityInfo);


// file output

self.fileLogger = [[RTCFileLogger alloc] initWithDirPath:logsDirectory maxFileSize:(100 * 1024)];

self.fileLogger.severity = kRTCFileLoggerSeverityInfo;

[self.fileLogger start];

octave里面使用opencv

matlab里面使用opencv非常容易,按照mexopencv的安装说明一步步的很容易就安装上了
octave就有点绕了,octave用的gcc是dw2异常版的,我一开始用了SJLJ的版本,编译后的东西总是运行不了。后来下载了tdm-gcc-webdl.exe,选择安装mingw32 with DW2就可以了。
另外,用mingw编译opencv 3.0编译的时候需要禁用IPP和videoio,因为总是有error。懒得调查了,直接删除videocapture和videowriter.cpp就可以编译了。

IPhone密探007

做了一个iPhone备份信息提取器,可以从iPhone备份信息中提取联系人,照片,视频等信息,并可以查看微信聊天记录,播放声音,视频。

地址:http://www.sqlitedeveloper.com/zh-hans-iphone-backup-explorer-10

matlab中创建指定范围的随机矩阵

rand函数 生成随机数组,数组元素的值均匀分布在0与1之间。通过不同的条用格式可获得所需要的数组(矩阵)。
譬如:1.mat=rand(3,4)生成3*4的随机数矩阵mat。
2. 在指定区间(A,B)生成随机数,用以下方法:针对楼猪的具体例子:
A=10;B=50;
mat=A+(B-A)*rand(10); 生成一个10*10数值在10-50之间的随机矩阵。

IOS及Android文件类型关联的Delphi示例

Android要匹配任意扩展名,注意要改成

  1. <intent-filter>
  2. <action android:name="android.intent.action.VIEW"></action>
  3. <category android:name="android.intent.category.DEFAULT"></category>
  4. <data android:mimeType="*/*"></data>
  5. </intent-filter>
  6. 如果你想关联发送共享之类的,可以加上
  7. <intent-filter>
  8. <action android:name="android.intent.action.SEND" />
  9. <category android:name="android.intent.category.DEFAULT" />
  10. <data android:mimeType="*/*" />
  11. </intent-filter>

ios下关联任意文件,要改成

  1. <key>CFBundleDocumentTypes</key>

替代Applocale的工具

系统升级到win10之后,applocale不好使了,找到了一个替代软件

https://ntlea.codeplex.com/

同步内容