【IT168 技术】环境:1.系统:window7
2.Android版本:2.2
3.eclipse3.5.2(伽利略)
一、基本的流程图(写入文件)

▲
二、模拟器运行界面
1.主界面

▲
2.保存(不符合条件)

▲
3.正常保存

▲
4.读取文件

▲
5.关于编者

▲
三、代码如下:
1.保存文件的主要代码
保存的主代码
1 bSave.setOnClickListener(new View.OnClickListener() { 2 3 @Override 4 public void onClick(View v) { 5 // TODO Auto-generated method stub 6 resId=R.string.success; 7 file_name=filename.getText().toString(); 8 file_content=filecontent.getText().toString(); 9 /* openFileOutput API10 * FileOutputStream openFileOutput (String name, int mode)11 * Open a private file associated with this Context's application package for writing. Creates the file if it doesn't already exist.12 */13 /* Context四种模式的API14 * Context.MODE_APPEND -->if the file already exists then write data to the end of the existing file instead of erasing it.15 * Context.MODE_PRIVATE -->the default mode, where the created file can only be accessed by the calling application (or all applications sharing the same user ID). 16 * Context.MODE_WORLD_READABLE -->allow all other applications to have read access to the created file.17 *