1
我想试试oobjloader。 (免费波形3D格式加载器)我加载了第一个.obj,但没有找到原始目录。 (或只是没有找到该文件)如何在android中获取原始文件或原始目录?
Uri url = Uri.parse("android.resource://" + getPackageName() + "/" + R.raw.cube1);
String filename = url.toString();
try {
Build builder = new Build();
Parse obj = new Parse(builder, filename);
} catch (java.io.FileNotFoundException e) {
System.out.println("trace FileNotFoundException loading file " + filename + ", e=" + e);
e.printStackTrace();
} catch (java.io.IOException e) {
System.out.println("trace IOException loading file " + filename + ", e=" + e);
e.printStackTrace();
}
如何获得原始文件目录url?
错误:
10-18 22:10:42.714 6136-6136/com.solar.asc.solar I/System.out﹕ trace FileNotFoundException loading file android.resource://com.solar.asc.solar/2131099648, e=java.io.FileNotFoundException: /android.resource:/com.solar.asc.solar/2131099648: open failed: ENOENT (No such file or directory)
10-18 22:10:42.714 6136-6136/com.solar.asc.solar W/System.err﹕ java.io.FileNotFoundException: /android.resource:/com.solar.asc.solar/2131099648: open failed: ENOENT (No such file or directory)
10-18 22:10:42.714 6136-6136/com.solar.asc.solar W/System.err﹕ at libcore.io.IoBridge.open(IoBridge.java:416)
10-18 22:10:42.714 6136-6136/com.solar.asc.solar W/System.err﹕ at java.io.FileInputStream.<init>(FileInputStream.java:78)
我也试过其他格式,但没有帮助。
"android.resource://" + getPackageName() + "/raw/cube1"
"android.resource://" + getPackageName() + "/raw/cube1.obj"
Thx all answare。
Thx,答案,但我不想要.obj内容。我想要资源原始文件网址或原始目录网址。我会给文件的url外部库。 (oobjloader)只是没有找到该文件。 – Cipo
我想你会得到uri文件:/// android_res/raw/你可以试试这个。 –
dex
没有帮助。但是,thx。也许我应该找资产。 – Cipo