]>
iEval git - fonbot.git/blob - src/ro/ieval/fonbot/GCMIntentService.java
1 package ro
.ieval
.fonbot
;
3 import org
.eclipse
.jdt
.annotation
.Nullable
;
5 import android
.content
.Context
;
6 import android
.content
.Intent
;
7 import android
.os
.Handler
;
8 import android
.os
.Looper
;
10 import com
.google
.android
.gcm
.GCMBaseIntentService
;
13 * Copyright © 2013 Marius Gavrilescu
15 * This file is part of FonBot.
17 * FonBot is free software: you can redistribute it and/or modify
18 * it under the terms of the GNU General Public License as published by
19 * the Free Software Foundation, either version 3 of the License, or
20 * (at your option) any later version.
22 * FonBot is distributed in the hope that it will be useful,
23 * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 * GNU General Public License for more details.
27 * You should have received a copy of the GNU General Public License
28 * along with FonBot. If not, see <http://www.gnu.org/licenses/>.
32 * Service that responds to GCM events
34 * @author Marius Gavrilescu <marius@ieval.ro>
36 public class GCMIntentService
extends GCMBaseIntentService
{
37 /** Handler instance */
38 private final Handler handler
=new Handler(Looper
.getMainLooper());
41 * Constructs a GCMIntentService with the iEval sender id
43 public GCMIntentService() {
44 super(FonBotApplication
.GCM_SENDER_ID
);
48 protected void onError(@Nullable final Context context
, @Nullable final String errID
) {
49 //TODO error handling here
53 protected void onMessage(@Nullable final Context context
, @Nullable final Intent intent
) {
57 handler
.post(new Runnable(){
60 new PollServerAsyncTask(context
).execute();
66 protected void onRegistered(@Nullable final Context context
, @Nullable final String regID
) {
71 protected void onUnregistered(@Nullable final Context context
, @Nullable final String regID
) {
This page took 0.050697 seconds and 5 git commands to generate.