I am android developer. I am working on a Android application creating a Chat application. I am facing a small issue in displaying the recent chats using XMPP service. How can i fetch the recent chats. Is there any inbuilt function that i can use to fetch the data in XMPP. I am newly working on XMPP concepts. Any ideas will be of great help to me.
Thanks
depending on your XMPP server, you might not be able to get the recent chats (because the server might not store them for too long).
You would be better off saving all the chats to an internal SQLite database, and retrieving them from there as you need them. A classic XMPP server is only guaranteed to keep messages that have not been delivered yet.
Related
I want to build an app that continues an only one group maybe with API.
Someone can guide me with this, please?
It's for an Educational app.
One option you have is to work with a server.
On your server, you host a database and an API. You can use the database to save the users and the messages. You should also send your push notifications with this server. You can send push using FCM, but I personally had some problems with it and switched to OneSignal.
In your APP you can show the different messages using a ListView with custom list items. To communicate between server and app you can use a Volley request.
Some time ago I wrote nearly the same app. I would recommend you to use a server with an API (a simple PHP API is enough).
I am developing an application that saves some data in the Firebase Database. As soon as the data is saved, I want it to be given as a notification to all the users connected to the application through code.
I couldn't understand the procedure to do so. Can anyone explain me how one can send push notifications via code in the chain as Android phone -> Firebase Database -> Notification to Android Phone with the data.
it isn't Possible to solve your Problem with Firebase only. You have to create a MySQL Server and work with PHP. Maybe this Video from Filip Vujovic could help you.
https://www.youtube.com/watch?v=LiKCEa5_Cs8
You can use GCM,it's simple.The GCM service handles all aspects of queueing of messages and delivery to client applications running on target devices, and it is completely free.
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 :)
I am a newbie in android. I have developed few applications, but all are plain and simple, just used the built in features of android.
I was asked about push notifications, in one of my interviews and I decided to have a look at what Push Notifications are. I understand the concept of Push Notifications(I think), but whenever I read the term "Server", it's freaking me out.
I understand all the client side coding, but I don't get how to implement the server side coding. I have seen some people use XMPP, MQTT, etc., What are those? Here is my scenario and what I want to know..
Scenario ::: Let's say I have a website, with a table (the values are retrieved from database), where I update a few columns every day. I want these updates to be reflected in my android application. So, as I have read, push notifications can tell the application that there are updates available. Good. I am fine till here..
When the application gets the notification, should my application, contact the website and get the latest information? or will the updated information sent through Push Notification? I guess, my application would be contacting the website and get the information. Now, how do I get the data from the website? Should I get the source of the page and do some kind of parsing or something?
I will be asking more questions, as the experts clear my questions...
Sorry, if my questions are too naive, but this is the only place that can help me...
Push Notifications means Google Cloud Messaging for Android (GCM) is a service that allows you to send data from your server to your users' Android-powered device.
You can refer to this documentation
Google Cloud Messaging for Android
GCM: Getting Started
And there is also Demo App Tutorial given
in your case you need to create HTTP web service for getting data from the server.so when you get notification about update on server side.you just need to call this web service and get the data you need to update
Recently, I try to build a chat app in android with XMPP! I installed Ejabberd, and with connection, I can chat with another user with my android app! But now, I have an issue in retrieve chat logs history! I mean that I don't know how to get chat history with Asmack and Ejabberd. I tried reading the smack document, however, I can find nothing!! So, anyone has any suggestion to get chat history with asmack and Ejabberd? Thank very much!
Ejabberd does not necessarily save chat history by default, since that can be a potentially very expensive task. Nor is it built into the core part of the server. There are modules available such as mod_archive that can installed/enabled that would allow you to save some chat history, but as chat history is not part of the core XMPP spec, there is no "standard" way to do it, so it would only work when connecting to your own servers. What you might consider doing instead is archiving your chat history yourself locally. You will notice that this is what most desktop XMPP clients do. Enabling mod_offline would allow you to receive message that were sent to you when you were offline. But there is no special method for retrieving them, they just arrive when you log in.