Regarding generating barcodes:
1. Code 39, Code 128, QR Code, etc... all they are barcode types (a.k.a. Symbologies or Standards) which state how a barcode symbol needs to be generated. Some are linear barcodes i.e. just bars while others (like QR Code) are called 2D barcodes because they can encode great amount of data in small shapes. Most 2D barcodes uses little squares modules instead of bars. Some symbologies allow just numbers, while others allow you full ASCII and others any char (byte), etc. Just google to get further info on this topic.
2. You have to choose one symbology for your system based on your requirements (like you need to encode just digits, or alphanumeric, etc) and then look for some encoder to get the barcode symbol in your app. For linear you can find some free fonts out there (although I'd not recommend them) or some open source project like
https://github.com/zxing/zxing[
^]