Search in sources :

Example 21 with MediaEntity

use of com.ushahidi.android.app.entities.MediaEntity in project Ushahidi_Android by ushahidi.

the class MediaDao method addMedia.

/*
	 * (non-Javadoc)
	 * 
	 * @see com.ushahidi.android.app.database.IMediaDao#addMedia(java.util.List)
	 */
@Override
public boolean addMedia(List<MediaEntity> sMedia) {
    try {
        mDb.beginTransaction();
        for (MediaEntity media : sMedia) {
            addMedia(media);
        }
        mDb.setTransactionSuccessful();
    } finally {
        mDb.endTransaction();
    }
    return true;
}
Also used : MediaEntity(com.ushahidi.android.app.entities.MediaEntity)

Example 22 with MediaEntity

use of com.ushahidi.android.app.entities.MediaEntity in project Ushahidi_Android by ushahidi.

the class MediaDao method fetchCheckinPhoto.

@Override
public List<MediaEntity> fetchCheckinPhoto(int checkinId) {
    listMedia = new ArrayList<MediaEntity>();
    final String[] selectionArgs = { String.valueOf(checkinId), String.valueOf(IMAGE) };
    final String selection = CHECKIN_ID + " =? AND " + TYPE + " =?";
    cursor = super.query(TABLE, MEDIA_COLUMNS, selection, selectionArgs, null);
    if (cursor != null) {
        cursor.moveToFirst();
        while (!cursor.isAfterLast()) {
            MediaEntity media = cursorToEntity(cursor);
            listMedia.add(media);
            cursor.moveToNext();
        }
        cursor.close();
    }
    return listMedia;
}
Also used : MediaEntity(com.ushahidi.android.app.entities.MediaEntity)

Aggregations

MediaEntity (com.ushahidi.android.app.entities.MediaEntity)22 PhotoEntity (com.ushahidi.android.app.entities.PhotoEntity)6 ReportCategory (com.ushahidi.android.app.entities.ReportCategory)3 File (java.io.File)2 View (android.view.View)1 AdapterView (android.widget.AdapterView)1 ImageView (android.widget.ImageView)1 ListView (android.widget.ListView)1 ReportEntity (com.ushahidi.android.app.entities.ReportEntity)1 AddReportView (com.ushahidi.android.app.views.AddReportView)1 ArrayList (java.util.ArrayList)1