Search code examples
mobilebrew-frameworkbrewmp

Single application build for multiple mobile devices


Is it possible to have one application binary build for multiple mobile devices (on BREW platform), rather than making a separate build for each device using build script with conditional compilation.

In particular is is possible to use single BREW application build for multiple screen resolutions?

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


Solution

  • Yes, it is possible, we were able to do this at my previous place of work. What's required is tricky though:

    1. Compile for the lowest common denominator BREW version. Version 1.1 is the base for all current handsets out there.
    2. 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.
    3. 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).
    4. Use bitmap fonts. There are too many device issues with fonts to make it worthwhile using the system fonts.
    5. Design your code structure as a finite state machine. I cannot emphasise this enough - do this and many, many problems never materialise.
    6. Have workarounds for every single device issue. This is the hard part! It's possible but this rabbit hole is incredibly deep...

    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.