Search Unity

Can anyone argue in favor or against using Unity for mimicking Native apps?

Discussion in 'General Discussion' started by talyh, Apr 26, 2019.

  1. talyh

    talyh

    Joined:
    Dec 2, 2016
    Posts:
    17
    While I know everything is possible to code (theoretically), often it's not practical to do so.

    With that in mind, I'd like to ask the people who are smarter, and better informed, if you feel Unity is suited for building an app that does:

    1. Shows dynamic and interactable graphs

    2. Constant API data fetching

    3. Constant saving to cloud database and storage services

    4. Looks and feels like a native app (not a game)

    5. Transparent switching between offline / online usage

    6. OAuth integration with several providers
    I know you can do API calls with Unity, you can mimic the look and feel of a native app, you can use the FB SDK for OAuth, and then Instagram's API, etc. But my gut feelings tells me Unity is not the right tool given that there are other options more suited for the items above (ie. using React Native might make all of those easier, while creating some different problems in areas I didn't list above).

    Can anyone provide an argument in favor of using Unity for this?
     
    RecursiveFrog likes this.
  2. Ostwind

    Ostwind

    Joined:
    Mar 22, 2011
    Posts:
    2,766
    If its for a mobile then battery use is an notable issue and mimicking platform native UI elements will never work well without a lot of work if you support multiple platforms and versions.
     
  3. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    13,901
    Unity's UI has no builtin accessibility features. If you needed accessibility features you would either have to add them yourself or rely on a third party asset to enable them.
     
  4. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    5,485
    Unity's rendering and UI features are not designed to function at all like native apps on any of the supported platforms. It is not clear to me how you could pull that off other than possibly doing headless builds that access native API's instead of using Unity rendering, but assuming that is even possible, what would be the point of creating it in Unity?

    There's likely Asset Store assets for creating and interacting with graphs, but even creating your own system using the line renderer doesn't seem like that difficult a task (but of course that would be using Unity's rendering).

    The networking stuff can all be done, though networking functionality build into Unity is a current weak point, so you'd be using 3rd party networking code or writing your own networking system, depending on exactly what you're trying to connect.

    There are assets on the Asset Store for oauth.
     
    talyh, angrypenguin and Ryiah like this.
  5. Voronoi

    Voronoi

    Joined:
    Jul 2, 2012
    Posts:
    243
    While Unity could in fact do most of those things, I don't see anything in that list that requires Unity. In other words, 3D space, lighting, environments and that sort of thing. On the other hand, a more standard javascript-based app could do all of that and include standard accessibility features, all while preserving battery life on mobile.

    At best, the UI would 'simulate' the native UI's in Unity, and likely be a chore to set up correctly.

    I think the pain of adding so many assets and add-ons to Unity would outweigh the convenience of using Unity, assuming it's an engine that you already know well.
     
    Kiwasi, angrypenguin and talyh like this.
  6. RecursiveFrog

    RecursiveFrog

    Joined:
    Mar 7, 2011
    Posts:
    128
    The problem is that the things you ideally want to abstract away aren’t the visual elements. I feel like people make far too big a deal about finding a framework where the UI is write-once run everywhere, when the native platforms all have powerful and easy to use UI kits already.

    Unity is probably the worst in this regard as it has a very game-focused set of abstractions on device hardware while robbing you of the UI tools of the platform, while giving you nothing to work with on your own.

    Even other abstractions can add a layer to your debugging that just isn’t necessary, but are far better options than Unity in this regard.
     
    Kiwasi, angrypenguin and talyh like this.
  7. talyh

    talyh

    Joined:
    Dec 2, 2016
    Posts:
    17
    Thank you all for your answers!!

    The part that I intentionally omitted, is that there's a small part of the app that's game-like, and for this, Unity would be a much better fit.
    However, I had the feeling and it was confirmed by your answers, that indeed, building the whole app in Unity would be very costly, given how much time and work would take to implement things that are not Unity's main goal.
    At this point, I'm inclined to suggest two separate apps, one native or React Native, another in Unity, each making use of what that platform does best.
     
    Martin_H and angrypenguin like this.
  8. Aiursrage2k

    Aiursrage2k

    Joined:
    Nov 1, 2009
    Posts:
    4,774
    angrypenguin and talyh like this.
  9. talyh

    talyh

    Joined:
    Dec 2, 2016
    Posts:
    17
    Thanks! I'm going to take a look at it throughout this week. If it works, it may very well be the best solution for my challenge!
     
  10. Aiursrage2k

    Aiursrage2k

    Joined:
    Nov 1, 2009
    Posts:
    4,774
    We used to embed IOS native UI and android native UI in your unity app and it was a nightmare. Even embedding it as a plugin there are too many weird issues.

    Being able to use react native and offloading the UI to a UI developer that just handles that part of the app would probably be the most ideal solution (though I have not tried this myself). And then use unity for any of the hardcore rendering (thats what we did for a few of our business AR for clients)
     
    Last edited: Apr 29, 2019
  11. talyh

    talyh

    Joined:
    Dec 2, 2016
    Posts:
    17
    We've been lucky in identifying from the beginning that while a portion of the app is very suited to use Unity, not all of it seems to be, so I'm well positioned to try and make the best decision in terms of what to use for each. (And, in that, I again thank everyone here for helping with that decision).

    I want to test the ReactNative integration to try and determine whether it'll be able to handle our Unity usage (which involves AR as well as reacting in real-time to data being received via BlueTooth, so not a standard Unity project, I'd say).

    I'm really hoping it does, but it almost seems too good to be true.
     
  12. Aiursrage2k

    Aiursrage2k

    Joined:
    Nov 1, 2009
    Posts:
    4,774
    Let us know how that goes as its something I need to work on later
     
    angrypenguin likes this.
  13. imaginaryhuman

    imaginaryhuman

    Joined:
    Mar 21, 2010
    Posts:
    5,619
    What would actually be kind of useful is if someone coded support for native user-interface elements, so you can actually build a proper native o/s 'app' that runs on the desktop. It could embed a graphics context to allow for the engine to output visuals etc as part of the user interface. Other languages have support for this.
     
    RecursiveFrog and Aiursrage2k like this.
  14. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    25,212
    My take on this is that Unity will eventually become suitable for business and native apps in a general purpose way thanks to Tiny.

    The concept of "bloat" is obsolete. Thanks to @Joachim_Ante and team. I do not know if Unity are planning anything official for general purpose apps but since general purpose apps are becoming increasingly more graphical or require strong visuals I don't see why not.
     
  15. iamthwee

    iamthwee

    Joined:
    Nov 27, 2015
    Posts:
    1,490
    OP might want to check out stuff like framework 7 with <insert whatever server side language> they want here + Cordova

    https://framework7.io/
    https://cordova.apache.org/

    *Just to add, sometimes you don't need native support like bluetooth etc, and all you really need is a responsive web app.

    There are a lot of tutorials of ios app dev, and android. My particular favourite for iOS is the swift guy. Makes it dead easy to understand.

    https://www.youtube.com/channel/UC-d1NWv5IWtIkfH47ux4dWA

    I personally prefer native apps to other frames like Cordova etc which attempts to support different platforms.
     
    Last edited: Apr 30, 2019
    RecursiveFrog likes this.