I have this social shopping application that I am making and it requires users to register and upload a profile picture and other information that is required then I had tried to display static images in my android project but now since i am about to go live.
My problem is how can I let users upload images and also retrieve the uploaded image to be set as a profile picture of the user
Related
I have an app where users can register/login and do stuff. The user credentials are stored in a database. I am wondering how can I let the user to upload a profile photo on the app, do I need to send the photo to the database or can I do it locally? Let's say the user chooses a photo and it will be set in an ImageView, how can I make it persistent? How can I load the photo onto the ImageView when the user logs in, do I need to use a database or can I do this locally?
You shouldn't save the profile photo locally. If a user log in on another device, he will need to set another profile pic, and this is so wrong.
You may upload the pic on the server using an api and fetch it when you need to display it. Then you could use a productive tool lib like picasso for caching it locally.
you can do it locally if you don't required online process.
you simply store (in Share Preference) path of the image which user have select and use this path every time user log in
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!
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
im creating anapplication which load user download aplication in list view im using database which store playstore application id in database and match system install app with that database see this image http://imgur.com/CA0Tpy0 in this image playstore give application package id=... in url
playstore give application in url which is id=air.com.ea.superherocity_row&feature so that id is save in database so easily retrive that applictaion in listview which add frm playstore but problem is this if user dont view product detail and just click app install button see this image http://imgur.com/bFOqE3x play store not show any id in url so that application not save in listview how do i prevent my mobile to must vew product detail other wise not install any app form play store???
You can't control the behaviour of the Play Store app like this for the simple reason that it is not your app and they do not offer a setting or API you can use to do this.
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.