public static HashMap<String, Object> getAllBookmark(Context ctx) { keyList = new ArrayList<String>(); HashMap<String, Object> mBookmarkListData = new HashMap<String, Object>(); for (int j = 65; j <= 90; j++) { char c = (char) j; alphabet = Character.toString(c); Cursor cursor = ctx.getContentResolver() .query( Uri.parse( MoverContentProvider.CONTENT_URI + "/" + MoverContentProvider.PLAY_BOOKMARK_PATH), null, COLUMN_NAME_PLAY_NAME + " LIKE " + "'" + alphabet + "%" + "'", null, null); /// .query(MoverContentProvider.CONTENT_URI+"/"+MoverContentProvider.PLAY_PATH, null, null, // null, null); Log.v("in playdiao cursor", "" + cursor.getCount()); if (cursor != null && cursor.getCount() > 0) { playsList = new ArrayList<PlaysBean>(); setColumns(cursor); keyList.add(alphabet); for (int i = 0; i < cursor.getCount(); i++) { cursor.moveToPosition(i); PlaysBean plays = new PlaysBean(); plays.setPlayID(cursor.getString(COLUMN_INDEX_PLAY_ID)); plays.setPlayID(cursor.getString(COLUMN_INDEX_PLAY_ID1)); plays.setPlayName(cursor.getString(COLUMN_INDEX_PLAY_NAME)); plays.setPlayImage(cursor.getString(COLUMN_INDEX_PLAY_IMAGE)); plays.setPlayUrl(cursor.getString(COLUMN_INDEX_PLAY_URL)); plays.setPlayAuthors(cursor.getString(COLUMN_INDEX_PLAY_AUTHORS)); plays.setPlayVersion(cursor.getString(COLUMN_INDEX_PLAY_VERSION)); plays.setPlayVersionID(cursor.getString(COLUMN_INDEX_PLAY_VERSION_ID)); plays.setScrollPosition(cursor.getString(COLUMN_INDEX_PLAY_SCROLL_POSITION)); playsList.add(plays); } mBookmarkListData.put(alphabet, playsList); } cursor.close(); } return mBookmarkListData; }
public static ArrayList<PlaysBean> getFeaturedPlays(Context ctx) { ArrayList<PlaysBean> list = new ArrayList<PlaysBean>(); Cursor cursor = ctx.getContentResolver() .query( Uri.withAppendedPath( MoverContentProvider.CONTENT_URI, MoverContentProvider.PLAY_PATH), null, null, null, null); /// .query(MoverContentProvider.CONTENT_URI+"/"+MoverContentProvider.PLAY_PATH, null, null, // null, null); if (cursor != null && cursor.getCount() > 0) { setColumns(cursor); for (int i = 0; i < cursor.getCount(); i++) { cursor.moveToPosition(i); PlaysBean plays = new PlaysBean(); plays.setPlayID(cursor.getString(COLUMN_INDEX_PLAY_LONG_ID)); plays.setPlayName(cursor.getString(COLUMN_INDEX_PLAY_NAME)); plays.setPlayImage(cursor.getString(COLUMN_INDEX_PLAY_IMAGE)); plays.setPlayUrl(cursor.getString(COLUMN_INDEX_PLAY_URL)); plays.setPlayAuthors(cursor.getString(COLUMN_INDEX_PLAY_AUTHORS)); plays.setScrollPosition(cursor.getString(COLUMN_INDEX_PLAY_SCROLL_POSITION)); list.add(plays); } } cursor.close(); return list; }
public static ArrayList<PlaysBean> getAllVersionBookmark(Context ctx) { ArrayList<PlaysBean> list = new ArrayList<PlaysBean>(); Cursor cursor = ctx.getContentResolver() .query( Uri.parse( MoverContentProvider.CONTENT_URI + "/" + MoverContentProvider.PLAY_ALLBOOKMARK_PATH), null, null, null, null); if (cursor != null && cursor.getCount() > 0) { setColumns(cursor); for (int i = 0; i < cursor.getCount(); i++) { cursor.moveToPosition(i); PlaysBean plays = new PlaysBean(); plays.setPlayID(cursor.getString(COLUMN_INDEX_PLAY_ID)); plays.setPlayID(cursor.getString(COLUMN_INDEX_PLAY_ID1)); plays.setPlayName(cursor.getString(COLUMN_INDEX_PLAY_NAME)); plays.setPlayImage(cursor.getString(COLUMN_INDEX_PLAY_IMAGE)); plays.setPlayUrl(cursor.getString(COLUMN_INDEX_PLAY_URL)); plays.setPlayAuthors(cursor.getString(COLUMN_INDEX_PLAY_AUTHORS)); plays.setPlayVersion(cursor.getString(COLUMN_INDEX_PLAY_VERSION)); plays.setPlayVersionID(cursor.getString(COLUMN_INDEX_PLAY_VERSION_ID)); plays.setScrollPosition(cursor.getString(COLUMN_INDEX_PLAY_SCROLL_POSITION)); list.add(plays); } } cursor.close(); // } return list; }
public static ArrayList<PlaysBean> getAllSearchPlays(Context ctx, String search) { ArrayList<PlaysBean> list = new ArrayList<PlaysBean>(); alphabet = search.toString(); Cursor cursor = ctx.getContentResolver() .query( Uri.parse(MoverContentProvider.CONTENT_URI + "/" + MoverContentProvider.PLAY_PATH), null, COLUMN_NAME_PLAY_NAME + " LIKE ?", new String[] {"%" + alphabet + "%"}, null); /// .query(MoverContentProvider.CONTENT_URI+"/"+MoverContentProvider.PLAY_PATH, null, null, // null, null); Log.v("in playdiao cursor", "" + cursor.getCount()); if (cursor != null && cursor.getCount() > 0) { setColumns(cursor); for (int i = 0; i < cursor.getCount(); i++) { cursor.moveToPosition(i); PlaysBean plays = new PlaysBean(); // plays.setPlayID(cursor.getString(COLUMN_INDEX_PLAY_ID)); plays.setPlayID(cursor.getString(COLUMN_INDEX_PLAY_LONG_ID)); plays.setPlayName(cursor.getString(COLUMN_INDEX_PLAY_NAME)); plays.setPlayImage(cursor.getString(COLUMN_INDEX_PLAY_IMAGE)); plays.setPlayAuthors(cursor.getString(COLUMN_INDEX_PLAY_AUTHORS)); plays.setScrollPosition(cursor.getString(COLUMN_INDEX_PLAY_SCROLL_POSITION)); plays.setPlayUrl(cursor.getString(COLUMN_INDEX_PLAY_URL)); list.add(plays); } } cursor.close(); return list; }
public static ArrayList<PlaysBean> getBookmarkDetail(Context ctx, String VersionId) { ArrayList<PlaysBean> list = new ArrayList<PlaysBean>(); Cursor cursor = ctx.getContentResolver() .query( Uri.parse( MoverContentProvider.CONTENT_URI + "/" + MoverContentProvider.SET_BOOKMARK_PATH), null, VersionId, null, null); /// .query(MoverContentProvider.CONTENT_URI+"/"+MoverContentProvider.PLAY_PATH, null, null, // null, null); Log.v("in playdiao cursor", "" + cursor.getCount()); if (cursor != null && cursor.getCount() > 0) { setColumns(cursor); for (int i = 0; i < cursor.getCount(); i++) { cursor.moveToPosition(i); PlaysBean plays = new PlaysBean(); plays.setPlayID(cursor.getString(COLUMN_INDEX_PLAY_ID)); plays.setPlayName(cursor.getString(COLUMN_INDEX_PLAY_NAME)); plays.setPlayImage(cursor.getString(COLUMN_INDEX_PLAY_IMAGE)); plays.setPlayUrl(cursor.getString(COLUMN_INDEX_PLAY_URL)); plays.setPlayAuthors(cursor.getString(COLUMN_INDEX_PLAY_AUTHORS)); plays.setPlayVersion(cursor.getString(COLUMN_INDEX_PLAY_VERSION)); plays.setPlayVersionID(cursor.getString(COLUMN_INDEX_PLAY_VERSION_ID)); list.add(plays); } } cursor.close(); return list; }
public static ArrayList<PlaysBean> getPlayByID(Context ctx, String PlayId) { ArrayList<PlaysBean> list = new ArrayList<PlaysBean>(); System.out.println("CHECKING FOR PLAY BY ID " + PlayId); System.out.println(MoverContentProvider.CONTENT_URI + "/" + MoverContentProvider.PLAY_PATH); Uri uri = Uri.withAppendedPath(MoverContentProvider.CONTENT_URI, MoverContentProvider.PLAY_PATH); ContentResolver cr = ctx.getContentResolver(); Cursor cursor = cr.query(uri, null, COLUMN_NAME_PLAY_LONG_ID + "=\"" + PlayId + "\"", null, null); /// .query(MoverContentProvider.CONTENT_URI+"/"+MoverContentProvider.PLAY_PATH, null, null, // null, null); System.out.println("Howdy"); System.out.println("cursor: " + cursor.getCount()); if (cursor != null && cursor.getCount() > 0) { setColumns(cursor); for (int i = 0; i < cursor.getCount(); i++) { cursor.moveToPosition(i); PlaysBean plays = new PlaysBean(); // plays.setPlayID(cursor.getString(COLUMN_INDEX_PLAY_ID)); plays.setPlayID(cursor.getString(COLUMN_INDEX_PLAY_LONG_ID)); plays.setPlayName(cursor.getString(COLUMN_INDEX_PLAY_NAME)); plays.setPlayImage(cursor.getString(COLUMN_INDEX_PLAY_IMAGE)); plays.setPlayAuthors(cursor.getString(COLUMN_INDEX_PLAY_AUTHORS)); plays.setScrollPosition(cursor.getString(COLUMN_INDEX_PLAY_SCROLL_POSITION)); plays.setPlayUrl(cursor.getString(COLUMN_INDEX_PLAY_URL)); list.add(plays); } } cursor.close(); return list; }