Search code examples
androidzxing

making q.r. reader with zxing without installing external app using Android studio


Yes there are plenty of answers of this question on this site, but i am a newbie and having difficulties managing eclipse code examples in android studio. Suggest answers by considering me a beginner please(step by step). So many links, which to open? which projects library to embed? and which java files to be used in my case?


Solution

  • Consider this awesome open source project: https://github.com/dlazaro66/QRCodeReaderView It's easy to implement and you only need to add a dependency in your module's build.gradle (not the project one)

    dependencies {
        ...
        compile 'com.dlazaro66.qrcodereaderview:qrcodereaderview:1.0.0'
    
    }
    

    the rest is intuitive:

    • You use an element in your layout witch will be the QRCodeReaderView (take a look at the project's layout file)
    • You will need to add the permission to the manifest file

      <manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.myawesomeapp">
      
      <uses-permission android:name="android.permission.CAMERA" />
      
      
      <application
          ...
      </application>
      

    Let me know if you have any questions