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
Related
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
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 am developing a android app where user interacts with the Amazon Lex chatbot. So now i have created the response cards at aws console and i want those response cards to be displayed in the chat window where the user and chatbot are interacting.
I am using the method TextInForTextOut for sending text data and as the name suggests i get a response in text format. But now when i put send some text, i should be able to get a response card in reply to that text.
So my question is how do i get the data related to response cards from Lex and how do i accept it and show it or display it ?
I had been facing the same problem, apparently I ended up writing my own library: https://github.com/PikkaPikkachu/lex-app for that purpose. Works the same way as aws-lex-sdk, but instead of Response, I have included the TextResponse class, which sends a Post Text Request to Lex.
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 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.