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! While you're at it, check out some resources Treehouse students have shared here.

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

General Discussion

Advice 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 ...

  1. What languages would this require?

  2. Can you point me to any courses to help (treehouse or otherwise).

Thanks,

Adam

10 Answers

Dan Ridley
PLUS
Dan Ridley
Courses Plus Student 14,839 Points

Hello 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

OK thanks but do you have any advice as to the languages/courses?

Kunal Patel
Kunal Patel
1,448 Points

You need backend code on the mobile device, and PhoneGap is not going to cut it.

What type of phone is this for?

Hi Kunal, I thought that might be the case well actually it would be iPad.

Hi Kunal, I thought that might be the case well actually it would be iPad.

Also Kunal, could you provide a time estimate as to how long this app would take to create?

Kunal Patel
Kunal Patel
1,448 Points

This 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.

I 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
Kunal Patel
1,448 Points

That 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?

Pretty much yes, do you think a better angle to go from would be a responsive website?

Kunal Patel
Kunal Patel
1,448 Points

Either 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.

Amit Bijlani can you help?

Amit Bijlani
Amit Bijlani
Treehouse Guest Teacher

If 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.

OK much appreciated. Could you estimate timescale?

And also can you please recommend a suitable open source barcode scanner?

Amit Bijlani
Amit Bijlani
Treehouse Guest Teacher

Time 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/

Thanks, Amit, I appreciate your input!!

One last question...what approach would you take? native or phonegap (taking my experience into consideration)

Amit Bijlani
Amit Bijlani
Treehouse Guest Teacher

Definitely PhoneGap but you already knew that ;)

Randy Hoyt do you have any advice please? Or could you tag the appropriate teacher?

Andrew 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
Andrew Chalkley
Treehouse Guest Teacher

It's a little specific but it's you should be able to do a WHERE clause on a barcode :)

OK cheers ;)