如何在资源文件夹下的文件中的android?文件夹、文件、如何在、资源

由网友(抱我一下我就乖了)分享简介:当我们浏览,我们发现有一个名为一个文件夹assets.Now我想programatically.so访问该文件夹,我应该如何进行的,任何APK?(输入程序将apk文件/只应用程序的名称)。When we browse any apk we found there is one folder named assets....

当我们浏览,我们发现有一个名为一个文件夹assets.Now我想programatically.so访问该文件夹,我应该如何进行的,任何APK?(输入程序将apk文件/只应用程序的名称)。

When we browse any apk we found there is one folder named assets.Now i want to access that folder programatically.so how should i proceed for that?(input for the program will be apk file/just app name).

推荐答案

如果你想从资产的文件夹中使用文件的访问以下code:

If you want access file from assets folder use following code:

        InputStream is = getAssets().open("contacts.csv");
        DefaultHttpClient httpClient = new DefaultHttpClient();
        HttpGet httpGet = new HttpGet(is);
        HttpContext localContext = new BasicHttpContext();
        HttpResponse response =httpClient.execute(httpGet, localContext);
        BufferedReader reader = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));
阅读全文

相关推荐

最新文章