473,692 Members | 2,390 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

what is push notification in android apps development? how to implement this?

127 New Member
i am new to android apps development. what is push notification in android apps development and how to implement this?
May 29 '13 #1
12 4399
3,112 Recognized Expert Specialist
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:
  1. Via SMS (text message). Here you will have to intercept the SMS and react to it in your app.
  2. 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.
May 29 '13 #2
127 New Member
can you give me any link with sample demo code. complete step by step demo... i tried Google Cloud Messaging for Android this but i get some error. GCM cannot reslove a type. not able to fix it.
Jun 10 '13 #3
3,112 Recognized Expert Specialist
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.
Jun 10 '13 #4
127 New Member
i have installed Google Cloud Messaging for Android Library and Google Play services. but still i'am getting that error.

Expand|Select|Wrap|Line Numbers
  1.  public static final String EXTRA_MESSAGE = "message";
  2.  public static final String PROPERTY_REG_ID = "registration_id";
  3.  private static final String PROPERTY_APP_VERSION = "appVersion";
  4.  private static final String PROPERTY_ON_SERVER_EXPIRATION_TIME =
  5.          "onServerExpirationTimeMs";
  6.  public static final long REGISTRATION_EXPIRY_TIME_MS = 1000 * 3600 * 24 * 7;
  7.  String SENDER_ID = "40824748037";
  8.  static final String TAG = "GCMDemo";
  9.  TextView mDisplay;
  10.  GoogleCloudMessaging gcm;
  11.  AtomicInteger msgId = new AtomicInteger();
  12.  SharedPreferences prefs;
  13.  Context context;
getting error in this line
Expand|Select|Wrap|Line Numbers
  1. GoogleCloudMessaging gcm;
Error: GoogleCloudMess aging cannot be resolved to a type
Jun 11 '13 #5
3,112 Recognized Expert Specialist
Sounds like you haven't imported the class. Is there a line
Expand|Select|Wrap|Line Numbers
  1. import com.google.android.gms.gcm.GoogleCloudMessaging;
at the top with the other imports? If not, add it.
Jun 11 '13 #6
127 New Member
i added
Expand|Select|Wrap|Line Numbers
  1. import com.google.android.gms.gcm.GoogleCloudMessaging;
this. but i get error
Error: The import com.google cannot be resolved.


Jun 11 '13 #7
3,112 Recognized Expert Specialist
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).
Jun 11 '13 #8
Zaid Ahmed
1 New Member
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 job
Jun 11 '13 #9
127 New Member
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?
Jun 11 '13 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

by: Dave D | last post by:
What's the Big Java Development Environment These Days? I used to use VisualCafe years ago.... -- Dave
by: vbMark | last post by:
Here is what I have that is not working. For x = 1 To m_intNumberOfFields If m_oLabel(x).ParentOfComboBox = True Then Dim ctrl As clsComboBox Else Dim ctrl As clsTextBox End If
by: alainpoint | last post by:
Hello, I have the need to write the equivalent of Python class methods in C++. Chuck Allison proposes the following (http://www.artima.com/cppsource/simple.html): #include <iostream> using namespace std; // A base class that provides counting
by: JJ | last post by:
I have a list of contacts in a webpage and the list is created throught the repeater controls. During ItemDataBound event of the repeater, I encrypt the ID of the contacts. When user double clicks on the contact, encrypted ID of the doubled-clicked contact is sent as a querystring (no postback, thru javascript) to the detailed page (so that users cannot type in plain text id and have access to contacts that they are not entitled to),...
by: Michael Yanowitz | last post by:
Hello: I wrote the code below (much irrelevant code removed). This doesn't quite work. What I wanted it to do was a) Execute function ftimed, which takes a function and a timeout in seconds. b) This will also execute function abort() as a thread. This function just runs for the specified number of seconds and returns. However, before it returns, throws an exception.
by: petru.marginean | last post by:
Hello, I would like to re-implement this function that currently uses pthreads: pthread_mutex_t mutex; int i = pthread_mutex_init(&mutex, 0); void MutexCB(int lock) {
by: olddocks | last post by:
what is the safe way to implement file upload in your server with PHP. Here is my situation.. 1. i want to let users upload small avatar like image files in the website. 2. I tried setting upload folder 777 permission and i am afraid that it could be a serious security concern? 3. i tried setting permissions to 755 or 775 , but upload fails. 4. i am saving the images in the server and not storing in the database because of performance...
by: madeofdata | last post by:
what is the code to implement this function? countCharInText Counts the frequency of a character in a text the prototype is int countCharInText(char* text, int size, char toCount);
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.