Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 19    Views: 106

chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
07/11/13 09:50 PM (12 years ago)

Image Uploader

Finally figured out how to grab an image from the device's gallery or live camera and upload it to a server. Was kind of a pain to do - took me a couple of days to get it right for iOS and Android. I did this for a custom plugin I'm doing for someone, but thought I'd mention it in case anyone else is interested in something similar. Not sure how well it would work for general use (i.e., selling it as a plugin on the market), but thought I'd gauge the interest from people. Basically the way this implementation works is only registered users can upload images, but everyone can view them. That requires 4 plugins in total - a "login" plugin, the uploader plugin, a menuscreen plugin (to show the list of images with associated text), and a "details screen" plugin (that shows the image a bit larger plus more detailed text). That's why this one probably isn't well suited for the plugin market, but great for custom works.
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
07/11/13 10:00 PM (12 years ago)
I'm sure it'll fit into a lot of plans. Nice work :) Cheers! -- Smug
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
07/11/13 10:02 PM (12 years ago)
Thanks :)
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
07/12/13 12:23 AM (12 years ago)
I figured out how to do this with flickr using there api but the login is a pain in the back side although it does take you out teh app and hook you back when registered. in ios7 when they release the flickr api for the social pack this should become a lot easier and certainly look a lot slicker than the email option
 
BuzzingSteve
Aspiring developer
Profile
Posts: 526
Reg: Jun 24, 2011
Vancouver, Cana...
11,660
like
07/12/13 12:32 AM (12 years ago)
Hey, Chris. You seem to be on a roll. How about creating a plugin for a directory type listing? e.g. Ability to add and/or display listings which include text/image. It could link to DropBox and some of the other storage offerings like Box.net, SkyDrive, etc. I would buy it :-) Let me know if you need more details, and if interested. Cheers
 
farcat
buzztouch Evangelist
Profile
Posts: 1008
Reg: Jan 27, 2012
France
13,230
like
07/12/13 05:13 AM (12 years ago)
Hi @Chris1, I am defo interested, I know of a couple of projects of mine that would need such a plugin! Farcat
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
07/12/13 06:41 AM (12 years ago)
Steve - I'd be happy to do something like that for you. Send me a pm with some more details of what you're needing and I'll give you a quote. Same with you, Farcat
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
07/12/13 06:50 AM (12 years ago)
Kittsy - good to know that iOS 7 wil make social media even easier. This one became a bit of a pain on the iOS side because of the file upload to a php script and inserting them back into the Buzztouch database. Turned out I was missing a small line of code in the midst of a complicated section. Also was a bit of a pain passing data back and forth between three plugins while outside of the app or standard BT control panel pages. On Android the pains were in converting between Drawables, Bitmaps, and Files, resizing them and saving them to disk, and then retrieving them, etc. Once again, things that can be done in a few lines of code on iOS take much more on Android.
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
07/12/13 07:19 AM (12 years ago)
This would lend itself well to an "iSquawk" capability. Within a town or a company, the user can report or squawk problems to be fixed such as: - leaky sprinklers - defective sidewalks - fire door not closing The missing part it seems is an ability to annotate or draw on the picture to point out a particular part of the picture. Nice work Chris, you are well on the way to mastering Android -- Niraj
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
07/12/13 07:23 AM (12 years ago)
Nice idea Niraj! It would be easy enough to add in the drawing option to iOS. Will have to look onto Android. Can't imagine trying to draw anything on my test device though - it has about a 3" diag screen!
 
Alex@TM
Apple Fan
Profile
Posts: 956
Reg: Dec 20, 2011
London, UK
10,560
like
07/12/13 09:39 AM (12 years ago)
I also had this nailed with the image emailer and flickr to display. Is your solution cleaner Chris? Cheers.
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
07/12/13 10:43 AM (12 years ago)
Not sure if it's any cleaner or not - haven't seen your solution. But it does differ in that it uploads it to a Buzztouch server, not flickr, and automatically inserts records into the BT_items table for another plugin to read from (i.e., displaying them in a menu screen). Also, mine is both iOS and Android - not sure if yours is or not?
 
Alex@TM
Apple Fan
Profile
Posts: 956
Reg: Dec 20, 2011
London, UK
10,560
like
07/12/13 10:53 AM (12 years ago)
Neither am I!! I'm new to Android and it is so clunky!
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
07/12/13 01:02 PM (12 years ago)
Remember that there is a paint plugin. That should be "good enuff" as a means to annotating the snapped picture. -- Niraj
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
07/12/13 01:14 PM (12 years ago)
Yeah - would take some modification to integrate it into my plugin, but definitely that's the starting point on iOS. We still need an Android paint plugin. :)
 
LA
Aspiring developer
Profile
Posts: 3280
Reg: Aug 16, 2012
Jerseyville, IL
42,900
like
07/12/13 01:54 PM (12 years ago)
I have found code on the web for Android paint but never got around diving in to it. LA
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
07/12/13 03:24 PM (12 years ago)
Don't stop, proceed past Android :-)
 
ThomasB
Lost but trying
Profile
Posts: 162
Reg: Jun 23, 2011
Palo Alto
3,270
like
07/15/13 01:15 PM (12 years ago)
Chris, not sure if this relates, but I've found a lot of customers who want to submit photos as a part of a web form entry. So let's say, they are filling out a form to report the condition of equipment they are surveying in the field. They would want to enter data and then snap an picture and have it logged as an integral part of the form. Does this kind of thing sound possible? -Tom
 
BuzzingSteve
Aspiring developer
Profile
Posts: 526
Reg: Jun 24, 2011
Vancouver, Cana...
11,660
like
07/15/13 01:22 PM (12 years ago)
@ThomasB. Great plugin idea :-)
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
07/15/13 01:37 PM (12 years ago)
Tom - absolutely. This plugin does almost exactly that. It allows the user to either select a photo already on their device or to take a new one, then send it off along with some text (could be any number of form fields) to a php script using the same logic as a webform. If you want me to build a custom plugin for you based around a particular form layout (perhaps a paper form that is currently used in the field), let me know. I do have about a 3 or 4 week backlog of requests at the moment though.
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.