Skip to main content
7 events
when toggle format what by license comment
May 23, 2017 at 12:37 history edited CommunityBot
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Jan 23, 2014 at 13:02 comment added VictorB Thanks. That's a good idea which I'll have to check out.
Jan 23, 2014 at 13:01 comment added wes @VictorB rolling your own would surely be your best bet. Depending on how complex you're wanting to get, you could put the values for each platform into a configuration file with a lookup based on the application type and grab each set of values when you need them (similar to how people do multi-language applications -- that might be a good area to research. Instead of languages, you'd be using platforms)
Jan 23, 2014 at 12:57 comment added VictorB Thanks. I had a similar idea too. Given that platform specific code is required in a fair number of screens, both for rendering and input processing (for example making use of the accelerometer on Android as opposed to keyboard on Desktop), I was wondering whether there is a specific approach, even design pattern, if you will, that people use in their practices that I could adopt too. Otherwise I could waste time trying things not worth trying and I don't exactly want that. If there is no such thing, then I will have to conform and do things my way.
Jan 23, 2014 at 12:51 comment added wes @VictorB you could abstract your classes out into implementations that will be called for each platform
Jan 23, 2014 at 12:44 comment added VictorB Yes, thanks. But this is what I do at the moment. I was wondering though whether there's a more general approach than simply checking the ApplicationType each time I need platform specific code.
Jan 23, 2014 at 12:39 history answered wes CC BY-SA 3.0