[FEATURE REQUEST] Configurable root directories for Companion and APK

Hi @ewpatton and MIT AI Team,

Hope all is well and everyone is staying healthy and safe over there in Boston. Wanted to request a feature for AI2 where user can preset the root or main directories. One for using Companion and one for APK. Using the following as an example:

Continuing the discussion from JavaScript. Cubic regression:

Companion Directory:
file:///mnt/sdcard/AppInventor/assets/

APK Directory:
file:///android_asset/

Then we’d simply be able to use: /regresion_cubica.htm in the block editor to reference the file.

Kind regards,
Mike

UPDATE: Realize @Taifun provides an excellent extension to determine if production or development but I still think this should be considered as a native feature due to the uncertain state of extension working with iOS in the future.

2 Likes

Use the “PathToAssets” block in Taifun’s Tools Extension

2 Likes

I support your suggestion if for having this feature: You wont have to keep changing directories for test or production or companion or platform, that will be ideal.

1 Like

@Dro exactly. There is probably a better way that @ewpatton and his team can come up with. Just wanted to bring it up because I feel like it’s not only useful for the platform but also Directory stuff can be tricky for young app inventors and students - and it’s important that we maximize these guy’s time inventing and minimize their time debugging :100:

1 Like

There is a difference for a reason. AppInventor developers of all ages and skill level need to debug their apps when in development, thus the reason for the accessible assets folder during development. things are quite different once the app is compiled, with assets no longer accessible on the device except through the app. All MIT would do would be to adopt Taifun’s solution, but because it is there already, this probably won’t be a priority.

( I am no doubt wrong again on this, always get into trouble
when trying to second guess MIT’s priorities :wink: )

1 Like

Other reasons for the requested feature.
1- iOS support requires at least 2 more base iOS directories that will be different than Android directories.
2- From what I’m told extensions will not be supported in iOS version and even if gets supportin the future Taifuns extension will not be useful for iOS unless it is updated.

1 Like

On second thought. There should be no need to specify a folder for assets loaded in AI2.

1- When an asset is uploaded to AI2 during development AI2 app should not need to provide a folder. AI2 knows where the asset is because AI2 has saved the asset.
2- And AI2 Companion also should know where the asset is.
3- For the compiled app also AI2 knows where the asset is. Why should the app provide a folder? Isn’t the asset in the .apk itself?

I have come up with an other method for html files in assets that doesn’t require an extension, using the webviewer Error Occured event.

image

2 Likes