Android Question How to send Push Notifications (GCM) from android?

javiers

Active Member
Licensed User
Longtime User
Yes, they are running both the device and the example B4j the desktop.

The device registers and receives messages with the B4j desktop. Table SqLite main track appears with two values: key with the device name and value.

But I do not know which is the code for sending a message from the device to B4j.
 
Upvote 0

JoanRPM

Active Member
Licensed User
Longtime User
The code is that you receive from Google when you register.
The sample code is the same as Erel said.
 
Upvote 0

coslad

Well-Known Member
Licensed User
Longtime User
Is it possible to send message from Android to desktop?
 
Upvote 0

JoanRPM

Active Member
Licensed User
Longtime User
I suposse. I only comunicate with 2 and more android devices.
See the Erel #2 response. It is in B4J but I have not tried it.

Regards.
 
Upvote 0

coslad

Well-Known Member
Licensed User
Longtime User
But the desktop app hasn't an id , only the registered android device has the id , right ?
 
Upvote 0

coslad

Well-Known Member
Licensed User
Longtime User
Hi
i checked the B4J source code , but the only way for a Device to call the server is through email and not from a GCM message .
To send a message you need the api key and the device id ,the server is a b4j app and doesn't has a device id
 
Upvote 0

enginetrics

Member
Licensed User
Longtime User
there are many other simpler ways to send a message to a desktop server (assuming that the network is configured correctly).
My first B4A app does this using Apache web server configured with PHP and MySQL. The app sends messages to a Raspberry PI that controls the opening and closing of my gate at the end of my driveway. The PI also tells me when someone is at my gate by using motion detection seen through the outdoor web cam attached to the PI.
Like Erel said, there are easier ways.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…