Android query feature before adding to database

已完成 已发布的 May 30, 2013 货到付款
已完成

Project Description:

I have a QR List Adapter where I add values (qr code and youtube id) to database:

public void add(String qrcode, String ytid){

ContentValues values = new ContentValues();

[url removed, login to view]([url removed, login to view], qrcode);

[url removed, login to view](DatabaseHelper.YT_ID, ytid);

[url removed, login to view]().insert(YouListContentProvider.CONTENT_URI, values);

QRItem item = new QRItem([url removed, login to view], qrcode, ytid);

[url removed, login to view]().add(item);

notifyDataSetChanged();

}

I want to be able to search the database beforehand and if the values (QRCODE and youtube ID) already exists (the video is already in the database) then not to add them to the list. My database helper looks like this:

@Override

public void onCreate(SQLiteDatabase db) {

[url removed, login to view]("CREATE TABLE " + TABLE_NAME + "("

+ID+" INTEGER PRIMARY KEY, "

+QRCODE+" TEXT, "

+YT_ID+" TEXT )");

PutValues(db);

}

It's a small project and I would like it to be done asap.

安卓

项目ID: #4574212

关于项目

1个方案 远程项目 活跃的May 30, 2013

授予:

NhatAnhIT

It's done ! I do it for you now

$11 USD / 小时
(3条评论)
2.3