Acknowledged
CIQQA-4127

Add device identifier variable to Monkey Jungle

It would be very helpful if Monkey Jungle provided a built-in variable for the target device identifier (e.g. fr255, fenix7) during the build process. Currently, device-specific handling often requires defining paths per device. Introducing a predefined variable such as $(device) that resolves to the current target device would enable dynamic inclusion of device-specific directories in source and resource paths and remove the need to define paths separately for each device.

For example:

base.sourcePath=somedirectory/$(device)
Parents
  • I don't know what your apps look like, but in mine I have "features", and each feature can have a number of variations. Some variations depend on display shape (i.e: round vs rectangle), some on display size, some on number of buttons, some whether the device has some hardware component, etc. I have a python script that generates the monkey.jungle file based on all these. But in terms of source, resource files I don't need to have 200 different files (one for each device), just a few one for each feature. And since I'm generating the monkey.jungle file, I can have whatever directory structure I want (similar to yours).

    I didn't understand what you wrote about the properties. Why do you need a class for each device? How is it different from using properties? You can only store user's preferences in properties or storage. If they saved some value then either you use it or you don't, but you don't really need a class for each device for that. The same code can deal with every device. You can have a few inputs if you want to compare things to the default. But these defaults usually depend on screen size, etc, so again, I just have a file with the constants in each directory (1 directory can be 1 variation of 1 feature), and my getters look like: getConfig(key, defaulValue). If you want to be fancy, then you can even save the default at the time the app was installed, and compare whether the default of the current version is different from the default at the time the app was installed, though I'm not sure what can you do with it if it's different from the original default. Would you override it with the new default, even though the user seemingly wanted something different from the value you thought will be the best choice for most users?

Comment
  • I don't know what your apps look like, but in mine I have "features", and each feature can have a number of variations. Some variations depend on display shape (i.e: round vs rectangle), some on display size, some on number of buttons, some whether the device has some hardware component, etc. I have a python script that generates the monkey.jungle file based on all these. But in terms of source, resource files I don't need to have 200 different files (one for each device), just a few one for each feature. And since I'm generating the monkey.jungle file, I can have whatever directory structure I want (similar to yours).

    I didn't understand what you wrote about the properties. Why do you need a class for each device? How is it different from using properties? You can only store user's preferences in properties or storage. If they saved some value then either you use it or you don't, but you don't really need a class for each device for that. The same code can deal with every device. You can have a few inputs if you want to compare things to the default. But these defaults usually depend on screen size, etc, so again, I just have a file with the constants in each directory (1 directory can be 1 variation of 1 feature), and my getters look like: getConfig(key, defaulValue). If you want to be fancy, then you can even save the default at the time the app was installed, and compare whether the default of the current version is different from the default at the time the app was installed, though I'm not sure what can you do with it if it's different from the original default. Would you override it with the new default, even though the user seemingly wanted something different from the value you thought will be the best choice for most users?

Children
No Data