创建通知

时间:2013-12-04 07:51:49

标签: php

我想在android中创建通知和警报。我知道我的PHP正在运行,但我是android编程的初学者。我无法编写通知代码。请帮帮我一些例子。连接可能是json但我不确切知道。

这是我的PHP。

class notification
{

                //database error
                sendResponse(400, "Invalid Request");
                return false;
            }
            //unicode data in database
            mysql_set_charset("utf8");
            //select data on schedule and member_status 
            $query = "     SELECT s.c_team_id";
            $query .= "          , s.dt_start_time ";
            $query .= "          , DATE_FORMAT(s.t_alert, '%Y-%m-%d %H:%i')as alert ";
            $query .= "          , CASE TIMEDIFF(DATE_FORMAT(s.dt_start_time, '%Y-%m-%d %H:%i'), DATE_FORMAT(s.t_alert, '%Y-%m-%d %H:%i'))";

            $query .= "        AND s.t_alert >= CURRENT_TIMESTAMP() ";
            $query .= "        AND (DATE_ADD(CURDATE() , INTERVAL 7 DAY)) ";
            $query.= "    ORDER BY s.t_alert";
            $query .= "      LIMIT 64 ";
            $result = mysql_query($query);

            $totalRowsCount = mysql_num_rows($result);

            if($totalRowsCount == 0)
            { 
                sendResponse(400, 'Record Not Found'); 
                return false;
            }
            else
            {
             e"] == "" ) ? "" : $row2["beforeMatchTime"]
                    );  
                    $parameter['notifications'][] = $data;
                }

    }
}
//create object
$notification = new notification;
//call method
$notification -> scheduleNotification();
?>

1 个答案:

答案 0 :(得分:0)

您正在寻找Google Cloud Messaging。查看实施client方面的信息,并查看以下php example