GCM Android Simulation

I am new to Android development and have been trying to add a push notification server as well as a client (APK).

What I read over the Internet, I need to register the console.developers.google project , and then get access to a specific ID or receive a push notification. But, what I'm trying to do is simulate the whole environment on my local machine and test it. Could this be achieved?

For example, the push service registers and sends a notification to localhost, as well as my application (WIP) for receiving and re-sending messages to the service - if the local machine is not connected to the Internet.

+4
source share
2 answers

- , push- Googles.

Push- Googles . , . .

.

, , , , , :

adb shell am broadcast -a com.google.android.c2dm.intent.RECEIVE com.myapp

, -c, . ,

adb shell

am broadcast

, . ( , , . com.google.android.c2dm.intent.RECEIVE.

?

+2

push- Android- ADB.

  • adb.

sudo apt-get install adb

  1. SEND manifest.xml.

android: permission = "com.google.android.c2dm.permission.SEND" >

adb shell am broadcast -c com.myapp -a com.google.android.c2dm.intent.RECEIVE -e "SomeData"

  1. (com.myapp) "SomeData", .
0

Source: https://habr.com/ru/post/1570163/


All Articles