6 Replies - 220 Views - Last Post: 16 August 2019 - 08:38 AM

#1 jtlapp   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 16-August 19

One OS/UI abstraction in two languages - Swift + Java?

Posted 16 August 2019 - 07:44 AM

I'm researching my options for cross platform development and am leaning toward Flutter, but I'm not finding one option that would appeal to me.

I'm looking for a pair of libraries written for Swift and Java that have identical (or nearly identical) APIs, except for language.

The benefit here is that, for most things, the dev would only have to learn one platform and just program the app in two different languages. This reduces the cross platform problem to largely porting between languages rather than also porting between platforms. The dev would have to learn only one API and design the app for only one API.

Unless I'm missing something about this solution that makes it unviable. I realize that this doubles the burden on unit tests.

In order for me to consider using these libraries, they would have to be well supported. Given that I've been unable to find them, it seems likely that any that do exist have little support.

Is This A Good Question/Topic? 0
  • +

Replies To: One OS/UI abstraction in two languages - Swift + Java?

#2 modi123_1   User is online

  • Suitor #2
  • member icon



Reputation: 15219
  • View blog
  • Posts: 60,921
  • Joined: 12-June 08

Re: One OS/UI abstraction in two languages - Swift + Java?

Posted 16 August 2019 - 07:55 AM

Quote

cross platform development

of what? Mobile apps? Desktop apps?

Which platforms?

Things like Xamarin exist.
Was This Post Helpful? 0
  • +
  • -

#3 jtlapp   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 16-August 19

Re: One OS/UI abstraction in two languages - Swift + Java?

Posted 16 August 2019 - 07:56 AM

Oh, sorry, mobile apps. I guess the forum context wasn't clear.
Was This Post Helpful? 0
  • +
  • -

#4 jtlapp   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 16-August 19

Re: One OS/UI abstraction in two languages - Swift + Java?

Posted 16 August 2019 - 08:01 AM

Looks like Xamarin is C#. I want to write native code for iOS in Swift and Android in Java or Kotlin.
Was This Post Helpful? 0
  • +
  • -

#5 modi123_1   User is online

  • Suitor #2
  • member icon



Reputation: 15219
  • View blog
  • Posts: 60,921
  • Joined: 12-June 08

Re: One OS/UI abstraction in two languages - Swift + Java?

Posted 16 August 2019 - 08:02 AM

I'm a little lost. When you opt for cross platform you dip out of the 'native code' and trade that out for the ability to write once and compile different.
Was This Post Helpful? 0
  • +
  • -

#6 jtlapp   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 16-August 19

Re: One OS/UI abstraction in two languages - Swift + Java?

Posted 16 August 2019 - 08:33 AM

Most people imagine cross platform development to mean "WRITE ONCE" for both (iOS/Android) platforms. That is the ideal approach, but every approach has its pros and cons.

The point of my post is to propose another way to do it (and hope it's already been done). You might call it "DESIGN ONCE, WRITE TWICE" or perhaps "IMPLEMENT ONCE AND MINDLESSLY PORT."

There are various levels of design. You can design the UI and behavior at a level that's abstract enough to apply regardless of programming language and mobile OS, but the developer has to then design at a lower level to actually implement it for the very different OS APIs.

Imagine layering an abstraction on the OS and UI to hide the application from the details of the platform. Xamarin does this for C#. Flutter does this for Dart. React Native does this for JS.

But also imagine implementing that one abstraction in multiple programming language. One version of this abstraction would be in Apple Swift for iOS. Another in Java for Android. The class names in this abstraction are the same across languages. The method names are the same (as much as possible). The constant names are the same (as much as possible).

Now the developer only has to learn one platform API and two languages (Java and Swift). After developing the app in one language, the dev can (almost) mindlessly port the app to the other languages, because the apps do the same thing all the way down to calling the platform abstraction APIs. Heck, it may even be possible to automate most of the port.

(Any code that must be native is easily made native because you're already coding natively.)

I'm looking for a single-abstraction multi-language library that has already done this.
Was This Post Helpful? 0
  • +
  • -

#7 modi123_1   User is online

  • Suitor #2
  • member icon



Reputation: 15219
  • View blog
  • Posts: 60,921
  • Joined: 12-June 08

Re: One OS/UI abstraction in two languages - Swift + Java?

Posted 16 August 2019 - 08:38 AM

So instead of native concerns with the GUI with keeping the back end the same, you want to keep the GUI the same and make the back end native?

Seems like an odd hill to roll a ball up. I'm not seeing the benefit, but so it goes. Good luck.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1