文件的读写操作
16lz
2021-12-04
推荐安卓开发神器(里面有各种UI特效和android代码库实例)
1.在android下创建一个android.txt 文件
FileOutputStream fos = this.openFileOutput("android.txt",MODE_APPEND); String str="1234"; byte [] temp = str.getBytes(); fos.write("".getByte()); fos.flush(); fos.close();
.........................
2:在android下读取上面创建的文件
FileInputStream fis = this.openFileInput("android.txt");// 读取android资源下的文件 必须在res下建一个raw文件夹 放入一个文件 android.txt InputStream is = getResource().openRawResource(R.raw.android);
更多相关文章
- NPM 和webpack 的基础使用
- 【阿里云镜像】使用阿里巴巴DNS镜像源——DNS配置教程
- cocos2d-x tutorials: Start with Android
- Android中自定义水平的ProgressBar
- android6.0创建文件问题
- Android(安卓)MAT
- Android(安卓)studio 不能预览布局文件
- android 获取网络资源
- Android(安卓)Studio开发Android(一)——build.gradle文件详解