I'm developing a Java Desktop App, using Javafx and I'm trying to receive push notifications from a server. My first approach was to use firebase. I already connected to firebase and even achieve, for test purpose, storing data in firebase database. But the goal I really need is to receive push notifications.
I'm using firebase-admin:6.5.0, but this module doesn't provide me the FirebaseMessagingService class that I need to receive notifications.
I also tried to use firebase-messaging but appear with an error underline after de import.
What I'm doing wrong? It´s even possible to receive push notifications in a Java Desktop app with firebase? What alternative do I have?
Thank you in advance
There is no SDK to receive Firebase Cloud Messaging notifications in a Java client. Consider using another technology to deliver the notifications, such as the Firebase Realtime Database, or Cloud Firestore.
The Admin SDK you use grants fill administrative access to your entire Firebase project. It is meant for use on trusted environments, such as your development machine, or a server you control.
Also see:
Can Firebase Cloud Messaging platform be used to send messages to Java SE receivers/clients?
Is that possible for Win32/64 application to receive push notification message from Firebase?
Can we use FireBase cloud Messaging to send or receive messages or both ways using C++ on Windows Desktop/Console or Linux console appliction?
ControlsFX provides the GUI support for notification ControlsFX
Related
I have a Java App Engine standard project (for about 4 years), using the Cloud Datastore (with Objectify). One of my services is using GCM to push notifications to mobile clients. Google has announced that GCM is deprecated and will be shut down 11th of April, and from then on Firebase messaging should be used instead of GCM.
After reading the docs it seemed straight forward to migrate, however I cannot create a Firebase database on my existing project, apparently I need to create a new App Engine project for this?
My question is, how can I use messaging on my existing App Engine project?
Starting a new project seems to me a bit overkill just to migrate from GCM to FCM.
Currently, once you select a database for your GCP project, you can't switch back. That's why you would have to create a new GCP project and a new App Engine.
I'm not very familiar with the Firebase products or the migration process from GCM to FCM, but if what you need is to switch from Cloud Datastore to Cloud Firestore, be aware that this change will be done automatically in the future.
You can also contact GCP support directly and request the upgrade.
I figured it out, I'm not able to create a new Firestore database, which is the "new" Firebase database currently in beta. This because I already using the Cloud Datastore in my current app engine project and cheese two cannot coexist whiten the same app engine project. However I was able to create a "old" Firebase database (real time database).
I don't really need a new database or my existing one migrated, I only need messaging to work (FCM) and using the Admin SDK the only way to initialise the library I need a database.
I have a web page where I can perform CRUD operations on a DynamoDB. This web page is written in PHP and works perfectly for performing operations on the database.
I also have a Lambda function that polls the stream every time any operation is performed through this website. It polls the stream, gets all the records and returns the data as a String.
Both the web page to update the DB and the Lambda function are working as intended. However, I also have an android app that relies on data in the DB for various things. My question is how could I access the String returned by the DynamoDB from my android app? Basically, I want the lambda function to run every time the database is updated through the web page (this is done) and then automatically return the String of updated records directly to the android app. How could I go about this?
I would implement Google's Firebase Cloud Messaging API. It is fast, well integrated into Android (and many other platforms), reliable, and you get a ton of free features out of the box. You can look here for a quick feature overview to see if it is right for you.
If I understand the above requirement correctly, you need to send notification to android application. I think this can be achieved using AWS SNS. It has the feature to send the notification to mobile device.
Amazon Simple Notification Service (SNS) is a flexible, fully managed
pub/sub messaging and mobile notifications service for coordinating
the delivery of messages to subscribing endpoints and clients. With
SNS you can fan-out messages to a large number of subscribers,
including distributed systems and services, and mobile devices.
Amazon SNS Mobile Notifications makes it simple and cost effective to
send push notifications to iOS, Android, Fire OS, Windows and
Baidu-based devices.
Refer this link for SNS Mobile Push
I am seeking information about using Firebase (as database) for Java. Is this possible along with hosting of Java (using Spring framework) project over Firebase hosting.
It is possible. Use Google App Engine an environment for running application code in the cloud; Platform as a service (PaaS).
Below is description how make to make basic example.
In the this tutorial, you'll learn how to:
Create a backend service running on App Engine using Android Studio.
Connect the backend service to your data in Firebase.
The sample app stores a to-do list in Firebase, which automatically synchronizes the data across devices, and then uses backend logic running on App Engine to send out daily reminder emails:
https://cloud.google.com/solutions/mobile/firebase-app-engine-android-studio
By connecting App Engine to a Firebase database, you can perform complex logic on data without having to manage synchronization and updates; Firebase handles that for you.
No. Firebase offers hosting for static assets only.
The Google Cloud Run seems is most suitable for what you want.
Consider to check the documentation and pricing. Like firebase, cloud run also has a free tier that can help you develop your app with no costs.
The cloud run supports several programming languages including Java.
Once created the service you can try to connect to your firebase project...
Cloud Run Java Documentation
I'm new in android and i want to know if there is some server / web service online that o can use to update and communicate with my app?
example: I have the app "message" in 5 phones so I want to communicate with all of them, if the phone 1 send a message all device must receive notification.
There is something that I can use maybe free?
You have many options to accomplish this goal, and most provide some free level of support.
In general if you want to "push" notifications to android devices, you can either directly use or use some provider that uses Google Cloud Messaging.
Using this approach directly means you need some web server to send request to, which will then forward a request to Google, which will then forward your "message" to the devices you want to reach. There are many options for free hosting of (smallish) web services. IBM's BlueMix and Heroku come to mind. So if your are comfortable writing web apps, this might be a good choice. I have used both (for Ruby on Rails backends to mobile apps) and found both very good, but am currently using Bluemix.
I believe Bluemix along with Parse also offer mobile data storage and easy access to Push notifications to both Android and iOS. I am currently using Bluemix via Ruby on Rails and pushing messages directly to devices via GCM and don't have much experience with those particular offerings.
Can someone help me use the new PaaS - IBM Bluemix?
I faced a dilemma that I want to import my android application project which was developed on my local computer into the IBM Bluemix and run on the platform ,but I didn't know how to use it.
I have search on Internet about this ,I still cannot find the solution.
Does IBM Bluemix support this kind of service?
I just want to debug or test on this cloud platform.
You don't deploy an android application to bluemix as the android application exists on the actual mobile device (or emulator) and not in the cloud. What Bluemix offers you is the ability to have services running on the cloud that can work with your android application on the mobile device. This is called MBaaS (Mobile Backend as a Service).
For example you can have a MobileData service that allows you to store data in the cloud that your mobile device(s) (iOS, android or web) can access (think of having a game save that can then be picked up by another user device to resume playing at the same point). Bluemix provides an SDK to access these services on Bluemix from your android application source code.
IBM Bluemix is a cloud platform where you can build web applications / mobile back end services utilizing a wide range of services.
Lets say you are building a weather app. This app will require two components
1. a server side web application
2. a mobile application (lets say android)
The server side component does only one thing, it constantly collects weather forecast from multiple data sources (eg www.data.gov, forecast.io etc). This app has restful apis exposed to internet which can be invoked by mobile app to request weather forecast for a particular geo cordinates (E.g http://weatherapp.mybluemix.net/getForcast/122.20,-100.20). The server app responds to get requests in JSON format.
The Mobile app, detects current location's geo co-ordinate using mobile phone's GPS and request weather forecast of the location from server component using a HTTP get (GET:http://weatherapp.mybluemix.net/getForcast/122.20,-100.20) . The mobile app then parse the response JSON data and display information on a neat elegant screen.
If you want to port this app onto IBM bluemix, you can build the server component using, NOde.js or JSP or PHP etc, use mMongoDB,mySQL DB or Postgresql databases, use twillio for text messaging/mms or voice call, use IBM Push for notifying user about weather forecast etc.
Using Android SDK, IBM Cloud services SDk (Mobile data, push notification etc) and sell it on Google play.
Hope this helps
-Keep coding-
We have sample applications for Bluemix which can be deployed on Android. See the "boilerplate" app in the Bluemix catalog named "Mobile Cloud". Head to the Bluemix console [1], click on "CATALOG" at the top. The Mobile Cloud docs [2] reference several applications for iOS, Android, etc with server-side pieces can be deployed on Bluemix.
[1] https://bluemix.net/
[2] https://www.ng.bluemix.net/docs/#starters/mobile/index.html
you can refer developerwork article to get started to use Bluemix services for your andriod app.
First ,you need to login to bluemix and create a new account in ther,
There u have create an application in ur dashboard,where the runtimes in node.js,and add the following services namely,push,mobile data and mobile security application.
Then u need to download the android SDK available in it and add to ur android app all the jar files in the libs folder.
U need to save the app id,secret id and the link in order to connect it from local android app to bluemix.
Hope this was useful,if any doubt further,let me know