Hi,
Previously I had worked on followings:
- Image uploading activity – Blog post
- Re size image without loosing EXIF tags – Blog post
- 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:
- Custom gallery with check box to select multiple
- View image in gallery
- Capture button to take a new image
- Automatically added captured image to MediaStore, so that we can use thumbnail generated by OS itself
- Added selected images to upload list, where we can add addition information, like comments
- 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.)
- Used URlConnection object to write file using buffer. It also maintain EXIF tags when you receive file on server
Upcoming features:
- Upload to facebook, picasa or any other API integration
- 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
hi, Great code it is really helpful ….” Jay ho sharing ki”
Awesome post Vikas thanks for sharing it…
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
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.
Eclipse reports the following error:
Conversion to Dalvik format failed with error 1 AndroidCustomGallery Unknown Android Packaging Problem
Try cleaning project…
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.
try debugging you server response.. you are getting server error..
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.
Would u upload your PHP code of this Android project case?
me too want the php and mysql coding for it…please provide me sir i need it for my final year project…
hi me too want php code please……….
please help
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
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.
HI Vikas , It’s really amazing. I strugggled for past two to implement fast scroll of Grid View.. Code really helps me..Thanks you very much dear!!
Thanks for referring my blog.
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.
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.
how can current location be added to picture taken and send to server?
vikas can you help?
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.
ya thats setting comes nearly in every smartphone,but my point is to how can i upload an image with these information?
You can use any of the method:
Method1: Use external library
https://vikaskanani.wordpress.com/2011/05/11/attach-exif-metadata-to-a-serialized-bitmap-in-android/
Method2: Using exif methods
This I implemented in one of my post, you can see here:
From line: 350
https://github.com/vikaskanani/Android-Custom-Gallery-And-Instant-Upload/blob/master/src/com/isummation/customgallery/UploadQueue.java
thanx a lot vikas…i will chk out.
Thank you
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…
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 ?
can you please upload php code?
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?
Remove that dependency by right click on project -> choose build path -> configure -> and remove the one that gives you error. Sorry for connivance.
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?
hey..great code…i want to ask…where the picture is uploaded to??
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.
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??
uploading failed… please give me the server side code….
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?
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’?
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?
My previous problem has solved. but it is showing force close now. How to solve this problem .Please help me out.
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.
How to show images from a specific folder in sdcard?
Hello,
i have jquerymobile site/gallery how to use this for load images from site and add button set wallpaper?
Regards.
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..??
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
Anyone have the server side codes in php? I tried to implement with codeigniter’s upload functions but it doesn’t work.
Never mind, i’ve implemented your code to work with codeigniter php framework’s upload function. Thanks for your codes as well, i tweaked few parts to make it work with the server side code 😀
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..
Hello Vikas please help.how can i take all the upload paths in an array…please for posting many images for a single post