cat temp.dex | head -c 92 | tail -c 4 | hexdump -e '1/4 "%d\n"'
rm temp.dex
dx 要用
/home/charles_lo/Program/adt-bundle-linux-x86_64-20140702/sdk/build-tools/21.1.1
不要用 apt-get 去安裝
實測效果
linux 64 bit vm: http://dl.google.com/android/adt/adt-bundle-linux-x86_64-20140702.zip linux 32 bit vm: http://dl.google.com/android/adt/adt-bundle-linux-x86-20140702.zip mac: http://dl.google.com/android/adt/adt-bundle-mac-x86_64-20140702.zip win32: http://dl.google.com/android/adt/adt-bundle-windows-x86-20140702.zip win64: http://dl.google.com/android/adt/adt-bundle-windows-x86_64-20140702.zip 還有一個更新失敗的 issue 連結 https://code.google.com/p/android/issues/detail?id=73102
private boolean verificaInstagram(){
boolean instalado = false;
try {
ApplicationInfo info = getPackageManager().getApplicationInfo("com.instagram.android", 0);
instalado = true;
} catch (NameNotFoundException e) {
instalado = false;
}
return instalado;
}
2. 透過 startActivity to start relative activityIntent shareIntent = new Intent(android.content.Intent.ACTION_SEND);
shareIntent.setType("image/*"); // 不知道有沒有 video
//以下從 MediaStore 拿圖片名字
final ContentResolver cr = getContentResolver();
final String[] p1 = new String[] {
MediaStore.Images.ImageColumns._ID, MediaStore.Images.ImageColumns.TITLE, MediaStore.Images.ImageColumns.DATE_TAKEN
};
Cursor c1 = cr.query(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, p1, null, null, p1[1] + " DESC");
if (c1.moveToFirst() ) {
Log.i("Teste", "last picture (" + c1.getString(1) + ") taken on: " + new Date(c1.getLong(2)));
}
Log.i("Caminho download imagem", "file://"+Environment.getExternalStorageDirectory()+ "/Tubagram/" + c1.getString(1) + ".png");
//以上從 MediaStore 拿圖片名字
shareIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse("file://"+Environment.getExternalStorageDirectory()+ "/Tubagram/" + c1.getString(1)+".png"));
shareIntent.setPackage("com.instagram.android");
c1.close();
startActivity(shareIntent);
出處: