kenglxn / QRGen

a simple QRCode generation api for java built on top ZXING
http://glxn.net/2012/03/10/qrgen-a-small-wrapper-on-top-of-zxing-for-generating-qrcodes-in-java
1.49k stars 299 forks source link

Examples from README just don't compile #124

Closed paulvi closed 1 year ago

paulvi commented 5 years ago

Examples from README just don't compile

import net.glxn.qrgen.core.image.ImageType;
import net.glxn.qrgen.core.scheme.EMail;
import net.glxn.qrgen.core.scheme.MMS;
import net.glxn.qrgen.core.scheme.MeCard;
import net.glxn.qrgen.core.scheme.SMS;
import net.glxn.qrgen.core.scheme.VCard;
import net.glxn.qrgen.javase.QRCode;

// https://github.com/kenglxn/QRGen
public class GenerateQRCodeWithKenglxnQRGen {
    protected static Logger logger = LoggerFactory.getLogger(GenerateQRCodeWithKenglxnQRGen.class);

    public static void main(String[] args) {
        ....

        // encode mms data
        MMS mms = new MMS("Hello World");
        QRCode.from(mms).file();

        // encode sms data
        SMS sms = new SMS("Hello World");
        QRCode.from(sms).file();

        // encode MeCard data
        MeCard johnDoe2 = new MeCard("John Doe");
        johnDoe.setEmail("john.doe@example.org");
        johnDoe.setAddress("John Doe Street 1, 5678 Doestown");
        johnDoe.setTelephone("1234");
        QRCode.from(johnDoe).file();

image

kenglxn commented 5 years ago

I'm inclined to close this issue. This is not enough information for anyone to help you with this issue.

What version are you using, what is your build setup, what does your classpath look like?

paulvi commented 5 years ago

Well, automatic build is usually guarantee that a code base can compile.

Should adding CI like travis-ci be other issue?

kenglxn commented 5 years ago

No problem with the CI setup in this project as far as I know. (https://travis-ci.org/kenglxn/QRGen)

You are claiming the examples don’t work, but give no details on your setup. It is impossible to say what is wrong based on that screenshot alone. You are assuming this is a problem in the QRGen library, but I see no evidence for that. If you could supply the details I suggested above then it would be possible to help you analyze the problem.

Another approach would be for you to submit a PR that shows the bug.

paulvi commented 5 years ago

OK, then add build status button to README, and issues like this are not to appear

kenglxn commented 5 years ago

There is a status button in the readme

paulvi commented 5 years ago

Indeed, then it goes only to me, while a month ago I ran into compilation issue

paulvi commented 5 years ago

Oh, I recollected:

The sources are OK, but example in README.md is likely to be not updated.

kenglxn commented 5 years ago

If there is an issue in the readme regarding the use of MMS and SMS it would be nice to get that fixed.

But first I need to be sure what causes the error for you so I know that there is an error in the readme.

paulvi commented 5 years ago

Just paste code from current README into a new class

kenglxn commented 5 years ago

Thanks for clearing this up. Looks like the SMS and MMS constructors are not matched the readme examples. These classes could use a refactoring anyway. At the very least the readme needs updating.