Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to setup Google Cloud Messaging for Android?

I am trying to implement Google Cloud Messaging for Android (GCM) by following the demo

But i am unable to execute some command like $ ant war,$ android update project --name GCMDemo -p . --target android-16.

I am using wamp server and targetting Android 8+

Any help would be highly appreciated

like image 842
Akram Avatar asked Jun 29 '12 11:06

Akram


People also ask

What is cloud message service Android?

Google Cloud Messaging (GCM) is a service that allows you to send push notifications from your server to your users' Android devices, and also to receive messages from devices on the same connection.

How does Google Cloud Messaging work?

The first step in GCM is that a third-party server (such as an email server) sends a request to Google's GCM server. This server then sends the message to your device, through that open connection. The Android system looks at the message to determine which app it's for, and starts that app.

How do I enable Cloud Messaging API?

Select the Cloud Messaging tab. Under "Cloud Messaging API (Legacy)" click on the options (three dots on the right) and click "Manage API in Google Cloud Console". This will open a new page, under Cloud Messaging press "Enable".


1 Answers

If you want to execute $ant war command:

  1. first you need to download and install Apache Ant on your computer.
  2. Then you should configurate your PATH and JAVA_HOME variables like it is described here (into "Installing Apache Ant" section).
  3. And only after that you can execute ant war command into Windows command line (prompt). After ant war command .war file will be created.
  4. then you can deploy and run your .war file on tomcat server for example. (create Java EE project, then download and install tomcat server, configurate paths, and run your project on tomcat server...)
like image 152
ashakirov Avatar answered Oct 15 '22 18:10

ashakirov