Search Unity

Xamarin vs. Unity for cross playform apps? Anyone try both?

Discussion in 'General Discussion' started by punkouter2019, Apr 11, 2016.

  1. punkouter2019

    punkouter2019

    Joined:
    Jul 28, 2013
    Posts:
    170
    I am messing with Xamarin and sometimes I wonder if creating some simple apps would be easier with Unity. Unity does not use native controls but atleast you can see what you are designing. Anyone have any opinions on this who have used both?
     
  2. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,620
    Unity is a game engine. It's really efficient for game-like things - things that rely on the real-time game or simulation loop. It's somewhat inefficient for things that don't need that, for reasons described in detail in prior threads. Xamarin, on the other hand, is really efficient for other types of applications.

    If you're familiar with Unity then sure, you can develop stuff more quickly with it, and for some applications the difference might never matter. For any "serious" application work, though, I'd go for a tool that's designed for that task in the first place.
     
  3. arvzg

    arvzg

    Joined:
    Jun 28, 2009
    Posts:
    619
  4. Player7

    Player7

    Joined:
    Oct 21, 2015
    Posts:
    1,533
    I've had similar thoughts.. it is literally the quickest thing to be able to use c# with somewhat sane gui development for said application while hitting all target platforms in one go knowing it will look the way you designed it and work that way.. complete with fixed gui bugs and no stupid OS platform quirks.. because their developers are to dumb to just copy windows far more polished and bugree gui controls down to the very detail of how they work.

    Everything else as far as tools and programs to aid in this just plain suck, is barely supported, or has a huge upfront requirement like c++ and qt. While on windows you have visual studio that is great for making winform stuff, if you want to do that for linux desktop using mono you're screwed or osx, or android ios... The closest thing is doing it with java and using one of its own ide's and gui kits then you get pc, linux and osx. But not really mobile unless you go through android.

    For me I would rather make stuff one time that works on windows and linux desktops (and more the better).. windows for now, linux for when MS go so far full retard in its dumbification of ux/ui and spyware infested windows platform, that I can no longer bare to use it anymore or stay on win7 because less things start working for it.
     
    xen23 likes this.
  5. punkouter2019

    punkouter2019

    Joined:
    Jul 28, 2013
    Posts:
    170
    I understand it is made for gaming. But my apps would be very basic like calling a REST service. Showing some data and some charts. I know there is a Unity chart plugin out there.

    So even though it is not made to create apps the alternative of Xamarin has issues too. And if there is no desire to use native controls + the new Unity UI it starts to seem doable.

    I am trying out both at the moment. Creating a simple app for the Windows Phone + Android and going to see which path makes things easier

    Also, have the option to do some interesting 3d visualizations couldn't hurt.
     
  6. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,620
    And that's exactly where the mismatch is. Unity isn't at all designed for (or optimum for) this kind of app.

    As one example, Unity re-renders everything every frame, at 30 or 60 frames per second, because this is the best way to render real-time interactive worlds. A form-oriented GUI framework only redraws each control when its state changes, because that's the best way to render that kind of application.

    This is especially relevant on mobile devices where CPU/GPU usage correlates to battery drain.
    Yeah, but it's not about "can I draw charts?" It's about "how many resources am I chewing up to draw those charts?" Plus, there's charting packages available for most languages or frameworks.
     
    ADNCG, Ostwind, Deleted User and 2 others like this.
  7. punkouter2019

    punkouter2019

    Joined:
    Jul 28, 2013
    Posts:
    170
    Ok. If using battery power a bit more is an issue I understand. This is really just me goofing around in my spare time at work taking some data and getting it on something cross platform like Xamarin/Unity. Not making a real serious project.

    Mostly just curious the problem I run into doing this crossplatform work for the sake of learning.
     
    philthoid likes this.
  8. RichardKain

    RichardKain

    Joined:
    Oct 1, 2012
    Posts:
    1,261
    Yeah, if you're focused on designing a REST application, I would suggest sticking with Xamarin. It's more geared toward that sort of thing, and will likely perform better/lighter with lower battery consumption. (a crucial factor in developing mobile apps)

    And of course, you can always expand your efforts using Monogame in the future if you want to. Unity is geared toward more robust game-like applications. For basic charts and graphs a less intensive framework would probably be more appropriate.
     
  9. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,620
    Battery usage isn't the only concern, just the first to jump to mind.
     
  10. SteveJ

    SteveJ

    Joined:
    Mar 26, 2010
    Posts:
    3,085
    It's a little like using a chainsaw to carve a turkey. Yeah, it will kind of work, but you'd have a tough time convincing anyone that it's the right tool for the job :)
     
    taxvi, Ryiah and Kiwasi like this.
  11. punkouter2019

    punkouter2019

    Joined:
    Jul 28, 2013
    Posts:
    170
    I tried Xamarin and it was ok till I kept getting compile issues seemingly randomly with the code behind not seeing the XAML control names .. And claiming there was an error on InitializeComponent() while there wasn't really and it deployed fine..

    So now I want to try Unity.. I guess as far as dealing with REST endpoints I just use the WWW class and is there some build in JSON --> object class that works universally ?
     
  12. kobusn

    kobusn

    Joined:
    Feb 18, 2017
    Posts:
    2
    @punkouter2 We have used an asset called FluxMVC to create cross platform mobile apps which call REST APIs.

    Our app had some 3D and AR features which is why we chose Unity, but for the most part is just a "normal" application.
     
  13. ippdev

    ippdev

    Joined:
    Feb 7, 2010
    Posts:
    3,853
    Don't let them scare you with the boogey man stuff. If you want to have 3D graphs and such then do what you want and pay no mind to the standard boilerplate. People plug their phones in to recharge all the time. The time saved in multiplatform deployment makes the time versus money ratio worth it. Plus, you can make your UI all whizbang and not some boring manilla envelope of standards.