QR

Extension published on December 20, 2021

🏷️ Tags: #extensions

This is the first extension I published on this website - QR. Basically, it helps you to generate a QR code, but it returns a link that redirects to the QR code. It is oftenly used with the Image component, when the image shows the QR code.

Made with Niotron IDE at https://ide.niotron.com.

Current version: 2 Package name: com.gordonlu.qr

For more information, read this MIT App Inventor Community thread.

πŸ“– Documentation

Method blocks

AvailableFormats - Returns a list of all available formats of your QR code. Available formats are UTF-8, Shift_JIS and ISO-8859-1. Returns: list

GenerateQRLink - Returns a link of your QR code.

The height and width must only be integer text, no number blocks are allowed. This bug will be fixed. Type is the format of your QR code, and leaving in blank leads to the default UTF-8 format. The code is the text encoded. Leaving code blank will cause code to be UTF-8. Returns: text

Parameters: code = text, height = text, width = text, type = text

Usage Example

Open Source

package com.gordonlu.qr;


import android.app.Activity;

import android.content.Context;

import com.google.appinventor.components.annotations.*;

import com.google.appinventor.components.common.ComponentCategory;

import com.google.appinventor.components.runtime.AndroidNonvisibleComponent;

import com.google.appinventor.components.runtime.ComponentContainer;

import com.google.appinventor.components.runtime.EventDispatcher;

import java.util.*;


@DesignerComponent(

version = 2,

description = "This extension helps you to generate a valid link for your QR code.",

category = ComponentCategory.EXTENSION,

nonVisible = true,

iconName = "https://docs.google.com/drawings/d/e/2PACX-1vQCI87PHLBF0jb8QWyYmIRQSjjNW3EFXf-qpsWCvBYkUQ9vEgPAB8SpxcMpblxNpbIYrjCjLrRLIU2c/pub?w=16&h=16")


@SimpleObject(external = true)

//Libraries

@UsesLibraries(libraries = "")

//Permissions

@UsesPermissions(permissionNames = "")


public class QR extends AndroidNonvisibleComponent {


//Activity and Context

private Context context;

private Activity activity;


public QR(ComponentContainer container){

super(container.$form());

this.activity = container.$context();

this.context = container.$context();

}


@SimpleFunction(description = "Returns all available formats of the QR code.")

public static List<String> AvailableFormats () {

List<String> formats = new ArrayList<>(); /* We create an empty list */

formats.add("UTF-8");

formats.add("Shift_JIS");

formats.add("ISO-8859-1"); /* Then we add items to the list */

return formats;

}


@SimpleFunction(description = "Generates a link for the QR code.")

public String GenerateQRLink (String height, String width, String code, String type) {

String make = "https://chart.googleapis.com/chart?cht=qr&chs=" + height + "x" + width + "&chl=" + code + "&choe=" + type;

return make;

}


}

TERMS AND CONDITIONS

By downloading or sharing my extension, you agree to follow these terms and conditions.

  1. Have fun using the extension!

  2. This, along with the MIT App Inventor original post above, are the only authorized places to download this extension. As an organization, you are not allowed to host and advertize this extension on your website, document, tweet, blog, article or any software you made without my authorization. You are also reminded not to include a direct download link of this extension on your website without my permission. If you are interested in the actions listed above, please contact me via email. Do remember that if you violate term no. 2, AICODE has the right to flag your website, document, tweet, blog or article as a violation of copyright, or other legal actions will be taken. Please contact me if you find anyone do this.

However, you can copy the link of this webpage and share it to someone as a personal identity (not as an organization), or sharing it on these authorized forums: App Inventor, Kodular, Niotron, Appzard and Android Builder communities. The term organization includes schools, markets and app stores, companies and social groups. Thank you for your understanding.

Those organizations are authorized to advertize or host my extension:

  • Kodular admins

  • MIT App Inventor admins

  • Pura Vida Apps / Taifun Baer

  1. Selling this extension/product to anyone is not allowed unless authorized by AICODE.

  2. You are allowed to modify this extension using my source code. You can choose to give credit or not to me.

  3. These terms and conditions are written and issued on December 20, 2021. AICODE has the total permission to edit these terms and conditions anytime.