2012-03-25 168 views
1

我正在开发一个商店的Android应用程序,它提供了许多功能。其中一项功能是允许客户以某种标准搜索产品(价格,尺寸,类型......如图)。Sqlite高级搜索

我想我应该与SqliteDatabase一起工作,但我不知道如何使这个多标准搜索界面,所以用户可以查询数据库。

enter image description here

回答

0

之前处理它,你应该设计你的数据库。 假设, 表名单 -

1) product_type(_id<should be primary key to link another table>, 
    type_id<integer>, type_name<text> 
2) product_price(_id<should be primary key to link another table>, 
    type_id<integer>, price<double> 
3) product_type_size(_id<should be primary key to link another table>, type_id<integer>, size<text> 

而创建视图根据您的要求 - PRODUCT_SEARCH(加入你的表正确) 和运行查询的要求,与之相匹配的观点的价值。

继续 -