现在一个app需要获得系统权限,就是说要加上android.uid.system,同时想能读写sdcard卡,该如何实现呢!?sdcard读写

解决方案 »

  1.   

    写入SD卡:File f = new File(android.os.Environment.getExternalStorageDirectory()+"/test.txt");
    String str="this is a test about Write SD card file";
    fileOS.write(str.getBytes());
    就可以了,不需要加上android.uid.system,如果加了这个,就肯定是没有权限读写的。 写入方法:
    FileOutputStream fileOS=new FileOutputStream(f);
    fileOS.close();
    d---rwxrwx system system 2010-07-28 11:11 sdcard
    BufferedWriter buf = new BufferedWriter (new OutputStreamWriter(fileOS));
    buf.write(str,0,str.length());
    buf.flush();
    buf.close();
      

  2.   

    问题是一定要这个android.uid.system,还是谢谢你,我已经解决了。