Components

Last Edit: February 18, 2022

Notifier formats (referenced from Taifun)

If you have read the documentation for Notifier, you can find that there are many ways to format a notifier dialog (NOT AN ALERT).

For example...

<b> = bold text, <br> = new line, <font color = red>X</font> = X, etc. All of them are listed below:

<b>, <big>, <blockquote>, <br>, <cite>, <dfn>, <div>, <em>, <small>, <strong>, <sub>, <sup>, <tt>, <u>

"You can also use the font tag to specify color, for example, <font color="blue">. Some of the available color names are aqua, black, blue, fuchsia, green, grey, lime, maroon, navy, olive, purple, red, silver, teal, white, and yellow." ~Taifun

I'll give you an example (my own tests).

Full script:

App Inventor is <b>GREAT</b>! We have <font color = red> so mant </font> users! <br> Check that out <big>now</big> or you will regret it!

Equivalent to...

App Inventor is GREAT! We have so many users!

Check that out now or you will regret it!

Label formats

Same as Notifier, you can also do the same with a label using HTML formats.

BUT: Remember to check HTMLFormat in the Properties of the label.

Copy the text below.

App Inventor is <b>GREAT<b>! <br> We have <font color = red> so many </font> users! Check that out <big>now</big> or you will regret it!

Equivalent to:

App Inventor is GREAT!

We have so many users! Check that out now or you will regret it!

There is also a way to make a new line without HTML format, using \n. For example, a\nb is equal to:

a

b

Make sure it is \, not / if not HTML. You will not be able to preview this feature on Kodular, but you will see it in companion apps and your built APK.

JSON to Dictionaries

App Inventor: see this post.

Kodular: Use this extension.

Play a sound multiple (not infinite) times

Make sure you uncheck 'Loop' in the Player. If I want to play it 6 times, I use the following blocks.

Saving canvas annotations to a .PNG file

Changing MyDrawing.png to MyDrawing.jpg will allow the system to save the canvas as a .JPG file.

Drawing lines on a canvas

Disable Google Dialog for Speech Recognizer

Or, disable UseLegacy for the SpeechRecognizer in the Designer.

Get the name, thumbnail and audio link of a YouTube video*

Note: it took me 2-5 seconds to get the name and the audio for the video.

*Referenced from Salman's post, there is no need for an extension.

Q: What is an ID for a YouTube video?

A: Check the URL of the video. If the URL is https://www.youtube.com/watch?v=ABCDEFGHI, the ID is ABCDEFGHI.

Launching a website in Google Chrome

Uninstalling an app through MIT App Inventor (needs user confirmation)

Reading a TXT file in assets

Getting a dictionary of TinyDB entries

Set component heights and widths to automatic/fill parent in blocks

-1 refers to automatic, and -2 refers to fill parent. The same thing applies with the width of components.