Call procedure in a different screen?

sounds interesting, can you please show a block as an example? Thanks

using like 10 full-screen layouts in 1 screen, I felt it would be a bit messy, but never tried, maybe it won't be as messy as I thought. Showing and hiding these layouts would also introduce a lot of redundance. Will give it a try if no better approach is available. Thanks

looked at the linked page, sounds too good to be true for my original question. It seems that we do not even need to specify which screen the procedure block is in (i guess as long as the name of the procedure is unique throughout the whole app).

You can use a separate function for that as well.

I have some thoughts to be shared..

If we think of web pages, and some design patterns, webpages are logically separated units. Each Webpage has its oven data and function to work on. Having said It doesn't mean that I am ignoring the importance of sharable functions, like, Utility Classes.

Here, screens are logically separated entities, but not mutually exclusive units.

Here, we need to think, if AI2 introduce procedure sharing capability, will it be putting overhead to the system or will make things easier. Do we have alternative available to do our job without this new feature. This would be the part of feasibility analysis.

Along with that I understand that scope for improvement is always there, but improvement in what direction, that we need to select from the candidates available and this is how a software products evolve.

2 Likes

Another option would be to outsource the function(s) to JavaScript/html file with getting access from all screens. You only would have to load that file into your screen and run the function(s) wanted using the "RunJavaScript" block with communication/exchange of data over the "WebViewString".

1 Like

and load a webviewer component.....

1 Like

A few days ago, for some experiment with an extension, it's possible for an Extension to access all the functions of the App. They are static functions (methods) that can be called by anything, it did work worked, but the problem was to locate the function.

Func.aia (7.4 KB)

An example, an AIA with 2 screens and the 2nd screen calling a procedure from the first one and displaying return value in a label. Built APK.

I've got the procedure in a different screen working for inbuilt blocks, not sure if components would work too.

1 Like

Thanks for the info, which one works well: async or this extension?

A post was split to a new topic: Extension: Call Procedures In a different Screen

I tried, when importing, it says "upload error" after i press "import". So the extension does not appear under "extension"

That seems to be your internet problem.

1 Like

tried at different time, no problem with internet connection. Other extensions import fine.

Can you say me the Error message?

"upload error" in red

Could you show me its screen shot?

try this: https://ullisroboterseite.de/android-AI2-CommonEvents-en.html

This is a workaround.

It only works when installed, not with MIT Companion.

Procedure_Varias_Screens.aia (3.8 KB)

3 Likes

tried to get a screen shot, but a surprise, it did import successfully (the same old file that did not import many times before, not sure why). Thanks to everyone here.

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.