i am creating an app that is like a mini social network app, with users, that can be friends of other users. Each user haves email, fullName, etc… but now i want to implement and give to the user the possibility to select a image from the images directory of the phone and make it his profile image.
That image have to be sent to the remote server and all the other users will see that image when open the description of that friend.
On my app i am using JSON and PHP to connect from my app to the remote database, then i supose that i have to transform the image into a String and add a row on the remote database representing the String of the image.
I have no idea of how to do this, and i can’t find any easy help on google or here, all i am finding is too hard for me or is not what i am searching for.
Code examples are welcome
Don’t have time to do a code sample, but at work, we did something similar of transmitting a photo through a soap web service (i know you are using json, but the implementation could be the same).
Basically, take your image and encode it in Base64 (will translate the image to a string). On the other side, you decode the Base64 string into the image. So you can store that string in your database and stream it to the ‘friends’ (possibly even store it on their devices and check for different string each sign on).
Unfortunately I worked on the front side of that project so I don’t know the details, but there is a wealth of information on google, so hopefully this is a good starting point.