Android Custom Gallery And Instant Upload Project


Hi,

Previously I had worked on followings:

  1. Image uploading activity – Blog post
  2. Re size image without loosing EXIF tags – Blog post
  3. Custom image gallery with check box to select multiple – Blog post

So I decided to create an open source project. That satisfy most of the requirement. Project can be integrated to your application.

Features currently achieved are listed here:

  1. Custom gallery with check box to select multiple
  2. View image in gallery
  3. Capture button to take a new image
  4. Automatically added captured image to MediaStore, so that we can use thumbnail generated by OS itself
  5. Added selected images to upload list, where we can add addition information, like comments
  6. Re size image if it is too big. I maintained EXIF tags, while creating a new copy. I used EXIFInterface, introduced in API level 5. So Project is fully compatible with min SDK version 2.1. (Note. EXIFInterface can only read some of the tags, for complete EXIF tag copy, refer to Sanselan project. My this post can help you how to use it.)
  7. Used URlConnection object to write file using buffer. It also maintain EXIF tags when you receive file on server

Upcoming features:

  1. Upload to facebook, picasa or any other API integration
  2. Add uploading process to Android Notification area

Please feel free to comment.

Project is hosted at Github.
Download source code from github.
https://github.com/vikaskanani/Android-Custom-Gallery-And-Instant-Upload

52 thoughts on “Android Custom Gallery And Instant Upload Project

  1. Pingback: Android custom image gallery with checkbox in grid to select multiple | Vikas Patel's Blog

  2. Pingback: Android custom image gallery – part 2 – Add capture button and update gallery | Vikas Patel's Blog

  3. pramod

    Hi am building app in which i have to load 3X3 images into gridview and it should scroll horizotally to see other images in 3X3 format .plase help

    Reply
    1. sachin

      hey vikas,
      i need your help in this code. I implemented this code in my application with some UI modifications. Now i want to send these images to my server as a multipart format.
      in URL=new URL(my server url);
      now i want to send access token, images and image name to my server. so will you please guide me in this.
      and what actually
      private static final String LINE_START = “–”;
      private static final String LINE_END = “\r\n”;
      private static final String BOUNDRY = “*****”;
      these three variables do in project.
      suggest me to complete this as early as possible.

      Reply
    1. cutelyaware

      Building a fresh project around your java classes and resources works. I can give you a complete project if you like. Next problem is that the upload always fails with the “try again” message.

      Reply
      1. cutelyaware

        It fails with an operation timed-out SocketException on the line
        dos = new DataOutputStream(conn.getOutputStream());
        Reply via email and I can send you the project.

    1. anjali

      me too want the php and mysql coding for it…please provide me sir i need it for my final year project…

      Reply
  4. rexx

    Hi Vikas,
    Really you have done a great job. Well I had liked to ask you something related to my work. Actually I m trying to select multiple contacts and send them to the server.
    Can you suggest me some tips for this.
    thanks in advance

    Reply
  5. Jitesh

    Hi Vikas,
    This is what I was looking for. Very nicely done. I am new to creating REST service. I was wondering if you can post some code of the service which receives the images and saves to database. I am just looking for how to consume the sent image data in service.

    Thanks.

    Reply
  6. luils

    Thank you very much for your share!!!
    However, could you provide some PHP code with the project? For example, ”
    url = new URL( getString(R.string.WebServiceURL) + “/cfc/iphonewebservice.cfc?method=uploadPhoto&returnformat=json”);”
    This code is on your project but I want to try it myself.

    Reply
  7. Ed

    Very nice app. I noticed that you also make blackberry apps. Ever tried this on the playbook? Ran it there – the capture store didn’t seem to work so well (it captures an image but didn’t seem to have a hand-off back to the original activity that it was done). But everything else seem to work fine there.

    Reply
    1. Vikas Post author

      Most of the andorid mobile support this feature in camera application. What you need to do is, go to the camera and then go to the settings and find settings about add GPS location to picture.

      Reply
      1. yogi

        ya thats setting comes nearly in every smartphone,but my point is to how can i upload an image with these information?

  8. Sree Harsha.P

    Thanks a lot.. nd a suggestion…
    Why to load all the thumbnails at time of initialisation …which will increase the heap of app.Rather saving the paths of the thumbnails and generating bitmap dynamically will save a lot of heap.

    Hope this helps out… correct me if am wrong…

    Reply
  9. adi

    Hi,

    How can I add mark all checkbox besides select button?
    So that it will mark all checkboxes in thumbnails and then i can click select so it will select all thumbnails…
    Can you please help me with this ?

    Reply
  10. elyugoporelmundo

    I’m getting always an error message saying Description Resource Path Location Type
    Project ‘AndroidImageUpload’ is missing required library: ‘D:\Vikas\Downloads\httpcomponents-client-4.1-beta1-bin-with-dependencies\httpcomponents-client-4.1-beta1\lib\httpmime-4.1-beta1.jar’ AndroidImageUpload Build Path Problem

    Where can I get this library?

    Reply
    1. Vikas Post author

      Remove that dependency by right click on project -> choose build path -> configure -> and remove the one that gives you error. Sorry for connivance.

      Reply
      1. martin lloyd manlapig

        if you take this ‘D:\Vikas\Downloads\httpcomponents-client-4.1-beta1-bin-with-dependencies\httpcomponents-client-4.1-beta1\lib\httpmime-4.1-beta1.jar’ away it will result in an error…how can i get a library like that?

  11. Nathaniel

    Thanks so much for the code. It has helped a lot. From my research it looks like would be a good idea to use a cursorLoader to load the images on a different thread and not use the main thread.

    Reply
  12. vinod

    hi vikas i downloaded ur code from github..but i m facing some probem..suppose if i want to upload a image from ur app to my grails server…What changes should i do for this??

    Reply
  13. Sasan

    First of all thanks for your great code, it’s work like a charm.
    1. How to show pictures from a specific folder not all the sdcard?
    I change the cursor path but it show nothing just a blank screen with two buttons.
    2. Is it possible to enable finger gestures like sweep to change the pictures?

    Reply
    1. martin lloyd manlapig

      how were you able to fix this problem ‘D:\Vikas\Downloads\httpcomponents-client-4.1-beta1-bin-with-dependencies\httpcomponents-client-4.1-beta1\lib\httpmime-4.1-beta1.jar’?

      Reply
  14. martin lloyd manlapig

    im trying to run one of your work but i get this ‘D:\Vikas\Downloads\httpcomponents-client-4.1-beta1-bin-with-dependencies\httpcomponents-client-4.1-beta1\lib\httpmime-4.1-beta1.jar’ what should i do?

    Reply
  15. Pingback: missing a specfic library for upload photo in android | BlogoSfera

  16. Dev

    My previous problem has solved. but it is showing force close now. How to solve this problem .Please help me out.

    Reply
  17. JRP

    Hi Vikas! Thanks for the code it really help me alot for my thesis! but i have a question is it possible for the image to be sent to mysql server?
    your response is very much appreciated.

    Reply
  18. suat

    I think there is a problem about app. when ı push the ‘back’ button in app, it has an error and it closes. how can we solve this problem..??

    Reply
  19. Pingback: missing a specfic library for upload photo in android | Technology & Programming

  20. sachin

    Nice tutorial thanks for this. I implemented this with my project but i want to implement capture image from camera button inside gridview. Like first image is camera image on that click camera intent will be called. Please guide me to do this.
    Thanks

    Reply
  21. Avik

    hello Vikas my requirement is to upload multiple photos for a single post.i have used your code but not able to take all the image path in an array for decoding.Will you please help me out?can you just modify your code so that i can upload multiple images for a single post.
    dos.writeBytes(“Content-Disposition: form-data; name=\”file1["
    + String.valueOf(i++)
    + "]\”;”
    + ” filename=\””
    + uploadPath + “\”” + LINE_END);
    Please Help..
    thank you in advance..
    I have tried but it is uploading all the pictures as different post..

    Reply
  22. Avik

    Hello Vikas please help.how can i take all the upload paths in an array…please for posting many images for a single post

    Reply

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s