当前位置: 首页 > news >正文

商城网站开发技术怎么删掉安装的wordpress

商城网站开发技术,怎么删掉安装的wordpress,网站更新服务公司,文化网站模板实训9 数据存储和访问 一、【实训目的】 1、 SharedPreferences存储数据; 2、 借助Java的I/O体系实现文件的存储#xff0c; 3、使用Android内置的轻量级数据库SQLite存储数据; 二、【实训内容】 1、实现下图所示的界面#xff0c;实现以下功能#xff1a; 1#xff…实训9  数据存储和访问 一、【实训目的】 1、 SharedPreferences存储数据; 2、 借助Java的I/O体系实现文件的存储 3、使用Android内置的轻量级数据库SQLite存储数据; 二、【实训内容】 1、实现下图所示的界面实现以下功能 1用SharedPreferences类当点击”写入xml文件”按钮, 把“输入你想写入内容”控件中的数据写入到login.xml文件中 2用SharedPreferences类当点击”读取内容”按钮, 把login.xml文件中的数据读到到一个TextView中,并显示内容 具体步骤 MainActivity源文件 package com.example.hahah;import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.PrintStream;import android.os.Bundle; import android.app.Activity; import android.content.Context; import android.view.Menu; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.EditText;public class MainActivity extends Activity {private Button write, read;private EditText writeText, readText;private String fileName context.txt;Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.activity_main);write (Button) findViewById(R.id.btnwritexml);read (Button) findViewById(R.id.btnreadxml);writeText (EditText) findViewById(R.id.writecontent);readText (EditText) findViewById(R.id.readcontent);write.setOnClickListener(new OnClickListener() {public void onClick(View arg0) {write(writeText.getText().toString());}});read.setOnClickListener(new OnClickListener() {public void onClick(View arg0) {readText.setText(read());}});}public String read() {StringBuilder sbBuilder new StringBuilder();byte[] buffer new byte[64];int hasRead;try {FileInputStream fis openFileInput(fileName);while ((hasRead fis.read(buffer)) ! -1) {sbBuilder.append(new String(buffer, 0, hasRead));}} catch (FileNotFoundException e) {// TODO Auto-generated catch blocke.printStackTrace();} catch (IOException e) {// TODO Auto-generated catch blocke.printStackTrace();}return sbBuilder.toString();}public void write(String str) {try {FileOutputStream fos openFileOutput(fileName, Context.MODE_APPEND);PrintStream ps new PrintStream(fos);ps.print(str);ps.close();try {fos.close();} catch (IOException e) {// TODO Auto-generated catch blocke.printStackTrace();}} catch (FileNotFoundException ex) {ex.printStackTrace();}}Overridepublic boolean onCreateOptionsMenu(Menu menu) {// Inflate the menu; this adds items to the action bar if it is present.getMenuInflater().inflate(R.menu.main, menu);return true;}} Activity_main源代码 TableLayout xmlns:androidhttp://schemas.android.com/apk/res/androidandroid:layout_widthfill_parentandroid:layout_heightfill_parentandroid:orientationvertical android:stretchColumns2TableRowEditTextandroid:idid/writecontentandroid:layout_width0dp android:layout_heightwrap_contentandroid:layout_weight1.0 android:hint输入你想写入的内容 //TableRowTableRow Buttonandroid:idid/btnwritexmlandroid:layout_widthwrap_contentandroid:layout_heightwrap_contentandroid:layout_column0 android:text写入xml文件 //TableRowTableRowEditTextandroid:idid/readcontentandroid:layout_width0dp android:layout_heightwrap_content//TableRowTableRow Buttonandroid:idid/btnreadxmlandroid:layout_widthwrap_contentandroid:layout_heightwrap_contentandroid:layout_column0 android:text读取内容 //TableRowTableRow Buttonandroid:idid/btnwritetxtandroid:layout_widthwrap_contentandroid:layout_heightwrap_contentandroid:layout_column0 android:text写入login.txt文件 //TableRowTableRow Buttonandroid:idid/btnwritesqlandroid:layout_widthwrap_contentandroid:layout_heightwrap_contentandroid:layout_column0 android:text写入数据库 //TableRow /TableLayout 运行结果截图 附注该专栏是博主上学时的实训项目可供访客练习与参考。代码质量不是很好但能实现仅供参考
http://www.w-s-a.com/news/396576/

相关文章:

  • 为什么学网站开发凡科登陆
  • 设计师常备设计网站大全中山精品网站建设信息
  • 杭州建设工程网seo服务是什么
  • 兼职做问卷调查的网站wordpress mysql设置
  • 怎么在百度上能搜到自己的网站山西seo谷歌关键词优化工具
  • 网站搭建免费模板飞鱼crm下载
  • 网站开发竞品分析app制作公司深圳
  • 网站建设ssc源码修复设计班级网站建设
  • 网站重定向凡科做网站不要钱
  • 佛山html5网站建设微信营销软件破解版
  • 网站单页做301南京百度推广
  • 私人做网站要多少钱展芒设计网页
  • 怎样网站制作设计如何在网上推广农产品
  • 做关键词排名卖网站聚名网
  • 吉林省住房城乡建设厅网站首页体育器材网站建设方案
  • 网站建设及维护专业手机金融界网站
  • 常州网站建设工作室建立网站有怎么用途
  • 如何盗取网站推广策划书模板
  • 游戏网站建设计划书网络开发需要学什么
  • 手机网站维护费网站开发包括网站过程
  • 懂做游戏钓鱼网站的网站建设技术的发展
  • 网站被百度收录百度一下你就知道 官网
  • 雅客网站建设做网站用什么做
  • 做宣传海报网站专业网站设计速寻亿企邦
  • 秦皇岛市住房和城乡建设局网站有关网站开发的参考文献
  • 晋城城乡建设局网站深圳外贸业务员工资
  • 招聘网站开发的公司销售运营主要做什么
  • 徐州网站无障碍建设wordpress证书
  • c语言可以做网站吗请人做网站收费多少
  • 中英双语网站怎么做网站为什么做静态