Android QR code reading libs - qr-code

I have an Android QR code reading app that runs on a cheap phone with no autofocus. QR code that I must read is small and on camera preview looks blurry. The one app able to read this code is NeoReader.
Does everybody know good free libraries to read QR codes?
I know that:
ZBar (it's ok but not works with blurry code)
ZXing (this Barcode reader not reads the required code; don't tried to integrate)
NeoReader SDK (not free)
My init code for ZBar:
scanner = new ImageScanner();
scanner.setConfig(0, Config.ENABLE, 0);
scanner.setConfig(Symbol.QRCODE, Config.ENABLE, 1);
scanner.setConfig(0, Config.X_DENSITY, 1);
scanner.setConfig(0, Config.Y_DENSITY, 1);

If none of the four above is an option (or even if they where!) I would strongly suggest using Googles own library found in Google Play services under the namespace com.google.android.gms.vision.barcode. It scans the codes locally, fast and robust, and you have full control of the source code in just a few classes.
For a simple example check out Android QR Code Reader Made Easy. That should get you up and running in no time! There's also further reading linked at the end of the post for advanced examples.

Related

Xamarin scanner for small Barcodes / QRCodes

I am working on a Xamarin QRCode scanner prototype and the aim is to make the App being able to scan QR codes as small as 1.8/1.8 mm. I have tried the GoogleVision and also the ZXing. The GoogleVision is able to scan them but it is not convenient at all since it hardly depends on the Camera quality, position, illumination, and stability. Also tried Camera / Image Scannig to take a picture while the user is able to zoom on the QR code, still so hard to do that for a user (it cannot detect the QR code 9 out of 10).
TBH, I have searched a lot and manipulated these libraries and couldn't get it to work. On the other hand, there are Apps on the market that they can simply scan these small QR codes. (which I believe they are not based on Xamarin) I have noticed some of them are using ZXing but I couldn't find any useful information on how they are managing these small QR Codes! So my question is:
Is it possible to use Xamarin and ZXing or GoogleVision for this matter? If yes, any further information would be hugely appreciated.
Is there any library that can handle these small QR codes (Commercial or non-commercial)?
Thank you in advance.
Cheers 🤘

Is there an easy to use way to print a small file as QR-Code on a sheet of paper?

Assume I have sensitive information (passwords, private keys,...) that I saved to a file which I encrypted.
Is there an easy to use tool to convert back and forth between a small file (say 0.5kB) and an image (QR code?) that I can print out to have a safe backup?
You can use LaTeX with the ps-tricks and pst-barcode modules, it produces nice QR codes, and yesm we used it exactly for this purpose: Paper backup of SSH private keys.
Denso Wave of QR code developer distributes software on their site.
Membership registration on the site is required to obtain it.
Even if you can not print with this, there are various tools regardless of free/commercial, so please search.
The maximum amount of data that can be stored in the QR code is 2953 bytes in binary mode.
However, it depends on the ability of the scanner to use.
QR code FAQ #6 Can an image or sound be stored in a QR Code?
I wrote a linux program to do this, called qr-backup.
In researching similar programs as part of it, I discovered a number of alternative projects as well. All of these are also linux-only.
asc2qr.sh
paperbackup. Focused on GPG/SSH key backup. See also the paperkey preprocessor, to reduce the size of keys.
qrdump (incomplete)
qrpdf
If your file is very small (0.5KB is a good cutoff), you can generate one single QR code. An example command-line program to generate it is qrencode. Several web converters are also available.

KDE Taskbar Progress

I am trying to show a progress in the taskbar of the plasma desktop using the KDE Frameworks. In short, it want to do the same thing as dolphin, when it copies files:
I'm kinda stuck, because I don't even know where to get started. The only thing I found that could be useful is KStatusBarJobTracker, but I don't know how to use it. I could not find any tutorials or examples how to do this.
So, after digging around, and thanks to the help of #leinir, I was able to find out the following:
Since Plasma 5.6 KDE supports the Unitiy DBus Launcher-API, which can be used, for example, to show progress
I found a post on AskUbuntu that explains how to use the API with Qt
The real problem is: This only works, if you have a valid desktop file in one of the standard locations! You need to pass the file as parameter of the DBus message to make it work.
Based on this information, I figured out how to use it and created a GitHub repository, that supports cross platform taskbar progress, and uses this API for the linux implementation.
However, here is how to do it anyways. It should work for KDE Plasma and the Unity desktop, maybe more (haven't tried any others):
Create a .desktop file for your application. For test purpose, this can be a "dummy" file, that could look like this:
[Desktop Entry]
Type=Application
Version=1.1
Name=MyApp
Exec=<path_to>/MyApp
Copy that file to ~/.local/share/applications/ (or wherever user specific desktop files go on your system)
In your code, all you need to do is execute the following code, to update the taskbar state:
auto message = QDBusMessage::createSignal(QStringLiteral("/com/example/MyApp"),
QStringLiteral("com.canonical.Unity.LauncherEntry"),
QStringLiteral("Update"));
//you don't always have to specify all parameters, just the ones you want to update
QVariantMap properties;
properties.insert(QStringLiteral("progress-visible"), true);// enable the progress
properties.insert(QStringLiteral("progress"), 0.5);// set the progress value (from 0.0 to 1.0)
properties.insert(QStringLiteral("count-visible"), true);// display the "counter badge"
properties.insert(QStringLiteral("count"), 42);// set the counter value
message << QStringLiteral("application://myapp.desktop") //assuming you named the desktop file "myapp.desktop"
<< properties;
QDBusConnection::sessionBus().send(message);
Compile and run your application. You don't have to start it via the desktop file, at least I did not need to. If you want to be sure your application is "connected" to that desktop file, just set a custom icon for the file. Your application should show that icon in the taskbar.
And thats basically it. Note: The system remembers the last state when restarting the application. Thus, you should reset all those parameters once when starting the application.
Right, so as it turns out you are right, there is not currently a tutorial for this. This reviewboard request, however, shows how it was implemented in KDevelop, and it should be possible for you to work it out through that :) https://git.reviewboard.kde.org/r/127050/
ps: that there is no tutorial now might be a nice way for you to hop in and help out, by writing a small, self contained tutorial for it... something i'm sure would be very much welcomed :)

QT5 QSound does not play all wave files

I am in the midst of migrating our app based on QT4.X to QT5. Phonon support has been removed in QT5, so I have changed my code that plays a wave file to use QSound.
Change is pretty straightforward. I just had to use QSound, which is now located in Multimedia library. Here is the code:
QSound::play("small_wave_file.wav");
For most of my wave files, this works just fine; however, for my wave file(with 44100Hz sample rate) it does not work.
Official QT bug can be found here.
UPDATE: This bug has been fixed in qt 5.1
It turns out that some wave files confuse QSound. Still not sure exactly what causes the issue. When I loaded my wave file in Audacity, and then exported it back to a different wave file without any changes(same sample rate...). QSound played the file just fine.
In MacOSX when I click "Get Info" on the problematic wave file, general wave info record from the wave file was not available; so perhaps QSound was unable to get sample rate information from; and because it did not know which sample rate to expect from the wave file?
The interesting part is that iTunes played the original file just fine, and it had the correct sample rate somehow. Also Phonon used to play the original file as well just fine.
Anyhow, hopefully this helps with some people that had issues with QSound::play() method.
UPDATE: Since QSound::play() was very buggy on the mac, I opted to use the native NSSound to play my wave files from QT application on the mac. Here is the code:
void play_sound( const char* file)
{
NSSound *sound = [[NSSound alloc] initWithContentsOfFile:[NSString stringWithUTF8String:file] byReference:NO];
[sound play];
[sound release];
}
Also note that Qt has several different sound playback APIs. For small file playback with lower latency I found this to be much faster:
http://doc.qt.io/qt-5/qsoundeffect.html#details
Also:
http://doc.qt.io/qt-5/qmediaplayer.html

How to generate QR codes using library in .Net

I am planning to explore on QR code generation . I saw the google api http://chart.apis.google.com/chart?cht=qr&chs=75x75&chl=test and its pretty impressive. But it works only for URL's and small data's. So i am thinking about writing a .net app to generate the QR code. So any information on libraries to start with ,will be helpful.
Thanks,
It does not just work for URLs. You can put whatever text you want as an argument (just URL-encode it correctly). It also works for any data size that QR codes can support.

Resources