I am developing a chatting/messaging app and I want to let the user select an image that they've stored online (i.e. picasa, photobucket, flickr, etc) which will be shown as part of the chat User Interface for anyone that is chatting with the user.
For example:
User_A is messaging/chatting with
User_B.
User_B will see a small thumbnail
image of User_A
User_A will see a small thumbnail of
User_B.
note: my web server is facilitating the text exchange between the two users.
At first I thought I would implement a photo upload function in my app and store the photo's on my server that each client would download. But then I realized that this is just re-inventing the wheel because there are now a lot of online picture sharing services.
So I want my server to simply store the URL of the images that User_A and User_B have selected - my app is notified of the URL's and downloads the pictures.
However, how is this implemented ? (Specifically, the image selection to obtain the URL in a userfriendly manner)
I've visualized the following userfriendly use-case...
user opens the options activity in my
app and pushes the button to select
an image to present in the chat UI.
an intent dialog is shown with all of
the possible image hosting services
installed on the mobile phone
(picasa, photobucket, etc) - but
local storage shall not be shown.
the image picker of the chosen
application is shown and the user
chooses the image.
the image picker closes and returns
the URL to my app.
If this can't be implemented, then my only alternative (that I know of) is to have users copy'n'paste the URL of the image they want to use - which is not userfriendly on mobile devices.
Any help is greatly appreciated.
That doesn't seem very difficult to me.
You can predefine which Image hosting services you wish to use.
Picassa and Flickr have their APIs AFAIK.
Present user with an option to choose from your predefined offerings.
When they choose, present the album of the user.
When the user ends up selecting an image, Image hosting will let you know about their URLs (You can download all images of that album and display them natively in your app, it will fetch information about them, like their URL with them, which will be easy to track)
Get the URL, and update the chat webservice about it.
Create the Chat activity in a way that it polls your webservice after a particular interval to check whether any one of both the users involved in chat have changed their images. If they have, load the new one.
I can detail you on this if you have any doubts.
Related
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'm making a simple chat application which I want users to be able to set their own chat room background.
Which directory should I store the images and in what format ?
Will user be able to access and delete the file from some file browser app ?
The requirements are:
The selected image should be stored in the device (not uploaded to the database)
If new user logs in, and logs out. Then, the old user logs in again, the wallpapers should remain there.
Different chat room can have different wallpapers.
(Basically, the wallpaper feature is only apply to that device.)
I am creating a messaging app like watsapp and other messaging app.I have implemented messaging and easily able to chat with contacts but now I want to add contact image functionality to my application so that each contact will be able to upload there image and other user will be able to view contact image when they click on view contact.
Also for each contact view on AppBar I want to show image in circular shape for contact.
What you want to do can achieved by saving the user's contact images to the server . There is no in-built functionality for storing the images of user inside smack Library so you have to implement that on your own . Send the user's images to the server (e.g. by multipart) and also you would be needing some server-side code to handle the images (saving and providing downloading functionality ).
I'm the drummer in a band here in Denver and we CONSTANTLY have fans taking pix of us, taking selfies with us behind them on stage. Or the aftershow selfies.
What I'm trying to work out is the following:
A page on our website that will essentially host a "take or upload photo" button.
After the person submits the photo, it will be immediately displayed on the same webpage (newest to oldest preferrably)
Of course there will always be that jackass who takes a picture of something stupid or offensive and submits it so, we need the ability for our manager to (simply & immediately) delete said photo from the stream. We need her to sort of "monitor" the shots as they come in.
Ok.. Suggestions?
All you need is two version of your app. One is displayed and managed my your manager or team and other by all your fans depends on the who is signing in. Once fan take the pic they will upload through there application. It will host to the server by whatever web services you are using. Your team will get the notification immediately that so and so pics or comments get uploaded. Once your team approves it will dynamically uploaded to your website. If your team rejects it, user may/may not get notification for rejection.
Im trying to figure out how to access photos from the android default gallery and send them to my server.at the moment what my code is doing is user clicks the upload button then chooser comes and then he selects the photo and then i am sending the photo to the server. but what i want is the user clicks the upload button, all images from his gallery will be sent to the server without showing him the choice of any. you can say its much like a backup app.the user clicks backup images and all his images immediately sent to server. is that possible? how can i take all photos without giving him choice or chooser ?
Gallery by Default display all images which are stored in any folder
on phone. so you have to know URI of all images on phone and then read
and send these images to server.
You have to manage custom Gallery and After that save All the file path which is selected by you/ user and pass them to server.
This link may help you to make custom gallery:
Custom Gallery