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

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

Related

Creating realtime user-presence detector server-side for android app

I am creating an android game where the user should be able to see other users that are currently online when answering questions and should be able to interact with them - ask questions and chat basically. No state will be saved after the user has interacted with other users - that part of the app does not save chat history nor does it save users online. I was looking at ejabberd and open fire or do i go with GCM?
Google Cloud Messaging, now rebranded on it's newer version, Firebase Cloud Messaging -- is a service commonly and mainly used for push notifications. I don't see how you could use this to build a Presence System, so no.
You might want to look into Firebase Realtime Database, specially this Firebase Blog on creating a Presence System with it.

Android chatting app development

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.

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 :)

Push Notifications in Android using Google App Engine

I am currently developing an app where users create posts that are stored on a server. When another user shows interest in a post by clicking a button, I want to notify the author of the post using push notifications. I have already set up the data storage using cloud endpoints with Google App Engine. Is there anyway I can use these endpoints to implement push notifications? If not is there another easy way to implement push notifications given my current setup? I have already read about Google Cloud Messaging on the developers page but was somewhat confused. I have kept track of the registration id's but I don't really know where to go from there. Thanks in advance.
You can use the HTTP interface to the GCM servers as described in this
Android developers page.
The easiest way to do it is by downloading the Google Cloud Messaging for Android Library using the Android SDK Manager, which will give you a jar that handles all the complexity of setting up the requests and responses to GCM.
Towards the bottom of that page, there is a sample Java application for push notifications on App Engine which you can use to get familiar with sending push notifications and then adapt to your needs.

Instant Messaging on Android with Google Cloud Messaging

I was just looking at the new Google Cloud Messaging (GCM) and I was wondering if it is possible to use GCM for Instant Messaging on your Android application?
I saw you can send data, like a message, from a server, but is it also possible to send from one device to another one?
And how would this work?
Some example code would be really helpful..
Tnx!
The official docs on Google Cloud Messaging for Android does mention that GCM can be used to develop an instant messaging app.
...or it could be a message containing up to 4kb of payload data (so
apps like instant messaging can consume the message directly).
So we went ahead and created an instant messaging app using GCM. The server-side is powered by Google App Engine. You can read the complete tutorial here. Create an Instant Messaging app using Google Cloud Messaging (GCM)
So it is possible to use GCM for Instant Messaging on Android, to answer your question. However, reliability of GCM compared to XMPP for IM is another topic.
Just my two cents:
I think you should not use GCM for delivering IM. You should have a dedicated server where your Android IM apps will connect to, using a persistent socket connection. Your server will know who is online or not and therefore can present an 'online list' to all the apps.
GCM can come into play, while users are offline or not running your app. A GCM message can be sent to them to indicate 'XXXX wants to chat'. They can then launch your app and automatically connects to a chat session.
Google has said that the delivery of GCM messages are not guaranteed. This reason alone is not a good idea to rely on them for Instant Messaging.
Try pub nub - it is pretty easy to implement - send Im from one mobile to another - simply fire up the web page (see link) in the browser , and chat between pc, mobile - and works - with 'no server'. Code is for javascript but they also have java. Chat app using jquerymobile web app framework
You might want to check out how a server sends a message to the GCM Service. It is possible to use php on Server side so it should be possible to adapt that to a POST request directly out of your application. However, to communicate you need the registered ids of the devices you want to send data to. Means you will need something to store and get them. Best solution would be your own (web) server which stores all ids and handles the Message sending.

Categories

Resources