@@ -181,4 +181,63 @@ public class DBService {
|
||
| 181 | 181 |
return sessionBeanArrayList; |
| 182 | 182 |
} |
| 183 | 183 |
|
| 184 |
+ public ArrayList<PhotoBean> getPhotoListBySessionId(String sessionId){
|
|
| 185 |
+ SQLiteDatabase db = null; |
|
| 186 |
+ Cursor c = null; |
|
| 187 |
+ ArrayList<PhotoBean> photoList = new ArrayList<>(); |
|
| 188 |
+ |
|
| 189 |
+ synchronized (DB_LOCK) {
|
|
| 190 |
+ try {
|
|
| 191 |
+ db = dbHelper.getReadableDatabase(); |
|
| 192 |
+ db.beginTransaction(); |
|
| 193 |
+ c = db.rawQuery("select * from " + DBHelper.PHOTO_INFO_TABLE + " where "
|
|
| 194 |
+ + DBHelper.PHOTO_INFO_COLUMNS.SESSION_ID + " = '" + sessionId + "'", null); |
|
| 195 |
+ while (c.moveToNext()) {
|
|
| 196 |
+ photoList.add(cursor2PhotoBean(c)); |
|
| 197 |
+ } |
|
| 198 |
+ db.setTransactionSuccessful(); |
|
| 199 |
+ } catch (Exception e) {
|
|
| 200 |
+ LogHelper.d(TAG, "dbservice getGroupInfoByGroupId error happen " + e); |
|
| 201 |
+ } finally {
|
|
| 202 |
+ try {
|
|
| 203 |
+ db.endTransaction(); |
|
| 204 |
+ } catch (Exception e) {
|
|
| 205 |
+ e.printStackTrace(); |
|
| 206 |
+ } |
|
| 207 |
+ closeCursorAndDB(c, db); |
|
| 208 |
+ } |
|
| 209 |
+ } |
|
| 210 |
+ return photoList; |
|
| 211 |
+ } |
|
| 212 |
+ |
|
| 213 |
+ public PhotoBean getNextUploadPhoto(){
|
|
| 214 |
+ LogHelper.d(TAG, "dbservice getNextUploadPhotoBean "); |
|
| 215 |
+ PhotoBean photoBean = null; |
|
| 216 |
+ SQLiteDatabase db = null; |
|
| 217 |
+ Cursor c = null; |
|
| 218 |
+ synchronized (DB_LOCK) {
|
|
| 219 |
+ try {
|
|
| 220 |
+ db = dbHelper.getReadableDatabase(); |
|
| 221 |
+ db.beginTransaction(); |
|
| 222 |
+ c = db.rawQuery("select * from " + DBHelper.PHOTO_INFO_TABLE + " where "
|
|
| 223 |
+ + DBHelper.PHOTO_INFO_COLUMNS.IS_UPLOADED + " = '" + 0 + "'"+" order by " |
|
| 224 |
+ + DBHelper.PHOTO_INFO_COLUMNS.CAPTURE_TIME + " desc limit 1 ", null); |
|
| 225 |
+ if (c.moveToNext()) {
|
|
| 226 |
+ photoBean = cursor2PhotoBean(c); |
|
| 227 |
+ } |
|
| 228 |
+ db.setTransactionSuccessful(); |
|
| 229 |
+ } catch (Exception e) {
|
|
| 230 |
+ LogHelper.d(TAG, "dbservice getNextUploadPhotoBean error happen " + e); |
|
| 231 |
+ } finally {
|
|
| 232 |
+ try {
|
|
| 233 |
+ db.endTransaction(); |
|
| 234 |
+ } catch (Exception e) {
|
|
| 235 |
+ e.printStackTrace(); |
|
| 236 |
+ } |
|
| 237 |
+ closeCursorAndDB(c, db); |
|
| 238 |
+ } |
|
| 239 |
+ } |
|
| 240 |
+ return photoBean; |
|
| 241 |
+ } |
|
| 242 |
+ |
|
| 184 | 243 |
} |
@@ -80,7 +80,7 @@ public class UploadActivity extends BaseActivity implements UploadContract.Uploa |
||
| 80 | 80 |
@Override |
| 81 | 81 |
public void run() {
|
| 82 | 82 |
btStatusTextView.setText(R.string.bt_disconnected); |
| 83 |
- btStatusImageView.setImageResource(R.drawable.bluetooth_disconnect); |
|
| 83 |
+ btStatusImageView.setImageResource(R.drawable.wifi_disconnect); |
|
| 84 | 84 |
} |
| 85 | 85 |
}); |
| 86 | 86 |
|
@@ -92,7 +92,7 @@ public class UploadActivity extends BaseActivity implements UploadContract.Uploa |
||
| 92 | 92 |
@Override |
| 93 | 93 |
public void run() {
|
| 94 | 94 |
btStatusTextView.setText(R.string.bt_connected); |
| 95 |
- btStatusImageView.setImageResource(R.drawable.bluetooth_connected); |
|
| 95 |
+ btStatusImageView.setImageResource(R.drawable.wifi_connect); |
|
| 96 | 96 |
} |
| 97 | 97 |
}); |
| 98 | 98 |
} |
@@ -80,7 +80,7 @@ |
||
| 80 | 80 |
android:layout_height="24dp" |
| 81 | 81 |
android:layout_centerHorizontal="true" |
| 82 | 82 |
android:layout_marginTop="6dp" |
| 83 |
- android:src="@drawable/bluetooth_connected" /> |
|
| 83 |
+ android:src="@drawable/wifi_connect" /> |
|
| 84 | 84 |
|
| 85 | 85 |
<TextView |
| 86 | 86 |
android:id="@+id/tv_bt_status" |