With the given code samples we have tried to text chatting and it is working. We want to use documents sharing in the same chat window and I don't see any code samples for the same. Not sure whether this feature is available in Agora.io. Did anyone tried using Agora.io chat feature with documents sharing such as pdf, images etc. I want similar functionality of whatsapp. Any references would be of great help.
Agora RTM Docs: https://docs.agora.io/en/Real-time-Messaging/product_rtm?platform=All%20Platforms
Agora RTM's maximum message size is 32 KB and it can be a text message or a text description of the raw message or JSON.
Agora itself does not provide any APIs to share files.
What you can actually do is, let's say if you UserA wants to share an image to UserB. UserA first uploads the image to your own server or an S3 bucket once done get the uploaded link and share the link with the description and type as an image in JSON format to UserB through Agora RTM p2p message and when UserB receives the message render it directly as image.
sendMessageToPeer: https://docs.agora.io/en/Real-time-Messaging/API%20Reference/RTM_java/classio_1_1agora_1_1rtm_1_1_rtm_client.html#a729079805644b3307297fb2e902ab4c9
Related
I am creating a b2b e-commerce mobile application. I am using flutter as frontend and django for backend. I am stuck while sending a post request to django server with flutter. The case is I have two types of user. They are seller and buyer. The seller has to post product in the app. Model field for product are title, description, price and image. I created post method in django rest framework and it worked while checking through postman. But I am having hard time sending image through flutter. I used image picker to get the image. I searched for many things but could not figure out what to do. I found articles and videos posting only image at a time but i want to send image along with other text field. How can i do so??
Help me find a solution.
It is better that you upload your selected image with multipart and separate api, but if you want send image with other info , you must, first decrease quality of image until request time was decreased(don't receive timeout api), and also use base64 for this.
Key word for searching for more info, upload image with base64
I am trying to create an app using Android Studio. My client wants to create an app for their online medicines website, wherein the user can take a photo of their prescription, the photo will be accessible by the admins and they can use that image to understand what does the user require and deliver those medications at the user's doorsteps.
So can anyone please guide me through with making this page, or maybe share a link where the making of such a page is shown? Would be really helpful, thank you for giving me your time.
There can be several possible approaches for this type of questions/requirements. I am mentioning a few steps to guide you through the process.
You will have to create a webserver, which will be storing the user data (profile, uploaded prescriptions, etc.). The user data (textual) will be stored in the Database, however, the images will be uploaded in a directory over the server, and their corresponding links will be stored in the DB for reference.
There will be a webserver API which will fetch user data (user unique ID) from app and then store it in the DB. The image part can be accepted in several ways: MultiPart, Base64 encoded, Byte Array Converted
All these methods will send the image info from the android app to the webserver, which will follow the logic mentioned in Point 1 and save the image.
The Android app will have an activity where the user will either capture an image of the prescription form, using Camera, or can upload the image (if already captured/downloaded). You will have to learn doing this from similar links as these:
https://developer.android.com/training/camera/photobasics
Dialog to pick image from gallery or from camera
The Android app will send the unique ID of the user, along with the image data, to the Webserver API, which in-turn process as per Point 2.
You can start implementing the process and then can turn up to StackOverflow again for guidance. There are numerous tutorials to implement a similar functionality too.
https://www.simplifiedcoding.net/android-upload-image-to-server/
http://programmerguru.com/android-tutorial/how-to-upload-image-to-php-server/
https://www.codepool.biz/take-a-photo-from-android-camera-and-upload-it-to-a-remote-php-server.html
All the best!
I could use some help. I’m trying to create a phonegap app for iOS and Android. In this app you should be able to
type your user credentials (name, company, email and telephone number) and save it. This part in working for me.
Create a case where you type some text and take a number of pictures – hereafter you should press send and the text with the pictures will be sent to a predefined email address. – This part isn’t working for me
Is it possible to do that with Phonegap? And if yes then how do I do that? If no, will it then be possible to zip the text and the pictures and then sent it to a server of some kind (ftp, dropbox ect?)
Best regards
Jacob
Yes, It is possible. You can send image's data (binary data) and text to server. At server end you can create images by using the image data and send the email as per your requirement.
You can also compress images by reducing image quality with the help of phonegap api as well and it will be helpful to minimize your request in size.
If you are using Ajax to send request to server then you should use cross domain option true.
I'm an Android newbie, and I'm using Google GCM to send a plain text message. Is it possible to send an image file as stream or by some other method?
Java - Server
Android - Client.
Message message = new Message.Builder()
.collapseKey("1")
.timeToLive(3)
.delayWhileIdle(true)
.addData("TEST",
"Hello Android")
.build();
Here the plain message is .addData("TEST","Hello Android").
You can only send key/value pairs with total size up to 4096 bytes.
Even if you manage to encode an image within a string parameter, it would be a tiny image.
An alternative is to send a string that refers to the image location, either a local file name on your device or a URL that you can access to download the image when you handle the notification.
I wrote two blogs posts on how to do this:
Tutorial: Using AirBop to Send Images in the Message Payload which shows you how to do it by base64 encoding the image.
Tutorial: Using AirBop to Push Images for BigPictureStyle Notifications which shows you how to push image urls and then download the image.
Both tutorials use AirBop as the Application server, but the client code is separate from that and can be used generically.
You could only send a very small image, as the data payload is limited to 4kB. You would also need to encode it somehow.
Okay let's think about the bigger picture here. As everyone has said it is very hard or impossible to send an image using gcm unless you have a tiny image. Another technique is to send it in parts but hey that's annoying no one wants to code that all out. My suggestion is to code the server to store passkeys and image credentials which can be sent to the device. The device then queries the server with the credentials to get an image download. This technique is similar to the theory of using push to notify the device that new data is available on the server. It was originally used to make a server that uses as little push as possible but it is adpted in this case to be a placeholder for sending big data.
I am working on an android application which sends email (texts and images) to gmail, yahoo and other mail services. The version i am using is android 2.2 and it is compatible with 2.2 and above. I want to send images in the mail compose body section. I have tried doing so but whenever I sent mail either the images won't come or a small box is displayed in the mail body. I have searched many websites but did not get enough help. Please help me out with this. I don't want to send the images as an attachment. I want to send both text and images in the mail compose body itself. Looking forward to a quick and positive response from you guyz as soon as possible
The solution I would use if i don't want to send the images as attachments, is to upload the images to some location on a webserver, then put the images in the email body as image html controls with src pointing to the images urls on the web server.