How to subscribe and receive Firebase message in pure Java (not Android) - java

I'm looking for the way I can create a receiver of Firebase Cloud Messages in Java. Things successfully work in Android, but I could not find anything to start in Java.
Official documentation does not mention Java as supported language, but I also did not find explicit statement that Java is not supported.
Here is the documentation entry points for Android, c++ and WEB (Browser). Where can I find something similar for Java?

Firebase Cloud Messaging does not support receiving messages on Java desktop apps.
The protocol was made for delivering messages to mobile (Android and iOS) devices, and then expanded for web clients. It seems unlikely this will be expanded to desktop or server apps in the (near) future, although I'd definitely recommend filing a feature request.
In the meantime, consider using another push technology, such as the Firebase Realtime Database or Cloud Firestore.

check out firebase_admin messaging module, I am able to successfully send messages to my android phone from my python server at home. I know it also allows you to subscribe to different messages. It supports Java but not aware of the technical differences

Related

Java Bluetooth Proxy

I’m not sure if this is the right place to ask this question as this is my first question, but I have the following scenario and I need advice and guidance. Or, if this is the wrong place to ask this question, where should I post it?
I want to create a Java Bluetooth proxy application that will sit in the middle of an Android app and a bluetooth IoT device. I want this Java application to see all the traffic that is being exchanged between the app and the IoT device. I have found similar applications called btproxy and btlejuice, but I want to implement it within Java and I want it to be really simple. I have looked into Bluecove but I'm not having much luck. I’m guessing I will need 2 different machines or VM’s so I can use 2 different bluetooth adapters.
Basically, when you connect the Android app to the computer/VM, the data will be logged and it will be sent to the IoT device. The IoT device will then process it, and send its data back to the Android app via the computer/VM. I’m guessing this relies heavily on the UUID of the app and the device?
Is this possible to achieve, if so, have I got the right topology for this scenario and what would be the best Java API to use and is there any code that will help?

Using parse.com in a java desktop program?

I have an android app, made in Java using eclipse. It receives push notifications from parse.com just fine but now instead of logging on to parse.com to send the push notifications, I want it to be possible to send notifications from the server (without using a webview; the server is a desktop program in Java).
Can I somehow use the parse SDK in a desktop java program or is there another way to do this? Any help would be great!
PS I googled thoroughly and the docs don't cover java programs (only android).
As far as I know there is a open source library namely Parse4J where you can use your server with integration of it. Actually, it uses parse REST API as underlying architecture. Parse4j currently does not support sending push notification. However, you can write the send push procedure as cloud function and you can trigger from your server via Parse4j. This actually solves your server send push capability.
Hope this helps.
Regards.

sending free messages to employee phones from Java application

We would like to be able to send instant messages to our employees from a Java application. Most of them have a phone with a data plan. Is there a free and easy way to do this?
I investigated using whatsapp, which most employees have installed, but it has no official API and it seems that a recent change also disabled the possibility to use the unofficial API's.
Perhaps there are whatsapp alternatives that provide an API?
Or is the only way to use mail or create my own android + iPhone apps to do this?
You can use Tropo API to send java messages.
Further details can be found below:-
https://www.tropo.com/2011/05/sending-outbound-sms-with-java/
You can use mysms.com API to send free messages. https://api.mysms.com
why dont you try Whatsapp Web Automated with Selenium framework
The following links can be helpfull:
https://github.com/sigalor/whatsapp-web-reveng
https://github.com/mukulhase/WebWhatsapp-Wrapper
Not all companies provide APIs, whatsapp doesnt want its customers to be bombarded with hoards of messages, that's why they arent giving any APIs
But the above links are a few work arounds. Proceed with caution.. If you send unusually high amount of messages you may get blocked

Is there any method same as gcm to be used for desktop application?

I want to make one desktop application for our college so that it can be use in the way so that when we want to send update about the college fest it can be directly reached to all the person who have the desktop application in java.
For android we have the GCM concept. Is there any method for the desktop application also?
I do not want to use polling here .... So please tell me any suitable method how to do this?
Not without running a server of your own. GCM is a particular service that Google runs free of charge to encourage developers to use the Android platform, and it works by having every Android device make a TCP connection to Google and keep it open all the time waiting for incoming messages. You'd have to have your own similar server.
You could use a JMS publish/subscribe topic, but in this case, it is almost certainly a better idea to let the client poll for updates in JSON or RSS format. Is there a specific reason you don't want to poll?

Asynchronous android GAE communication using restlet

I would like to repeatedly (every second) ask for the message (object or value) to GAE (if android client did not create or change something there) from another android device. I need to check it pretty fast, but I know that it happens aproximately once in hour.
I use restlet and I don't want to create new thread and poll by get from this thread every second, because this is very battery consuming. I also don't want to use C2DM.
Is it somehow possible to do this? I have found something about NIO nonblocking http connectors here:
http://restlet-code.1609877.n2.nabble.com/Push-data-from-server-using-a-live-HTTP-connection-td2906563.html
But here is described only the client side and I also don't know if this solution would even be possible to use on GAE and how. Does anyone know more about this approach?
Thank you very much in advance.
As the author of uniqush, I created an entry in the FAQ page specific to this question.
Can I use uniqush on Google App Engine?
Yes and no.
If you just want to use GCM on Google App Engine, then there are some code in uniqush-push which you can directly use.
However, because Google App Engine does not support socket connection, there is no way to use APNS. In another work, if you want to setup a server on Google App Engine, you cannot push any notification to iOS devices no matter what software/library you are using.
I did considered to port uniqush to Google App Engine. But because of this fact, I think it may be better to port it until Google let us use client-side socket connections, or provide some way to connect to APNS server.
Again, if you are considering to use Google App Engine as a server for your App, please be aware that you will not be able to push notification to any iOS device right now. If this fact does not bother you, then do it.
Personally, I recommend you to run a server with full control. It is not expensive nowadays. Amazon EC2 or similar cloud products may be a good choice to run uniqush.
As I recommended above, using a (virtual) server with full control would be a better choice if you want to support more platforms besides Android.
If there is any other question, please feel free to reply.
For being future proof I would suggest you have a single push notification service for both kind of devices. You can either build on your own, or leverage something like uniqush or this
Also the Urban Airship's SDK would be a good option to look at, more details here
this is similar to Urban Airship but only a fraction of the cost. The API allows you to send a C2DM message to a user via a call. After you implement the broadcast reciever, when a user installs the app they are prompted to accept the message. If they accept a token is sent to the C2DM server identifying the user. This token is then used to send them a message via the C2DM platform. The Zend PHP Framework has built in functions for this but if reliability is a concern go with an external provider like Remote Queries or Urban Airship

Categories

Resources