Android Open Source - iPhoroidUI-demo Item Dao






From Project

Back to project page iPhoroidUI-demo.

License

The source code is released under:

Apache License

If you think the Android project iPhoroidUI-demo listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

/*
 * Copyright (c) 2011 by KLab Inc., All rights reserved.
 */*from w w w  . j a  v  a  2s  .c o  m*/
 * Programmed by iphoroid team
 */

package org.klab.ui_demo.dao;

import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

import android.os.Environment;

import org.klab.ui_demo.model.Item;


/**
 * ItemDao.
 *
 * @author <a href="mailto:kodama-t@klab.jp">Takuya KODAMA</a> (kodamta-t)
 * @author <a href="mailto:sano-n@klab.jp">Naohide Sano</a> (sano-n)
 */
public class ItemDao {

    /** */
    protected ItemDao() {
    }

    /**
     * ?????????????
     */
    private static ItemDao instance = new ItemDao();

    /**
     * ????????????????????????
     */
    public static ItemDao getInstance() {
        return instance;
    }

    /**
     * ????????? PurchaseStatus ??????????????????????????????.
     */
    public List<Item> getImages() throws IOException {
        List<Item> result = new ArrayList<Item>();
        for (int i = 0; i < 99; i++) {
            result.add(newItem(i));
        }
        return result;
    }

    protected Item newItem(int id) throws IOException {
        Item item = new Item();
        item.setId(id);
        item.setTitle(titles[id]);
        item.setDate(dates[id]);
        item.setImageUrl(new File(String.format("%s/iphoroid/data1/gallery_img%02d.jpg", Environment.getExternalStorageDirectory(), id + 1)).toURL().toString());
        item.setThumbnailUrl(String.format("%s/iphoroid/data1/gallery_img%02d.jpg", Environment.getExternalStorageDirectory(), id + 1));
        return item;
    }

    private static final String[] titles = { 
        "?????",
        "2011?????",
        "???????????????",
        "??????",
        "???????????",
        "??????????2",
        "??????????????????????",
        "????????",
        "??????????????????????",
        "????????????",
        "????????????????????",
        "???????",
        "??????????????????????????",
        "?????????????",
        "????????????????????????",
        "???????????????????",
        "???????????????",
        "???????????????????",
        "?????????",
        "???????????????????",
        "??????????",
        "???????????",
        "?????????????????",
        "????????????????????????",
        "wallpaper1",
        "???????????????????",
        "beautiful sunrise",
        "wallpaper2",
        "wallpaper3",
        "wallpaper4",
        "???????????????????????",
        "????????????????????",
        "??????????????",
        "???????????????",
        "??????????",
        "?????????????????",
        "?????????????????????",
        "?????????",
        "?????????",
        "??????",
        "???????????",
        "???????????????",
        "??????????",
        "??????????????",
        "?????????????????",
        "?????????????",
        "???????",
        "??????????????????",
        "???????????????????",
        "???????????????????",
        "???????????????????????????",
        "?????????",
        "??????????????",
        "?????????????????????????",
        "????????????????????",
        "??????????????????????",
        "??????????????",
        "?????????????",
        "?????",
        "?????????????????",
        "??????????????????",
        "wallpaper5",
        "wallpaper6",
        "wallpaper7",
        "??????????????",
        "?????????",
        "???????????????????",
        "?????????????",
        "???????????????????",
        "????????????",
        "???????",
        "?????????????????",
        "??????????????????????",
        "???????????????????",
        "?????",
        "????????????????",
        "?????????????",
        "?????????????????????",
        "??????????????",
        "?????????????????",
        "?????????????????2",
        "????????????",
        "??????????????????",
        "???????????????????",
        "????????????????",
        "?????????????",
        "????????????????????????????",
        "???????????????",
        "?????????????????????",
        "?????????????????",
        "????????????",
        "????????????",
        "???????????????",
        "???????????????????????",
        "?????????????????",
        "??????????",
        "water ring",
        "?????????",
        "?????????????????",
        "?????????????"
    };

    private static final String[] dates = {
        "2012/1/1",
        "2012/1/2",
        "2012/1/3",
        "2012/1/4",
        "2012/1/5",
        "2012/1/6",
        "2012/1/7",
        "2012/1/8",
        "2012/1/9",
        "2012/1/10",
        "2012/1/11",
        "2012/1/12",
        "2012/1/13",
        "2012/1/14",
        "2012/1/15",
        "2012/1/16",
        "2012/1/17",
        "2012/1/18",
        "2012/1/19",
        "2012/1/20",
        "2012/1/21",
        "2012/1/22",
        "2012/1/23",
        "2012/1/24",
        "2012/1/25",
        "2012/1/26",
        "2012/1/27",
        "2012/1/28",
        "2012/1/29",
        "2012/1/30",
        "2012/1/31",
        "2012/2/1",
        "2012/2/2",
        "2012/2/3",
        "2012/2/4",
        "2012/2/5",
        "2012/2/6",
        "2012/2/7",
        "2012/2/8",
        "2012/2/9",
        "2012/2/10",
        "2012/2/11",
        "2012/2/12",
        "2012/2/13",
        "2012/2/14",
        "2012/2/15",
        "2012/2/16",
        "2012/2/17",
        "2012/2/18",
        "2012/2/19",
        "2012/2/20",
        "2012/2/21",
        "2012/2/22",
        "2012/2/23",
        "2012/2/24",
        "2012/2/25",
        "2012/2/26",
        "2012/2/27",
        "2012/2/28",
        "2012/2/29",
        "2012/3/1",
        "2012/3/2",
        "2012/3/3",
        "2012/3/4",
        "2012/3/5",
        "2012/3/6",
        "2012/3/7",
        "2012/3/8",
        "2012/3/9",
        "2012/3/10",
        "2012/3/11",
        "2012/3/12",
        "2012/3/13",
        "2012/3/14",
        "2012/3/15",
        "2012/3/16",
        "2012/3/17",
        "2012/3/18",
        "2012/3/19",
        "2012/3/20",
        "2012/3/21",
        "2012/3/22",
        "2012/3/23",
        "2012/3/24",
        "2012/3/25",
        "2012/3/26",
        "2012/3/27",
        "2012/3/28",
        "2012/3/29",
        "2012/3/30",
        "2012/3/31",
        "2012/4/1",
        "2012/4/2",
        "2012/4/3",
        "2012/4/4",
        "2012/4/5",
        "2012/4/6",
        "2012/4/7",
        "2012/4/8",
        "2012/4/9"
    };
}

/* */




Java Source Code List

org.klab.ui_demo.CoverFlowImageAdapter.java
org.klab.ui_demo.FlowViewAndCoverFlowActivity.java
org.klab.ui_demo.FlowViewItemAdapter.java
org.klab.ui_demo.GridViewActivity.java
org.klab.ui_demo.GridViewItemAdapter.java
org.klab.ui_demo.ListViewActivity.java
org.klab.ui_demo.ListViewItemAdapter.java
org.klab.ui_demo.OptionsMenuUtil.java
org.klab.ui_demo.dao.ItemDao.java
org.klab.ui_demo.dao.ListViewItemDao.java
org.klab.ui_demo.model.Item.java
org.klab.ui_demo.net.HTTPClient.java