Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community!
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial

Adam Flanagan
8,022 PointsAdvice Needed Urgently
Hi, Treehouse!
I need urgent advice. I want to make an app using HTML and CSS (via phonegap) that also has the ability to read barcodes then return an HTML page based on that barcode. (Would this require database) I am proficient in HTML and CSS but need to learn everything else. So my question is ...
What languages would this require?
Can you point me to any courses to help (treehouse or otherwise).
Thanks,
Adam
10 Answers

Dan Ridley
Courses Plus Student 14,839 PointsHello Adam,
I am not exactly sure if you would be needing a database or not but let me tag in Andrew Chalkley the Database teacher at Treehouse and see if we can get an answer for you.
Dan

Andrew Chalkley
Treehouse Guest TeacherI haven't used PhoneGap before but there is a storage API here - http://docs.phonegap.com/en/3.0.0/cordova_storage_storage.md.html#Storage
Hope that helps.

Adam Flanagan
8,022 PointsOK thanks but do you have any advice as to the languages/courses?

Kunal Patel
1,448 PointsYou need backend code on the mobile device, and PhoneGap is not going to cut it.
What type of phone is this for?

Adam Flanagan
8,022 PointsHi Kunal, I thought that might be the case well actually it would be iPad.

Adam Flanagan
8,022 PointsHi Kunal, I thought that might be the case well actually it would be iPad.

Adam Flanagan
8,022 PointsAlso Kunal, could you provide a time estimate as to how long this app would take to create?

Kunal Patel
1,448 PointsThis sounds very generic "read barcodes then return an HTML page based on that barcode"
Are you saying you have these barcodes and pages? Or are you searching the web or something?
You need to research barcode reader frameworks or similar online.
If its all your data and info, its going to be faster to build. I don't know IOS yet, since I am learning Android, but you probably can render the html into a view or you will have to code the UI natively as well. Again I am not sure about that, you can research UI and Html for mobile separately from the reader part.

Adam Flanagan
8,022 PointsI would have a pool of barcodes then, if the scanned barcode was in that pool, then the corresponding html file would be pulled up?

Kunal Patel
1,448 PointsThat sounds pretty reasonable.
I found this on barcode reading
http://stackoverflow.com/questions/838724/is-there-a-barcode-recognition-framework-for-ios
I don't want to say how to do the UI part since I don't know, but there probably is way to render in the views the html file you have into the screen.
I'm guessing you can keep the barcode long var in the table with the file name of the local file to render up. Then let the controller get the input from the barcode api, convert it, do a look up and send off the correct resource.
That's what you are planning to do right?

Adam Flanagan
8,022 PointsPretty much yes, do you think a better angle to go from would be a responsive website?

Kunal Patel
1,448 PointsEither way you gotta code the native part to capture the barcode. However that being said, you could just decode the # put it in a get request and then post the url to your responsive site and load the html in the browser.
You'll have to build an authentication mechanism as well if you need to keep this info private.
What you gain is a simpler coded app, and reusable service which Android devices can use.

Adam Flanagan
8,022 PointsAmit Bijlani can you help?

Amit Bijlani
Treehouse Guest TeacherIf you want to build an app using PhoneGap which means you want to submit it the app store. Then HTML/CSS will suffice but if you want to use device functionality and retrieve information from a database then you need to know JavaScript. I didn't see you mention that you know JavaScript. You will need to store this data somewhere and I would recommend Parse. They have a good tutorial on how you can store data in the cloud and display it on a webpage: https://parse.com/tutorials/todo-app-with-javascript. Once you've built the app then you can package it up using PhoneGap. But you first need to focus on simply building the app. You will not get any specific tutorial to teach you exactly what you want. The Parse tutorial is your best bet. One last suggestion, you will not be retrieving an html page based on a barcode. You will simply retrieve data and display it on the webpage.

Adam Flanagan
8,022 PointsOK much appreciated. Could you estimate timescale?

Adam Flanagan
8,022 PointsAnd also can you please recommend a suitable open source barcode scanner?

Amit Bijlani
Treehouse Guest TeacherTime scale is completely dependent on your skill and experience level. Only you can estimate how long something like this will take you to build. Sorry, I know it's not the answer you are looking for but I would create a list of features / functionality and all the steps it will take you to get there. Then I would associate a time estimation for each of those steps. That's how you can arrive at a time estimate.
PhoneGap has a barcode scanner plugin: http://phonegap.com/blog/build/barcodescanner-plugin/

Adam Flanagan
8,022 PointsThanks, Amit, I appreciate your input!!

Adam Flanagan
8,022 PointsOne last question...what approach would you take? native or phonegap (taking my experience into consideration)

Amit Bijlani
Treehouse Guest TeacherDefinitely PhoneGap but you already knew that ;)

Adam Flanagan
8,022 PointsRandy Hoyt do you have any advice please? Or could you tag the appropriate teacher?

Adam Flanagan
8,022 PointsAndrew Chalkley I started Database foundations but will this cover how to bring html pages based on the barcode? well obviously that is too specific but something along those lines

Andrew Chalkley
Treehouse Guest TeacherIt's a little specific but it's you should be able to do a WHERE clause on a barcode :)

Adam Flanagan
8,022 PointsOK cheers ;)