Become a MacRumors Supporter for $25/year with no ads, private forums, and more!

MacRumors

macrumors bot
Original poster
Apr 12, 2001
52,098
13,721



An Italian school has launched the first Android-specific course in Apple's increasingly popular open source Swift programming language.

The Swift University based in Reggio Emilia claims to be the first, globally, to offer the course for Android, and aims to show students how to use the programming language across both platforms while avoiding the limitations associated with cross-platform middleware such as Xamarin.

At the heart of the course is the use of a bespoke integrated development environment (IDE), rather than a converter, that allows coders to program in Swift instead of Java while using the normal classes of the Android SDK. The course summary, through Google Translate, is as follows:

swift_android-800x194.jpg

By attending this course you will learn how to program apps for Android devices via the Android SDK but written in the Swift language. Thanks to this innovative course, students can easily port iOS projects to Android and/or develop a multi-platform app without using a middleware. This course is suitable for those who are already programmers in Swift, Java, C #, Objective-C and other programming languages. Topics are updated to the latest version of Android SDK.
Swift was introduced by Apple in 2014, with the aim of replacing Objective-C as an easier-to-learn language, and garnered major support from IBM and a variety of apps like Lyft, Pixelmator, and Vimeo. Since then it has steadily risen to prominence among both emerging and established developers, and last month broke into the top 10 in the TIOBE Index, which ranks programming languages by popularity.

Apple has actively promoted Swift as ideal for children who are keen to code, demonstrating its gentle learning curve in Swift Playgrounds, an app that teaches children how to use the language. Apple has been updating and refining Swift since its debut, and unveiled Swift 3.1 on March 27.

(Thanks, Marcello!)

Article Link: First Course Launches to Develop Apps For Android in Apple's Swift Language
 

iBluetooth

macrumors 6502
Mar 29, 2016
362
830
Please, does anyone know what method or way they are using? Please provide a link, I would much rather use Swift than Java. (and its not 1. april)
 
  • Like
Reactions: Avieshek
Comment

GubbyMan

macrumors 6502
Apr 3, 2011
339
1,216
I don't understand. Doesn't everything on Android need to run on the JVM? Are they compiling Swift to bytecode for JVM? I'm not an Android developer so I don't know how this would work.
 
  • Like
Reactions: Avieshek
Comment

OSXATL

macrumors newbie
Mar 11, 2016
5
16
I suspect they are using a transpiler to convert the Swift syntax down to JVM bytecode. This is pretty common in the Java world, as there are several transpilers that allow you to write using one syntax (for example, Groovy, which looks like Ruby syntax) and compile down to the JVM.
 
Comment

Gorms

macrumors 6502a
Aug 30, 2012
556
1,513
UK
Oh, how I dream of official support for Swift from the Android team.

Who am I kidding, they'd stick with it for 4 years then fork it to create their own version, Swiftyer, or something. *side eyes Blink*
 
  • Like
Reactions: Avieshek
Comment

Tom G

macrumors newbie
Apr 13, 2017
1
1
...aims to show students how to use the programming language across both platforms while avoiding the limitations associated with cross-platform middleware such as Xamarin.

What limitations are those?
 
  • Like
Reactions: BHHOWARD
Comment

ChristianVirtual

macrumors 601
May 10, 2010
4,113
279
日本
But how does it d al with differences in UI ?
I can understand having the "business logic" in swift (or c++11) platform independent; but the UI stuff ?
 
Comment

iBluetooth

macrumors 6502
Mar 29, 2016
362
830
I don't understand. Doesn't everything on Android need to run on the JVM? Are they compiling Swift to bytecode for JVM? I'm not an Android developer so I don't know how this would work.
Android has native development for C code, for those parts of apps that need to run fast like in games running many frames per second, as Java is slow and has garbage collection which can start unpredictably. The Swift is run like a C app in NDK.
 
Comment

schmidm77

macrumors member
Jun 15, 2004
56
0
lol, a "bespoke" integrated development environment. So is it only being used by douchie hipsters too?
 
Comment

Schnapple

macrumors newbie
Oct 14, 2014
8
5
What limitations are those?

Not 100% sure what they mean but I've done a project in Xamarin (back before Microsoft bought them).

If you're writing an Android app using Android Studio or Eclipse and Java and something doesn't work it might be a problem with Google's code, but you have the vast sea of Android developers to talk to about it. If you're writing an Android app using Xamarin it could be Google's fault, it could be Xamarin's fault (you're not interacting with Google's Android SDK you're dealing with Xamarin's .NET-based wrappers around everything), it could be the Mono Project's fault (since Xamarin is basically commercial Mono), it could be Microsoft's fault (since Mono is a re implementation of .NET, and yes there's been a few issues I've run into where it's blamed on Microsoft). And the only people you can interact with is the tiny subset of Xamarin Android developers and you might just be waiting for one of the four parties involved to fix their stuff or you get to take it into your own hands. Meanwhile the guys doing "native Java" are off and running.

That's the main thing I can think of. A number of the other issues wouldn't be resolved by this, like how very little code is truly cross platform. Your business rules come across for the ride, that's cool. But interaction with the OS is different per-platform. Networking, graphics, etc. is all different. So you're not losing the need to write/maintain all that separately, you just get to do it with the same syntax is all.

Of course he could just be referring to the idea that their compiler doesn't turn Swift into code that runs on Android directly but rather compiles Swift into terrifying-to-read Java and then compiles it, which would avoid the wrapper issue to some extent, but would still likely have some problems like however reliable their translator is.
 
Comment

GrumpyMom

macrumors G3
Sep 11, 2014
9,471
13,586
Make Android Great Again!

Sorry, I'm in a weird mood. But as a user of both android and iOS devices I would like better apps for Android.
 
Comment

1080p

macrumors 68030
Mar 17, 2010
2,859
2,530
Planet Earth
Please, does anyone know what method or way they are using? Please provide a link, I would much rather use Swift than Java. (and its not 1. april)
Well... according to the story... there is an Italian school that would love for you to enroll in their course so they can teach you how to do it. Just sayin'...
 
  • Like
Reactions: Tmacman
Comment

foobarbaz

macrumors 6502a
Nov 29, 2007
596
779
Please, does anyone know what method or way they are using? Please provide a link, I would much rather use Swift than Java. (and its not 1. april)

You should take a look at Kotlin.
It's pretty similar to Swift and mixes nicely with Java (like Swift mixes with Objective-C).
 
Comment

iSee

macrumors 68040
Oct 25, 2004
3,527
253
I suspect they are using a transpiler to convert the Swift syntax down to JVM bytecode. This is pretty common in the Java world, as there are several transpilers that allow you to write using one syntax (for example, Groovy, which looks like Ruby syntax) and compile down to the JVM.

Hm... it would be weird to implement Swifts memory management scheme (ARC) in JVM bytecode. It would coexist with the JVM's memory management scheme (garbage collection). I guess it could be done but might be pretty inefficient in certain cases. Further complications would be, e.g., the Swift runtime. That's either got to be somehow compiled to bytecode or bridged.

I think more likely they would compile Swift to native machinecode (and use NDK to bridge).

By the way, I think if the input is a high level language and bytecode is the output, it's a compiler, not transpiler. (It would probably be better to get rid of the word transpiler altogther and just use compiler regardless, because the relative level of abstraction of the input and output is not really a key element of what is being done.)
 
Comment

iBluetooth

macrumors 6502
Mar 29, 2016
362
830
You should take a look at Kotlin.
It's pretty similar to Swift and mixes nicely with Java (like Swift mixes with Objective-C).
Kotlin is still garbage collected, but null pointer checks are nice. But the main problem facing us developers, is that we write first in Swift for iOS and then some supervisor asks for an Android version. Then, it's nice to be able to re-use the Swift models and logic and write the frontend natively in Java.
I honestly think Google must be considering allowing other languages after being sued by Oracle for their use a Java.
 
Comment

iSee

macrumors 68040
Oct 25, 2004
3,527
253
But how does it d al with differences in UI ?
I can understand having the "business logic" in swift (or c++11) platform independent; but the UI stuff ?

It sounds like they aren't... or at least that's what "without a middleware" seems to imply.

E.g., where a native app on iOS could use Swift + UIKit (and other frameworks), it sounds like in this course you'd use Swift + Android SDK.
 
Comment

foobarbaz

macrumors 6502a
Nov 29, 2007
596
779
The site was offline for a while, now it is available again: It says: "Due to competitive reasons, we will tell you the name of the IDE after the course begins".

That smells like a scam.

Why would the *name* of their bespoke IDE reveal a secret, unless it's not so bespoke after all. Notepad and command line?
 
Comment

scottishwildcat

macrumors 6502
Oct 24, 2007
260
289
But how does it d al with differences in UI ?
I can understand having the "business logic" in swift (or c++11) platform independent; but the UI stuff ?
UIs would be implemented using the same Android libraries that you use today. You'd just call their APIs from Swift instead of Java, just like you can now call Cocoa APIs from Swift instead of Objective-C.
 
Comment

DeepIn2U

macrumors G3
May 30, 2002
8,456
3,143
Toronto, Ontario, Canada
I don't understand. Doesn't everything on Android need to run on the JVM? Are they compiling Swift to bytecode for JVM? I'm not an Android developer so I don't know how this would work.

Okay, but How?

I was waiting for this. But how is this possible?

SHUSH! You guys are asking too many questions ... to the reason of 'who cares'.

The answer is "it just WORKS" to the reason of developers will get the message and stop dealing with Android.

Giving a glass of water to someone in Hell

Steve Jobs

The best answer to all the above questions!

But yes Android will probably just port Swift ... hmm can an SDK be patented?
 
Comment

Snowshiro

macrumors 6502
Jan 12, 2008
386
4
What limitations are those?

The article writer has no idea what Xamarin does. They just plucked something out of the air to sound informed. They would have been better to pick something like Cordova or Titanium.

I'm a professional Xamarin developer. Xamarin leverages the iOS SDK that ships with Xcode and uses the same LLVM compiler as objective C. Basically when you build a Xamarin app, you're using UIKit UI classes like ViewControllers and TableViews and binding to the native libraries provided by Apple, so there's no real difference between a Xamarin app and a natively developed app. The only real difference is that you're bundling in .NET assemblies that C# developers use (since Xamarin uses C#) which have a runtime that is so well optimized that there are benchmarks out there (these are a little old, but the best I could find in a few seconds) that show that Xamarin is actually faster than Objective C on iOS and Java on Android.

https://medium.com/@harrycheung/mobile-app-performance-redux-e512be94f976

This is not an anti-Swift rant at all. I'm super excited by cross-platform Swift (when it's mature enough to realistically use). It's a great language and I hope the momentum behind it continues to grow. One of the disadvantages it has right now though is that Xamarin can leverage the entire .NET library ecosystem in its arsenal - libraries which are designed to be platform agnostic, so implementing that code share across all platforms is super easy because you can just write pure .NET code and it'll work anywhere. That doesn't really exist in the same way for Swift right now.
 
Last edited:
Comment
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.