Some good QR code reader libraries in Kotlin?

kotlin · · 111 次点击    
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
<p>I&#39;m making an app for my shop which scans QR codes and sends data to server to update stock. Since Kotlin is fairly new, I couldn&#39;t find libraries for QR scanner. Please suggest some good libraries that you&#39;ve used or you&#39;re aware of. Thank you!</p> <hr/>**评论:**<br/><br/>Sleepkever: <pre><p>There probably aren&#39;t any yet to be honest. Great thing about kotlin is that it can still interface with any java code. </p> <p>You can probably use any existing Android barcode scanner (zxing looks like a good place to start). If you encounter any example code just copy paste it into a kt file and intellij will convert it for you to somewhat decent kotlin code. </p> <p>The way you call it might feel more &#34;java&#34; then &#34;kotlin&#34; but it will definitely work just as good.</p></pre>sedgecrooked: <pre><p>I&#39;ll check zxing then. The reason I chose kotlin was to avoid java. But it seems like there is no other option.</p></pre>Sleepkever: <pre><p>You can interface with the java classes provided by a library just like you would with any other kotlin code. The only thing is that null safety is not guaranteed anymore, so keep an eye out for that. If you check the return type in kotlin it&#39;s probably something like type! Which means it might or might not be null ( like type?) , but kotlin isn&#39;t going to force you to check it. Unless the library is properly annotated with @nullable or @nonnull, then you are golden.</p></pre>thedomham: <pre><p>Why did you want to avoid Java in the first place? </p></pre>sedgecrooked: <pre><p>Because I don&#39;t know Java. I started directly with Kotlin. I have invested a lot of time in Kotlin.</p></pre>nutrecht: <pre><p>You don&#39;t have to write Java to use Java libraries though, that&#39;s the beauty of the integration. </p></pre>Real_Life_Human: <pre><p>If you&#39;re developing for android, how about the Android Mobile Vision API?</p></pre>
111 次点击  
加入收藏 微博
0 回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet