
Getting Started with Swift on Android - antfarm
https://github.com/apple/swift/blob/master/docs/Android.md
======
V-2
"Getting Started with Swift on Android"

"FAQ [...]

Does this mean I can write Android applications in Swift?

No."

~~~
M4v3R
To clarify - you cannot currently write GUI applications for Android in Swift,
because no UI toolkit exists for this task at the moment.

~~~
V-2
Well, thanks. I kind of figured it out, but still I believe it should be
stated explicitly, because it looks quite confusing

~~~
apeacox
Consider it's a _getting started_ , not a _develop android apps with swift_.
Then it's explained in the FAQ, IMHO it makes sense.

~~~
V-2
Not explicitly, in the sense that it tells me what _can 't_ be done instead of
what _can_

------
tkubacki
I personaly hope Google will replace Java with Dart at some point - it will be
easier to switch for average Java dev (syntax) and there is already Dart for
Android project - Flutter

~~~
on_and_off
Flutter is a very very very long way from being a replacement for the native
UI kit though.

It is stuck in an uncanny valley where the effects sorta looks like those of
the platform, but are different enough to make the discrepencies very visible.

A simple list skips a lot of frames on my Nexus 6P, I can't imagine what I
will look like on the regular user's phone.

None of the samples do anything interesting, they are just very tiny fragments
of UI and even then there are many things missing.

Bringing Flutter up to speed with the native UI toolkit would demand a titanic
amount of work

------
nenadst
Has anybody used Silver ?
[http://www.elementscompiler.com/elements/silver/](http://www.elementscompiler.com/elements/silver/)
It seems to offer a working Swift compiler which can also create android apps
(and ios and .net)

~~~
rob74
I haven't used it yet, but intrigued by your comment I did a bit of research,
and here's the gist of what I have understood: the company behind Silver is
RemObjects, and they offer a cross-platform compiler suite called Elements,
which supports three languages: C#, Oxygene (their own creation, apparently
heavily influenced by Object Pascal) and now Silver, which is Swift with "a
few features" added to bring it in line with the other two languages. They're
trying to downplay the additions for obvious reasons, but they sound pretty
hefty to me: Exception Handling, Partial/Static Classes, External/Inline
Functions, Events etc. Imagine what Rob Pike would say if someone came along
and added all that to Go ;) (see
[https://docs.elementscompiler.com/](https://docs.elementscompiler.com/) and
[https://docs.elementscompiler.com/Silver/LanguageExtensions/](https://docs.elementscompiler.com/Silver/LanguageExtensions/)
for details).

That being said, the compiler (and IDE for Mac) are freely available, so you
can try it out. RemObjects have been around for a while and I was pleased with
their products back in the day when I was developing in Delphi, so I'm sure
Elements is a solid product as well, just maybe not what you are expecting...

------
bitmapbrother
Is there a reason Google didn't make the UI framework language agnostic? Had
they coded the Framework API in C/C++ they could easily have made any language
a first class citizen by supplying the necessary API wrappers/facades for the
languages that needed it.

~~~
yardie
They chose Java because it made sense at the time. Most mobile apps before the
current smartphone era were Java based using j2me (or whatever it was called).
Just like most iOS developers were existing Mac developers using Obj-C.

Still don't know why they don't have hooks for other languages. Your option is
to use NDK (I think haven't coded for Android in ages) for those that insisted
on C/++

~~~
bitmapbrother
I'm aware of why they selected Java (mindshare) for their development
platform, but that doesn't exactly explain why they coded the majority of
their framework in Java. Had they used C/C++ the interoperability with other
languages for UI based applications would have been trivial with the
respective API wrappers in place.

~~~
pjmlp
But they do, just those APIs aren't exposed to other NDK applications.

For example, the 2D rendering engine is implemented in Skia.

------
GoldenMonkey
Android port has been merged into the swift code-base:

[https://github.com/apple/swift/pull/1442](https://github.com/apple/swift/pull/1442)

------
abledon
Is it just 'Rumour' at this point Android will officially adopt Swift as their
primary application development language?

~~~
on_and_off
Yes. There are probably internal discussions about the future of the platform,
but we have no official information.

This 'android port of swift' only allows to target the NDK, not to build an
Android app from A to Z.

------
taveras
This is exciting! I can only wonder if Oracle has been enough trouble to
pester Google into using a language such as Swift.

------
awinter-py
I pity the fool JNI

------
drivebyops
Would this work to create games for android with OpenGL?

