2012-09-12 2 views

답변

14

이 자산 폴더에있는 모든 파일이 나열됩니다 : 예를 들어

InputStream input = assetManager.open(assetName); 
+0

도와 주셔서 감사합니다 많이하지만 나에게 내 자신의 응용 프로그램의 파일 만 반환하고 난의 자산 폴더에 액세스 할 다른 응용 프로그램. – AndroidDev

+0

check http://stackoverflow.com/questions/2454477/access-assests-from-another-application – Nermeen

+4

다른 앱 자산에 액세스 할 수있는 권한이 없습니다. 어쨌든 왜 이걸하고 싶니? – Teovald

6

당신은 코드를 다음과 같은 자산 폴더 사용에서 액세스 파일을 원하는 경우 :

 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())); 
관련 문제