android 记事本demo_Android实现记事本功能

本文实例为大家分享了Android实现记事本功能的具体代码,供大家参考,具体内容如下

实现功能

1、文本数据的存储

2、图片数据存储

3、视频数据存储

4、自定义的Adapter

5、SQlite的创建

6、数据listview列表的显示

demo地址

界面布局

xmlns:tools="http://schemas.android.com/tools"

android:layout_width="match_parent"

android:layout_height="match_parent"

android:orientation="vertical" >

android:layout_width="fill_parent"

android:layout_height="wrap_content"

android:orientation="horizontal" >

android:id="@+id/text"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:layout_weight="1"

android:text="文字" />

android:id="@+id/img"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:layout_weight="1"

android:text="图文" />

android:id="@+id/video"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:layout_weight="1"

android:text="视频" />

android:id="@+id/list"

android:layout_width="fill_parent"

android:layout_height="wrap_content" >

数据库创建

public class NotesDB extends SQLiteOpenHelper {

public static final String TABLE_NAME = "notes";

public static final String CONTENT = "content";

public static final String PATH = "path";

public static final String VIDEO = "video";

public static final String ID = "_id";

public static final String TIME = "time";

public NotesDB(Context context) {

super(context, "notes", null, 1);

}

@Override

public void onCreate(SQLiteDatabase db) {

db.execSQL("CREATE TABLE " + TABLE_NAME + " (" + ID

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值