Write code in Gradle

Hello. I want to build a qr code reader with zxing. Therefore I need to write some code in the gradle files. If i export my project, I can change these files, but how can I run that on my device?