-
-
Notifications
You must be signed in to change notification settings - Fork 955
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hardcoded apps #1571
Comments
"At compile time" is something I hear a lot when referring to 3rd party apps, and I think we need to remember that most people don't want to recompile the OS every time an app is installed... |
@RageGamerBoi
I'm sure people are well-aware... It's just an inevitability at this point in time. |
Is this issue targeting some kind of AppController class? I guess for compile-time we could just import everything once in there and make everything else that handles apps use that controller. For dynamically loaded apps we would then reimplement the class to search the file system and load the apps from there. If there is any interest in (me) continuing #1408 from your side, that idea would fit there quite well, I think 😊 |
My idea:
According to recompilation for new apps installation, this isn't so bad. I have some developments, which allows to compile InfiniTime on Android smartphone with fancy UI. With ccache, it can be fast. |
Splitting in apps would be nice. Regarding the rest, do you have a good understanding how this this would work with FreeRTOS on the watch? There is some discussion about position independent code. Do you mean that? |
Position independent code allows to install binary apps inside already built firmware. This is the best solution, but at this point, this is too complicated. |
Ok, I get it now. So your code generator would more or less generate something like an AppController. But then you add the extra capability of rearranging the menu via a config file. I would say we do the following to work in little steps:
What do you think about this? |
This issue is essentially about removing the Apps enum. As long as we have the enum, we can't load any app that's not specifically handled by the firmware. A code generator will not fix the core issue. |
We need to figure out what to do about returnAppStack. Do we pass the apps just a DisplayApp reference or something more restricted, and the apps access it to get all their information? Any other ideas? |
The thing is, we need some sort of value for each app, regardless of if we have the enum or not. Besides the stack there is also the app menu that needs to communicate which app the user chose. One idea I had was (take this as a sketch ): class App : Screen {
virtual string GetSymbol();
virtual T GetId();
} Having a reference as the id instead is a clever idea.
This would be a facade and sounds like a good idea to provide a stable app-API to the developers. I don't know about the internals of constructor references, but I think your idea sounds good and is worth trying. |
I tried around a little bit and encountered a problem: how do we handle non-app screens? Does it make sense to dynamically register every possible screen to a screen manager? I don't think so. From my view there are:
For the core screens a hardcoded enum seems fine to me (at least for now). Settings are not as easy, because there are also app-related settings, but that is another issue. (I think we need separate setting files per app in the long run). App screens should be the ones that are handled as dynamically as possible. Update: |
A solution for this issue was implemented in #1894 . |
Verification
Introduce the issue
There's an entry for every single screen in DisplayApp. To add an app, the app must be added in the app enum and the switch statement in LoadScreen must always be updated. This is too rigid, if our goal is to support third party apps, be it selectable at compile time, or dynamically.
Preferred solution
Removing the Apps enum.
Version
No response
The text was updated successfully, but these errors were encountered: