Android chatting app development - android

I want to make an Android app where there will be several clients and an admin.The app will be installed in client's device.Admin can be send message from computer to the clients and clients could be reply the message.
The admin could be also send notification to the all clients or to individual client.
Can anyone give me some suggestions that which technologies should i use to build such an app?

You need to build a backend for your app with a database to store user informations , messages etc... I suggest you to use a non-relational database because access to db values it's more efficient for this uses-case.
To make it easy you could try Firebase Cloud Messaging.
Here the official site
Firebase

You can use the Firebase which provides you a bunch of products like notification, authentication,cloud storage, cloud messaging, Notification. You can easily integrate this in your app by just following the documentation.

Related

How to integrate a chat feature without using the device messaging app

Have 2 apps on separate devices: Rider & Driver.
Let's say, the Driver needs to contact the Rider via messaging, or vice versa, is there a way to do it without using the stocked message app to protect privacy?
My idea was to create on both apps an empty box, add a text view for the message and send button and add the msgs to firebase db. Unfortunately, i am not sure how i would do it in Android as well as the response.
Any suggestions or how to's would be greatly appreciated.
You could probably integrate your app with Firebase.
For simple messaging, you could use Firebase Cloud Firestore to do it and for notification, you can use Firebase Cloud Messaging.
Messaging
You can have a sub-collection to store all the chats between the rider and driver in the form of documents. 1 chat will be a document storing the info such as time, sender, as well as message.
Notification
From the doc:
Send acknowledgments, chats, and other messages from devices back to
your server over FCM’s reliable and battery-efficient connection
channel.
You could start research from Firebase sample application.
Highly recommend you go through this third party tutorial: Firebase Tutorial: Real-time Chat to get some idea, it's in iOS but the concept is the same.
Yes, there is a way to do it.
Actually you can use any messaging platform, e.g. Firebase, ConnectyCube, Twillio, Layer etc.
All of them provide API & SDK for iOS, Android and Web for chat so you can easily do it using it.
I used ConnectyCube some time ago, it can be done in the following way:
Initialize app
Sign Up user
Connect to chat
Create a chat dialog with other user
Send/Receive messages
More detailed chat code sample for Android can be found here
Most of the above platforms provide a cloud hosted plan, but some of them also provide an Enterprise plan when you the whole platform can be installed at your AWS/Google/Azure account, so hence the privacy is the best because you own all your data

Push Notification from website to mobile app

I want to develop a website that will be able to send push notifications to a mobile application that would be able to run on both android and iOS.
For the last couple of years, I am working as a web developer so developing the website is not something that I am worried about, but I have never developed a mobile application before, the mobile app would only receive notifications from the website so the main functionality would be in the website.
Can anyone suggest me what the best approach is and what I have to learn to be able to do this?
Thank you in Regards
I guess, you have 2 options.
You can either use Firebase FCM
https://firebase.google.com/docs/cloud-messaging/
or use a third party which is called OneSignal
https://onesignal.com/.
If you are looking for an easier way then I recommend using OneSignal instead. You just need to define API Key in your build.gradle and initialize OneSignal in onCreate().
The best approach, in my opinion, would be to use firebase (https://firebase.google.com/products/cloud-messaging/). I think it is better because it is a unique framework for both ios and android and you don't need to worry about the user device when sending the message(you could build an interface in your backend code to handle this but why doing something that already exists and it is free).
The flow is something like this:
on the first start the app(either ios or android) must send its firebase ID to your server so that you can store it (simple http request will od it) and set up a listener for the incoming push messages
when you need to send a push message all you need to do is an http request and you can trigger it with js from your website. The request will contain data such as the firebase id of the receiving device(which you have previously stored)
Firebase Cloud Messaging also have some really nice features like upstream messages(push messages from the device to the server, but you need an xmpp server to listen for them) and topics to send the same notification to many users at the same time
I think the best approach would be to create a node server where the website would be running on and then use Firebase Cloud Messaging (FCM) to send notifications
EDIT: FCM supports both Android and iOS

What exactly is Firebase Cloud Messaging?

I need to retrieve data from firebase database while app is in background or closed. For this, I have been thinking of using database reference in a service.
Instead of this, people recommend using Firebase Cloud Messaging. But what exactly is that?
How does is interact with the database? How do I use it for listening and retrieving data? There are very little explanation on these and firebase docs are too broad. Or maybe I just cant find it
But what exactly is that?
Firebase Cloud Messaging (FCM) is the latest version of Google Cloud Messaging (GCM), which is Google's Push Notification Service.
It allows developers to send data from their App Server towards the Client App. For your case, you may be able to send over the desired data towards your Client App, by integrating your Database with FCM.
How does is interact with the database? How do I use it for listening and retrieving data?
If you are using Firebase Realtime Database, you may choose to integrate with FCM in such a way (referring to #FrankvanPuffelen's answer):
Sending messages to devices based on inserts into the Firebase Database will require you to run a trusted process, typically on an app server that you control. This trusted process listens to the database changes and then calls Firebase Cloud Messaging to send the messages.
For an example of how to send messaging from a node.js script, see my answer here: How to send Firebase Cloud Messaging from a node server?
In summary, you don't use it to listen for data. You can however use it as the medium to send the data from your Database towards your Client App.
Since you are implementing Firebase for the first time, I'd recommend you to go through this and get a basic idea about it.
Broadly, FCM (previously GCM) is a Cloud Messaging service for your app. Most importantly, the Analytics and Realtime Database of Firebase are used.
Here is a link to their docs. Go through it for better understanding of Firebase and its implementation.

How can i send a string from one android to another over internet

I want something similar to Facebook messenger and
I don't have much knowledge about web servers,can i use them?
It should be like
I accept on String from user and then upload it to my server and program the server to send it to other device and the other device gets notified by a background service
To create something similar to Facebook messenger, you could do a lot of things.
Just to start, in my opinion, a Serverless service. Firebase could be your solution or AWS (or any other service). It has a Push notifications and database where to store that Strings.
Firebase Cloud Messaging
Firebase Cloud Messaging (FCM) is a cross-platform messaging solution that lets you reliably deliver messages at no cost.
Using FCM, you can notify a client app that new email or other data is available to sync. You can send notification messages to drive user reengagement and retention. For use cases such as instant messaging, a message can transfer a payload of up to 4KB to a client app.
Firebase Realtime Database
The Firebase Realtime Database is a cloud-hosted database. Data is stored as JSON and synchronized in realtime to every connected client. When you build cross-platform apps with our iOS, Android, and JavaScript SDKs, all of your clients share one Realtime Database instance and automatically receive updates with the newest data.
Other way is open a socket in your Android app and handle all the events. I recommend you Socket.io to do that.
You could use node.js in your server to create a socket server and use the Android client.
http://socket.io/blog/native-socket-io-and-android/

Realtime Web to Mobile Chat Application Using Firebase

We are building a real-time mobile to web text & image chat application using Firebase. Consumers can send messages to 10 categories for example, TV Help, Computer Help, Camera Help etc from an android mobile app. Agents will receive messages on an AngularJS web app where they can reply. Now, one category can have many agents under it.
For example, if ConsumerA sends a message to "Camera Help", the messages should be routed to AgentA & AgentB, if they are handling "Camera Help". Any of them can reply to the consumer.
What is the best way to structure a firebase database for this use case?
Also, we would like to send consumers android push notifications if the app is not in use. I have heard you can use a firebase queue, but it seems challenging, are there any examples of this?
Thanks
Well if I am to design your firebase it would be like,
Customer_name
Customer_number
Customer_address...and other customer related data
Category_of_item
Message
Time and date of message
The part of using firebase for push notifications is concerned, then there is no direct support for that in firebase I would suggest you to go for parse or GCM. Cheers :)

Categories

Resources