Skip to content

Instantly share code, notes, and snippets.

View zewenhs's full-sized avatar

zewen zewenhs

  • shanghai
View GitHub Profile
@zewenhs
zewenhs / android-bluetooth-low-energy-resources.md
Created December 19, 2018 02:59 — forked from stkent/android-bluetooth-low-energy-resources.md
Android Bluetooth Low Energy (BLE) Resources
@zewenhs
zewenhs / selectfile.java
Created November 7, 2018 09:13
ANDROID中调用文件管理器并返回选中文件的路径
public String getRealPathFromURI(Uri contentUri) {
String res = null;
String[] proj = { MediaStore.Images.Media.DATA };
Cursor cursor = getContentResolver().query(contentUri, proj, null, null, null);
if(null!=cursor&&cursor.moveToFirst()){;
int column_index = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
res = cursor.getString(column_index);
cursor.close();
}
return res;