Skip to content

vknow360/NativeUtils

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NativeUtils Extension

MIT App Inventor and Kodular extension to dynamically download, extract, and load native Android libraries (.so files) at runtime.

Features

  • Dynamic Loading: Fetch native libraries from a web URL, App Assets (//), or local device storage.
  • Architecture Aware: Automatically detects the device's CPU architecture (ABI) and loads the correct .so variant from your .zip.
  • Caching: Only unzips and processes files if they haven't been loaded or cached already.
  • Asynchronous: Downloads and file extractions don't freeze the UI.

Blocks

Methods

  • Load(String source) - Loads a zipped set of native libraries from an http(s):// URL, //asset.zip, or local ile://.
  • IsLibraryLoaded(String libraryName) - Returns rue if the library zip has already been processed/cached.
  • GetSupportedABIs() - Returns a list of supported ABIs for the current device.
  • GetPreferredABI() - Returns the most fitting ABI for the device.

Events

  • GotDownloadProgress(int progress) - Fires when downloading a ZIP from a URL.
  • ZipDownloaded(String zipFile) - Fires once the file is fully downloaded/copied.
  • LibsLoaded(YailList libPaths) - Fires when the native libraries are successfully loaded into memory.
  • ErrorOccurred(String errorMsg) - Fires if something goes wrong.

Usage

Simply bundle your .so files organized by their ABI directories (e.g. arm64-v8a/libtest.so, armeabi-v7a/libtest.so) into a .zip file, and pass it to the Load() method!

About

Dynamically inject and use Native libraries in extensions

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages