<p>Is it possible to have one application binary build for multiple mobile devices (on <a href="http://brew.qualcomm.com/brew/" rel="nofollow noreferrer">BREW</a> platform), rather than making a separate build for each device using build script with conditional compilation.</p>

<p>In particular is is possible to use single BREW application build for multiple screen resolutions?</p>

<p>Note that the goal is to have a single <em>binary</em> build. If it would be just to have a single codebase, than conditional compilation and smart build script would do the trick.</p>

[{'answer_id': 75166, 'author': 'Shane Breatnach', 'author_id': 10264, 'author_profile': 'https://Stackoverflow.com/users/10264', 'pm_score': 3, 'selected': True, 'text': "<p>Yes, it is possible, we were able to do this at my previous place of work. What's required is tricky though:</p>\n\n<ol>\n<li>Compile for the lowest common denominator BREW version. Version 1.1 is the base for all current handsets out there.</li>\n<li>Your code must be able to handle multiple resolutions. The methods for detecting screen width and height are accurate for all handsets in my experience.</li>\n<li>All your resources must load on all devices. This would require making your own custom image loader to work around certain device issues. For sound, I know simple MIDI type 0 works on all but QCP should also work (no experience of it myself).</li>\n<li>Use bitmap fonts. There are too many device issues with fonts to make it worthwhile using the system fonts.</li>\n<li>Design your code structure as a finite state machine. I cannot emphasise this enough - do this and many, many problems never materialise.</li>\n<li>Have workarounds for every single device issue. This is the hard part! It's possible but this rabbit hole is incredibly deep...</li>\n</ol>\n\n<p>In the end, the more complex and advanced the application, the less likely you can go this route. Some device properties simply cannot be detected reliably at runtime (such as platform ID) and so multiple builds are then required.</p>\n"}, {'answer_id': 111911, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 0, 'selected': False, 'text': '<p>Another idea might be to have the handsets divided into 2 to 4 categories based on say screen dimensions and create builds for them. It is a much faster route too as you will be able to support all the handsets you want to support with much lesser complexity.</p>\n\n<p>Another thing to see is the BREW versions on the handsets you want to launch on. If say BREW 1.1 is on one handset and that is owned by a small percentage in your target market, it doesnt make sense to work to support it.</p>\n'}, {'answer_id': 184105, 'author': 'nharding', 'author_id': 26228, 'author_profile': 'https://Stackoverflow.com/users/26228', 'pm_score': 1, 'selected': False, 'text': "<p>I wrote a J2ME to Brew conversion that is used at Javaground. It is quite possible to write multiple resolution, single binary code. We have a database of device bugs so that it can detect via platform id the device and then generate a series of flags which mark which bugs are tagged. For example most (if not all) of the Motorola Brew phones have a bug where an incoming call does not interrupt the application until you answer the call, so I use TAPI to monitor for an incoming call and generate a hideNotify event (since we are emulating Java, although the generated code is pure C++). I do some checks at runtime for Brew version, and disable certain APIs if it is Brew 2 rather than Brew 3.</p>\n\n<p>3D type games are easier to make resolution independent since you are scaling in software.</p>\n\n<p>Also there are 2 separate APIs for sound, IMEDIA and ISOUNDPLAYER, ISOUNDPLAYER is the older API and is supported on all devices but doesn't have as many facilities (you can only do multichannel audio using IMEDIA). I create an IMEDIA object, and it will fall back to create an ISOUNDPLAYER object if it can't get the IMEDIA object.</p>\n\n<p>The problem with a totally universal build is that there is a big difference in capability, so it can be worth having a few builds, the older devices only have under 1MB of heap (and a small screen size), and then you get a lot with 6MB+ (176x204 to larger).</p>\n\n<p>With Brew you do have a fairly consistent set of key values (unlike Java), although some of the new devices are touch screen (and you have to handle pointer input) and rotating screens.</p>\n\n<p>There are also some old Nokia phones that use big endian mode which mean the files are not the same as the normal mod files (UNLESS you want to write some REALLY cool assembly language prefix header that decodes the file)</p>\n"}]
['https://Stackoverflow.com/questions/71277', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/11587/']