第7章数据存储.ppt

第7章数据存储

利用IO流操作文件 范例:利用IO流进行文件的输入操作 利用IO流操作文件 范例:配置activity_main.xml文件,定义组件,显示gameinfo.txt文件内容 LinearLayout xmlns:android=/apk/res/android android:orientation=vertical ?所有组件垂直摆放 android:layout_width=fill_parent ?此布局管理器宽度为屏幕宽度 android:layout_height=fill_parent?此布局管理器高度为屏幕高度 TextView ?文本显示组件 android:id=@+id/msg ?组件ID,程序中使用 android:textSize=22px ?组件显示文字 android:textColor=#FFFFFF ?组件文字颜色 android:layout_width=fill_parent ?组件宽度为屏幕宽度 android:layout_height=wrap_content /?组件高度为文字高度 /LinearLayout 利用IO流操作文件 范例:定义Activity程序,读取文件内容 读取资源文件 在Android操作系统之中,也可以进行一些资源文件的读取,这些资源文件的ID都会自动的通过R.jav

文档评论(0)

1亿VIP精品文档

相关文档