導航:首頁 > 文件目錄 > 安卓查看文件絕對路徑

安卓查看文件絕對路徑

發布時間:2023-05-04 15:31:48

A. 如何獲得android assert 里圖片的絕對路徑

第一種方法:
String path = "file:///android_asset/文件名";

第二種方法:
InputStream abpath = getClass().getResourceAsStream("/assets/文件名");

若要想要轉換成String類型

String path = new String(InputStreamToByte(abpath ));

private byte[] InputStreamToByte(InputStream is) throws IOException {
ByteArrayOutputStream bytestream = new ByteArrayOutputStream();
int ch;
while ((ch = is.read()) != -1) {
bytestream.write(ch);
}
byte imgdata[] = bytestream.toByteArray();
bytestream.close();
return imgdata;

}

閱讀全文

與安卓查看文件絕對路徑相關的資料

熱點內容
蘋果手機怎樣保存信息 瀏覽:379
安卓patch是什麼文件 瀏覽:819
2003word審閱 瀏覽:387
手機時間查找新文件 瀏覽:695
資料庫管理員怎麼入行 瀏覽:852
安卓nba2k17修改能力 瀏覽:868
win10設置nsf文件共享 瀏覽:445
同一個網站怎麼發文章 瀏覽:725
蘋果翻蓋手機多少錢 瀏覽:815
flash80金鷹教程 瀏覽:374
怎麼把美國的app賬號換成中國的 瀏覽:375
貸款60秒app 瀏覽:408
捷安特騎行app有什麼獎勵 瀏覽:542
網站圖片展示代碼 瀏覽:167
asp找回密碼 瀏覽:836
如何知道別人使用我的電腦和看了什麼文件 瀏覽:712
prcs4視頻導出後找不到文件 瀏覽:977
msp430系列單片機實用c語言程序設計 瀏覽:423
移動硬碟的文件格式 瀏覽:904
文件本地路徑與雲路徑 瀏覽:103

友情鏈接