improve station and ssid fetching

storage_ts_index
Georg Lukas 2011-03-27 00:53:36 +01:00
rodzic e6b2391095
commit 3973c54aaf
1 zmienionych plików z 9 dodań i 1 usunięć

Wyświetl plik

@ -194,7 +194,7 @@ class StorageDatabase(context : Context) extends
def getAllSsids(call : String) : Cursor = {
val querycall = call.split("[- _]+")(0) + "%"
getReadableDatabase().query(Position.TABLE, Position.COLUMNS,
"call LIKE ?", Array(querycall),
"call LIKE ? or origin LIKE ?", Array(querycall, querycall),
"call", null, null, null)
}
def getNeighbors(mycall : String, lat : Int, lon : Int, ts : Long, limit : String) : Cursor = {
@ -237,6 +237,14 @@ class StorageDatabase(context : Context) extends
def getPosts() : Cursor = getPosts(null)
def getStaPosts(call : String, limit : String) : Cursor = {
val start = "%s%%".format(call) // match for call-originated messages
val obj1 = "%%;%s%%".format(call) // ;call - object
val obj2 = "%%)%s%%".format(call) // )call - item
getPosts("message LIKE ? OR message LIKE ? OR message LIKE ?",
Array(start, obj1, obj2), "100")
}
def getSinglePost(sel : String, selArgs : Array[String]) : (Long, String, String) = {
val c = getPosts(sel, selArgs, "1")
c.moveToFirst()