Skip to content

Commit

Permalink
Changes merged
Browse files Browse the repository at this point in the history
  • Loading branch information
amitshekhariitbhu committed Nov 29, 2016
1 parent c5fd928 commit c30328f
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions debug-db/src/main/java/com/amitshekhar/server/ClientServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@

import android.content.Context;
import android.content.SharedPreferences;
import android.content.pm.LabeledIntent;
import android.content.res.AssetManager;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
Expand Down Expand Up @@ -374,17 +373,17 @@ private Response query(String sql) {

if (cursor.getCount() > 0) {
do {
List row = new ArrayList();
List<Object> row = new ArrayList<>();
for (int i = 0; i < cursor.getColumnCount(); i++) {
switch (cursor.getType(i)) {
case Cursor.FIELD_TYPE_BLOB:
row.add(cursor.getBlob(i));
break;
case Cursor.FIELD_TYPE_FLOAT:
row.add(Float.valueOf(cursor.getFloat(i)));
row.add(cursor.getFloat(i));
break;
case Cursor.FIELD_TYPE_INTEGER:
row.add(Integer.valueOf(cursor.getInt(i)));
row.add(cursor.getInt(i));
break;
case Cursor.FIELD_TYPE_STRING:
row.add(cursor.getString(i));
Expand All @@ -409,9 +408,9 @@ private Response query(String sql) {

public Response getDBList() {
Response response = new Response();
if (mDatabaseDir != null) {
if (mDatabaseDir != null && mDatabaseDir.list() != null) {
String[] list = mDatabaseDir.list();
if(list != null) {
if (list != null) {
Collections.addAll(response.rows, list);
}
}
Expand Down Expand Up @@ -462,4 +461,4 @@ public Response getAllPrefData(String tag) {
return response;
}

}
}

0 comments on commit c30328f

Please sign in to comment.