i am new to android apps development. what is push notification in android apps development and how to implement this?
what is push notification in android apps development? how to implement this?
Collapse
X
-
Using push notifications basically means that the users device will somehow receive messages from a server which will result in a notification in the status bar - even if the app is not running itself. There are basically two ways of achieving this:- Via SMS (text message). Here you will have to intercept the SMS and react to it in your app.
- Via a pulling service such as Google Cloud Messaging for Android. There are other similar services too (e.g. Urban Airship, PushWoosh, Deacon and Xtify) and they all have tutorials on their sites. So basically, decide which one you want to use and start with the tutorial to go with it.
-
There are step by step instructions on the Getting Started with GCM site. Did you follow all of those steps? If you can't resolve GCM to a type, you may not have installed the Google Cloud Messaging for Android Library in the SDK Manager (under Extras). Also make sure, that everything that sounds reasonable in that list is installed.Comment
-
i have installed Google Cloud Messaging for Android Library and Google Play services. but still i'am getting that error.
getting error in this lineCode:public static final String EXTRA_MESSAGE = "message"; public static final String PROPERTY_REG_ID = "registration_id"; private static final String PROPERTY_APP_VERSION = "appVersion"; private static final String PROPERTY_ON_SERVER_EXPIRATION_TIME = "onServerExpirationTimeMs"; public static final long REGISTRATION_EXPIRY_TIME_MS = 1000 * 3600 * 24 * 7; String SENDER_ID = "40824748037"; static final String TAG = "GCMDemo"; TextView mDisplay; GoogleCloudMessaging gcm; AtomicInteger msgId = new AtomicInteger(); SharedPreferences prefs; Context context;
Error: GoogleCloudMess aging cannot be resolved to a typeCode:GoogleCloudMessaging gcm;
Comment
-
So, it doesn't know the library. You'll have to add the Google Play Services SDK library to your project as described here under the heading Set Up a Project with the Library. The library you're looking for should be in <android-sdk>/extras/google/google_play_ser vices/libproject/google-play-services_lib/ and is ideally copied into your projects classpath (as explained on the above website under Install the Google Play Services SDK, Point 4).Comment
-
There are stepd of instructions on the Getting Started with GCM site. can you follow all of those steps? If you can't resolve GCM to a type, you may not have installed the Google Cloud Messaging for Android Library in the SDK Manager (under Extras). Also make sure, that everything that sounds reasonable in that list is installed.
there are also some other ways to do this jobComment
-
I am using eclipse.
i have installed Google Cloud Messaging for Android Library and Google Play services in SDK manager.

"If you are using Eclipse, import the library project into your workspace. Click File > Import, select Android > Existing Android Code into Workspace, and browse to the copy of the library project to import it."
i don't get this. what i have to do?Comment
-
Old method of implementing push notification is depriciated now. So you need ot implement it using latest method i.e using google play service library. Learn complete android gcm tutorial for here.
What do you need to do?
Create a IntentService, one broadcast receiver to listen to announcement that the notification has arrived. Also you need one main activity to process the received json object as a notification.Comment
Comment