Search in sources :

Example 6 with Service

use of cl.smartcities.isci.transportinspector.backend.Service in project androidApp by InspectorIncognito.

the class ServiceHelper method getServiceSuggestionsById.

public List<Service> getServiceSuggestionsById(String service) {
    String query = "SELECT * FROM " + DataBaseContract.Service.TABLE_NAME + " WHERE " + DataBaseContract.Service.CODE + " LIKE ? LIMIT 10";
    String[] params = new String[] { service + "%" };
    Cursor cursor = this.getReadableDatabase().rawQuery(query, params);
    List<Service> busList = getServicesFromCursor(cursor);
    cursor.close();
    return busList;
}
Also used : Service(cl.smartcities.isci.transportinspector.backend.Service) Cursor(android.database.Cursor)

Aggregations

Service (cl.smartcities.isci.transportinspector.backend.Service)6 Cursor (android.database.Cursor)3 ServiceHelper (cl.smartcities.isci.transportinspector.database.ServiceHelper)2 ArrayList (java.util.ArrayList)2 BusStop (cl.smartcities.isci.transportinspector.backend.BusStop)1 BusStopHelper (cl.smartcities.isci.transportinspector.database.BusStopHelper)1 OnBusService (cl.smartcities.isci.transportinspector.onBusService.OnBusService)1