Universal Apps/Games

Discussion in 'Web development / Programming' started by @ruantec, Jun 6, 2015.

  1. @ruantec

    @ruantec Crazy GFX coder Emu Author

    Messages:
    15,009
    Likes Received:
    1,089
    I've been toying for a while now moving my code to a Universal App and it's been awesome. So far i've been able to store my logic inside the shared assembly which is shared across different UI projects of different kind. Each project is loaded depending on the OS while the logic remains always the same. It's so amazing and i've been able to use the exact same code in the following enviroments while compiling just once:

    - Windows 8/8.1
    - Windows dekstop
    - Windows Phone
    - Android
    - iOS(can't test it right now since i don't have a enemy device anymore) normal and "Metal"
    - OSX

    Later:
    - Hololens(support from day 1)
    - Xbox One(support after the Windows 10 update)
    - PS4(if implementation is done from Sony's side)

    One project, different targets simultaneously! how cool is that??? and obviously all using C# and pure MVVM :). Basically all i have to do is implement the right UI for every OS if necessary and i can even share common controls among Windows devices. Using binding and MVVM i simply attach the logic and voila!

    Anyone tried Univeral Apps already? would love to hear from my fellow coders here.
    Last edited: Jun 6, 2015
    Hard core Rikki likes this.
  2. NGEmu.com Advertisement

  3. Samor

    Samor Foundry

    Messages:
    10,314
    Likes Received:
    501
    no, I haven't but that sounds like a good thing to try... targeting that many platforms make it all the more tempting to try something. Now I just have to come up with a good idea, which is the hard part...
  4. @ruantec

    @ruantec Crazy GFX coder Emu Author

    Messages:
    15,009
    Likes Received:
    1,089
    It's actually easier than it looks. Basically you have a assembly called {yourprojectname}.shared. That assembly doesn't have any dependencies but can hold anything from classes, controls, interfaces, behaviours and everything you need to build your app logic. The assembly itself works as a file linker hence why it doesn't need any dependencies as it takes them from your target projects automatically.

    Target projects are from each plattform you want to support and also includes the .shared project as a dependency(if not then you have to download a extension that allows you to add it through context menu). On each project you store the UI for each plattform and design your UI to fit your plattform and size best and using plattform specific controls if necessary. The UI is bound to the .shared logic which is where your app lives. When the user install and run the project the shared project is loaded and according to your plattform it choose the right assembly holding the UI.

    The result is nothing but awesomeness at its best.
    Last edited: Jun 8, 2015
    Samor likes this.
  5. acdbrn2000

    acdbrn2000 New Member

    Messages:
    219
    Likes Received:
    27
    While it should make multiplatform releases easier it also means thst no platformmis entirely optimized either. While that matters less on fragmented platforms like PC and Android since most programs are not optimized for better universal compatability, it will heavily effect ios. Of course this is also dependent of what kind of app is being made.
  6. @ruantec

    @ruantec Crazy GFX coder Emu Author

    Messages:
    15,009
    Likes Received:
    1,089
    It depends. Sure you have a shared code among devices but you still have different projects for each one. That means that you have the ability to add Plattform specific code for each device in case you want to optimize or use something for a specific one. That's how you add Plattform specific controls as well.

Share This Page