ToolsForAI2 extension

I created this extension because I needed a few methods that are not in the built-in blocks.

Blocks:

This block turns on Bluetooth without user interaction.
component_method (7)

This block turns off Bluetooth without user interaction.
component_method (6)

This block checks whether the location service is enabled. Returns true or false.
Useful when using the BLE extension.
component_method (8)

This block changes the text string to Hexadecimal data. For example, "App Inventor" will turn into "41707020496E76656E746F72" and ":smiling_imp:" will turn into "F09F9888".
component_method (9)

This block changes the Hexadecimal data to text string. Reverses the operation of the previous block.
component_method (10)

This block adds zero leading to text or numbers. "length" specifies the length of the text along with leading zers. For example, string "24E1F0" with lenght 10, will turn into "000024E1F0".
component_method (11)

This block converts a integer positive decimal number to a hexadecimal number. "length" specifies the length of the output number along with leading zers. For example, string "2458" with lenght 8, will turn into "0000099A".
component_method (12)

Extension:
com.extension.ToolsForAI2.aix (8.8 KB)

A project showing how blocks work:
extension_test_app.aia (198.4 KB)

10 Likes

nice @Patryk_F :slight_smile:

1 Like

Good job :+1:
However, Android no longer allows to enable/disable Bluetooth without user interaction.
Even in some not so latest versions you need Bluetooth Admin permission.

Thanks. Yes, this permission is added to the extension. Works on android 10.

2 Likes

hi Patryk_F
I used the block of your extension that checks if the location service is enabled and it works perfectly. Thanks for sharing it, good job. A few days ago, before I found the extension you built, I was trying to create that block and finally couldn't validate it correctly. If you don't mind sharing (or guiding me) the construction of that single block, I would be very grateful.

I used the code from the 3rd post: