Android, how do you make it right to keep the picture?



  • So I'm making an application where the avatar can be added when you're registered, how is it best to send the image on the server? Server writes the same. There's an idea to put everything in the bath mask and send it to the server, and when I get the data, I'll get it to bitmap. Or are there other ways?

    UPDATE

    There's a user model on the server, how do you make a field with a picture?



  • After the homing, I found a few examples of how this could be done.

    1. http://4ybakut2004.blogspot.com/2015/07/android-upload-file-to-server.html
    2. http://www.cyberforum.ru/android-dev/thread914907.html
    3. https://ru.stackoverflow.com/questions/222377/%D0%97%D0%B0%D0%B3%D1%80%D1%83%D0%B7%D0%BA%D0%B0-%D0%BA%D0%B0%D1%80%D1%82%D0%B8%D0%BD%D0%BA%D0%B8-%D0%BD%D0%B0-%D1%81%D0%B5%D1%80%D0%B2%D0%B5%D1%80
    4. http://metanit.com/java/android/15.1.php
    5. http://ru.androids.help/q812

    In fact, based on personal experience, you can do it in a few ways. The fastest and simplest is to create POST customer queries and to send them to the server, where PHP will the code responsible for keeping the necessary picture. The harder option is the use of cell phones. If necessary, I will provide the code from my project responsible for loading. I've done the fifth, there's a client code and a server.




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2