android implement database checker method in Service
<p>how can I implement the following method in Service , I want it to work every 1 min
(the code is check day hour mint if corresponding to current time do some thing  ) I saw many questions
but not useful ,help please . Thank you </p>

<p>{String[] columns = new String[] { KEY_ROWID, KEY_chNAME, KEY_prNAME,
                KEY_Rerun, KEY_HOUR, KEY_MINUTE, KEY_SUN, KEY_MON, KEY_TUE,
                KEY_WED, KEY_THU, KEY_FRI, KEY_SAT };
        Cursor c = ourdatabase.query(DATABASE_TABLE, columns, null, null, null,null, null);
        String result = "";</p>

<pre><code>    Calendar cl = Calendar.getInstance();
    int today = cl.get(Calendar.DAY_OF_WEEK);

    // String mStr="";
    // mStr=mStr.concat("&lt;body&gt;");
    // mStr=mStr.concat("&lt;table border='1' &gt;&lt;tr&gt; &lt;th style='width:5px&gt;&lt;/th&gt;&lt;td align='center'&gt;&lt;b&gt; Channal  &lt;/b&gt;&lt;/td&gt;&lt;td align='center'&gt;&lt;b&gt;  Program  &lt;/b&gt;&lt;/td&gt;&lt;td align='center'&gt;&lt;b&gt;  Time  &lt;/b&gt;&lt;/tr&gt;");
    int iRow = c.getColumnIndex(KEY_ROWID);
    int iCh = c.getColumnIndex(KEY_chNAME);
    int ipr = c.getColumnIndex(KEY_prNAME);
    int iHr = c.getColumnIndex(KEY_HOUR);
    int iMin = c.getColumnIndex(KEY_MINUTE);
    int iRerun = c.getColumnIndex(KEY_Rerun);
    int iSun = c.getColumnIndex(KEY_SUN);
    int iMon = c.getColumnIndex(KEY_MON);
    int iTue = c.getColumnIndex(KEY_TUE);
    int iWed = c.getColumnIndex(KEY_WED);
    int iThu = c.getColumnIndex(KEY_THU);
    int iFri = c.getColumnIndex(KEY_FRI);
    int iSat = c.getColumnIndex(KEY_SAT);

    DecimalFormat twoDigits = new DecimalFormat( "00" );

    for (c.moveToFirst(); !c.isAfterLast(); c.moveToNext()) {
        if (today == Integer.parseInt(c.getString(iSun))) {
            result += c.getString(iRow) + " - " + c.getString(iCh) + "\t  "
                    + c.getString(ipr) + "\t " + c.getString(iHr) + ":"
                    + twoDigits.format(Integer.parseInt(c.getString(iMin))) + "  " + c.getString(iRerun) + "\n";
        }

        else if (today == Integer.parseInt(c.getString(iMon))) {

            //int mm=Integer.parseInt( twoDigits.format(Integer.parseInt(c.getString(iMin))));

            result += c.getString(iRow) + " - " + c.getString(iCh) + "\t  "
                    + c.getString(ipr) + "\t " + c.getString(iHr) + ":"
                    + twoDigits.format(Integer.parseInt(c.getString(iMin))) + "  " + c.getString(iRerun) + "\n";
        }

        else if (today == Integer.parseInt(c.getString(iTue))) {
            result += c.getString(iRow) + " - " + c.getString(iCh) + "\t  "
                    + c.getString(ipr) + "\t " + c.getString(iHr) + ":"
                    + twoDigits.format(Integer.parseInt(c.getString(iMin)))+ "  " + c.getString(iRerun) + "\n";
        }

        else if (today == Integer.parseInt(c.getString(iWed))) {
            result += c.getString(iRow) + " - " + c.getString(iCh) + "\t  "
                    + c.getString(ipr) + "\t " + c.getString(iHr) + ":"
                    + twoDigits.format(Integer.parseInt(c.getString(iMin))) + "  " + c.getString(iRerun) + "\n";
        }

        else if (today == Integer.parseInt(c.getString(iThu))) {
            result += c.getString(iRow) + " - " + c.getString(iCh) + "\t  "
                    + c.getString(ipr) + "\t " + c.getString(iHr) + ":"
                    + twoDigits.format(Integer.parseInt(c.getString(iMin))) + "  " + c.getString(iRerun) + "\n";
        }

        else if (today == Integer.parseInt(c.getString(iFri))) {
            result += c.getString(iRow) + " - " + c.getString(iCh) + "\t  "
                    + c.getString(ipr) + "\t " + c.getString(iHr) + ":"
                    + twoDigits.format(Integer.parseInt(c.getString(iMin))) + "  " + c.getString(iRerun) + "\n";
        }

        else if (today == Integer.parseInt(c.getString(iSat))) {
            result += c.getString(iRow) + " - " + c.getString(iCh) + "\t  "
                    + c.getString(ipr) + "\t " + c.getString(iHr) + ":"
                    +twoDigits.format(Integer.parseInt(c.getString(iMin))) + "  " + c.getString(iRerun) + "\n";
        }
    }
    c.close(); }
</code></pre>
