1. 程式人生 > >1、讀取Android工程下的配置檔案

1、讀取Android工程下的配置檔案

1、將text.config檔案複製貼上到工程assets目錄

2、利用 AssetManger來讀取,配置檔案裡面的內容

           AssetManager aM = null;
           InputStream stream = null; 
           try{
                 aM = getAssets();
                 InputStream is = aM.open("test.txt");
                 String txt=readStream(is); // read from res
                 is.close();
            }
            catch(Exception e){
            }finally{
            }