To generate barcode in an android programmatically create a new Android Studio project and add it to ZXing (barcode image processing library). Set up a dimensions file to hold the size of your barcode image. Create a layout and edit the file by adding a function to generate a barcode. Finally Re-run the app and your barcode will be generated.