[Pitch]Building a limited framework to develop Android Apps in Swift 3.0

android

(Tony Constantinides) #1

In Swift 3.0 you can build Android apps in Linux but only console apps as
there is no framework to build GUI apps using JNI.
What I propose is to build an initial limited framework coded in C that
calls enough of the Java Android API via JNI to bootstrap the android app
and to create widgets and layouts.A default Androidmanifest.xml file and
some files needed to be generated to make a valid android app.
  The Android API java surface is vast, so this framework needs to be build
over many releases to be useful. Developing a graphical Android app
requires interaction with "Activities" and the package manager and some
widgets like Button and some layouts like "RelativeLayout" and
"LinearLayout".
The result will be the ability to develop GUI Android apps on Linux using
Swift 3.0
Further support for additional APIs will be provided once the basics are
solid..
Who am I: Senior Android mobile developer with more than six years
experience on Android.
Am I able to build Swift 3.0 on Linux: Yes
Any help, suggestions, or ideas are most welcome
Warms regards,
Tony Constantinides


(Douglas Gregor) #2

The swift-evolution process is primarily focused on the Swift language and standard library. Large-scale API development, which binding to/creating a GUI library entails, is out-of-scope for this process and should occur in a different forum.

  Cheers,
  Doug

···

On Oct 9, 2016, at 9:45 PM, Tony Constantinides via swift-evolution <swift-evolution@swift.org> wrote:

In Swift 3.0 you can build Android apps in Linux but only console apps as there is no framework to build GUI apps using JNI.
What I propose is to build an initial limited framework coded in C that calls enough of the Java Android API via JNI to bootstrap the android app and to create widgets and layouts.A default Androidmanifest.xml file and some files needed to be generated to make a valid android app.
  The Android API java surface is vast, so this framework needs to be build over many releases to be useful. Developing a graphical Android app requires interaction with "Activities" and the package manager and some widgets like Button and some layouts like "RelativeLayout" and "LinearLayout".
The result will be the ability to develop GUI Android apps on Linux using Swift 3.0
Further support for additional APIs will be provided once the basics are solid..
Who am I: Senior Android mobile developer with more than six years experience on Android.
Am I able to build Swift 3.0 on Linux: Yes


(Tony Constantinides) #3

Its a nice cop-out, but this framework is an extension of the standard
library of Swift as it will allow Swift developers to target new mobile
platforms. This is the mailing lists for the evolution of Swift which is
what this is. I not sure any of the other Swift mailing lists suits this
goal. I not making Swift language changes(maybe) but adding an additional
library that developers can build against if they are interested in having
their Swift code running on Android.

Note that the Swift project itself has provided documentation and hooks to
provide this capabailit seen here
https://github.com/apple/swift/blob/master/docs/Android.md
The main issue is that swiftcore is missing on Swift for Linux.

  Its only important to understand I going to build this framework with or
without support from Swift.org. However I want other developers to benefit
disappointing if Swift core members reject enhancing Swift to target
additional mobile platforms as making Swift cross-platform is a stated goal.

···

from my work and I want to give back to the community. I find it extremely

On Mon, Oct 10, 2016 at 9:41 AM, Douglas Gregor <dgregor@apple.com> wrote:

> On Oct 9, 2016, at 9:45 PM, Tony Constantinides via swift-evolution < > swift-evolution@swift.org> wrote:
>
> In Swift 3.0 you can build Android apps in Linux but only console apps
as there is no framework to build GUI apps using JNI.
> What I propose is to build an initial limited framework coded in C that
calls enough of the Java Android API via JNI to bootstrap the android app
and to create widgets and layouts.A default Androidmanifest.xml file and
some files needed to be generated to make a valid android app.
> The Android API java surface is vast, so this framework needs to be
build over many releases to be useful. Developing a graphical Android app
requires interaction with "Activities" and the package manager and some
widgets like Button and some layouts like "RelativeLayout" and
"LinearLayout".
> The result will be the ability to develop GUI Android apps on Linux
using Swift 3.0
> Further support for additional APIs will be provided once the basics are
solid..
> Who am I: Senior Android mobile developer with more than six years
experience on Android.
> Am I able to build Swift 3.0 on Linux: Yes

The swift-evolution process is primarily focused on the Swift language and
standard library. Large-scale API development, which binding to/creating a
GUI library entails, is out-of-scope for this process and should occur in a
different forum.

        Cheers,
        Doug


(Dave Abrahams) #4

Its a nice cop-out, but this framework is an extension of the standard
library of Swift as it will allow Swift developers to target new mobile
platforms.

It's not a cop-out. We would never include UIKit in Swift's standard
library, which is the set of definitions you get without so much as an
“import”. UI functionality simply belongs elsewhere.

···

on Mon Oct 10 2016, Tony Constantinides <swift-evolution@swift.org> wrote:

This is the mailing lists for the evolution of Swift which is what
this is. I not sure any of the other Swift mailing lists suits this
goal. I not making Swift language changes(maybe) but adding an
additional library that developers can build against if they are
interested in having their Swift code running on Android.

Note that the Swift project itself has provided documentation and hooks to
provide this capabailit seen here
https://github.com/apple/swift/blob/master/docs/Android.md
The main issue is that swiftcore is missing on Swift for Linux.

  Its only important to understand I going to build this framework with or
without support from Swift.org. However I want other developers to benefit
from my work and I want to give back to the community. I find it extremely
disappointing if Swift core members reject enhancing Swift to target
additional mobile platforms as making Swift cross-platform is a stated goal.

On Mon, Oct 10, 2016 at 9:41 AM, Douglas Gregor <dgregor@apple.com> > wrote:

> On Oct 9, 2016, at 9:45 PM, Tony Constantinides via swift-evolution < >> swift-evolution@swift.org> wrote:
>
> In Swift 3.0 you can build Android apps in Linux but only console apps
as there is no framework to build GUI apps using JNI.
> What I propose is to build an initial limited framework coded in C that
calls enough of the Java Android API via JNI to bootstrap the android app
and to create widgets and layouts.A default Androidmanifest.xml file and
some files needed to be generated to make a valid android app.
> The Android API java surface is vast, so this framework needs to be
build over many releases to be useful. Developing a graphical Android app
requires interaction with "Activities" and the package manager and some
widgets like Button and some layouts like "RelativeLayout" and
"LinearLayout".
> The result will be the ability to develop GUI Android apps on Linux
using Swift 3.0
> Further support for additional APIs will be provided once the basics are
solid..
> Who am I: Senior Android mobile developer with more than six years
experience on Android.
> Am I able to build Swift 3.0 on Linux: Yes

The swift-evolution process is primarily focused on the Swift language and
standard library. Large-scale API development, which binding to/creating a
GUI library entails, is out-of-scope for this process and should occur in a
different forum.

        Cheers,
        Doug

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

--
-Dave


(Robert Widmann) #5

Its a nice cop-out, but this framework is an extension of the standard library of Swift

Then it requires a proposal as much. Bear in mind that the Swift Standard Library is platform-agnostic. Adding support for Android necessarily contradicts that and will be a hard sell. Further, I don’t believe stdlib is the right target for this kind of library at all and will lead to the same lowest-common-denominator style of application as with Java on every other platform they support.

This doesn’t belong anywhere near core libs, but as a 3rd-party project it would certainly be welcome to have Android bindings.

as it will allow Swift developers to target new mobile platforms. This is the mailing lists for the evolution of Swift which is what this is. I not sure any of the other Swift mailing lists suits this goal. I not making Swift language changes(maybe) but adding an additional library that developers can build against if they are interested in having their Swift code running on Android.
Note that the Swift project itself has provided documentation and hooks to provide this capabailit seen here
https://github.com/apple/swift/blob/master/docs/Android.md
The main issue is that swiftcore is missing on Swift for Linux.

Unless Android gets support for Objective-C (shudder) I don’t think you need SwiftCore for this.

  Its only important to understand I going to build this framework with or without support from Swift.org. However I want other developers to benefit from my work and I want to give back to the community. I find it extremely disappointing if Swift core members reject enhancing Swift to target additional mobile platforms as making Swift cross-platform is a stated goal.

I think this is a bit of a strawman. Members of this community have spent a lot of time and effort getting Swift to even build on Android. To say we’d “reject” this because it’s out of bounds for inclusion in the libraries you’re trying to include it in is ignoring the larger problems inherent in this proposal.

~Robert Widmann

···

On Oct 10, 2016, at 2:04 PM, Tony Constantinides via swift-evolution <swift-evolution@swift.org> wrote:

On Mon, Oct 10, 2016 at 9:41 AM, Douglas Gregor <dgregor@apple.com <mailto:dgregor@apple.com>> wrote:

> On Oct 9, 2016, at 9:45 PM, Tony Constantinides via swift-evolution <swift-evolution@swift.org <mailto:swift-evolution@swift.org>> wrote:
>
> In Swift 3.0 you can build Android apps in Linux but only console apps as there is no framework to build GUI apps using JNI.
> What I propose is to build an initial limited framework coded in C that calls enough of the Java Android API via JNI to bootstrap the android app and to create widgets and layouts.A default Androidmanifest.xml file and some files needed to be generated to make a valid android app.
> The Android API java surface is vast, so this framework needs to be build over many releases to be useful. Developing a graphical Android app requires interaction with "Activities" and the package manager and some widgets like Button and some layouts like "RelativeLayout" and "LinearLayout".
> The result will be the ability to develop GUI Android apps on Linux using Swift 3.0
> Further support for additional APIs will be provided once the basics are solid..
> Who am I: Senior Android mobile developer with more than six years experience on Android.
> Am I able to build Swift 3.0 on Linux: Yes

The swift-evolution process is primarily focused on the Swift language and standard library. Large-scale API development, which binding to/creating a GUI library entails, is out-of-scope for this process and should occur in a different forum.

        Cheers,
        Doug

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution


(Adrian Zubarev) #6

It’s disappointing that you seem not to understand what this mailing list is for. Building a Framework does not require the evolution process. It’s all up to you to open a GitHub repository and just start building.

Sure you can ask for help, but I believe other platforms like stackoverflow or even swift-users would be a better place for that.

And I think your statement about rejection is totally wrong. The core team has enough work and responsibility to care about.

···

--
Adrian Zubarev
Sent with Airmail

Am 10. Oktober 2016 um 20:06:26, Tony Constantinides via swift-evolution (swift-evolution@swift.org) schrieb:

I find it extremely disappointing if Swift core members reject enhancing Swift to target additional mobile platforms as making Swift cross-platform is a stated goal.


(Tony Constantinides) #7

Ok,
I was trying to follow the evolution process which states to "discuss your
idea on the mailing lists" before i begin work on it.That is what I am
doing. If you feel this work is not part of swift-evolution I shall bother
this group no longer. You have to remember I am very new to interfacing
with the Swift team hence the cautious approach. I do realize this is a
proposal and not a pitch and I am prepare to provide a great many more
details in a proposal. If you wish to point me to another swift mailing
list then please do so. If you feel this a "third party lib" then tell me
where it slots in. In other words be helpful and not react like a teen age
girl.
  Of course I will begin development of this feature on github and give
talks to my local developer group. When I create a github with this
framework I going to have to add a licence. Making the software
copyrighted to my company and not link to the swift.org project in any way
seem odd to me. Not my idea of "open source" or contributing to a "major
open source project". You state that the Swift community members have spent
a great deal of time and effort in getting getting Swift to even build on
Android. Congrats! I here to take it to the next level.
If there is Swift community interest the code will be free via open
source. If there is none and judging by the response from the developers in
my "Bay Area Android Developer meetup group" that hard to believe then I
make it it commercial software to be sold.
Many thanks in advance.
Sincerely yours,
Tony Constantinides

···

On Mon, Oct 10, 2016 at 11:15 AM, Adrian Zubarev < adrian.zubarev@devandartist.com> wrote:

It’s disappointing that you seem not to understand what this mailing list
is for. Building a Framework does not require the evolution process. It’s
all up to you to open a GitHub repository and just start building.

Sure you can ask for help, but I believe other platforms like
stackoverflow or even swift-users would be a better place for that.

And I think your statement about rejection is totally wrong. The core team
has enough work and responsibility to care about.

--
Adrian Zubarev
Sent with Airmail

Am 10. Oktober 2016 um 20:06:26, Tony Constantinides via swift-evolution (
swift-evolution@swift.org) schrieb:

I find it extremely disappointing if Swift core members reject enhancing
Swift to target additional mobile platforms as making Swift cross-platform
is a stated goal.


(Tony Constantinides) #8

Ok,
Any other feedback from the Swift community other than it does not belong
as part of Swift? Or get the hell out of here?
I discussing this issue so people in the Swift community are aware of what
I am planning to do and have the ability to shape if they they so wish.

Some Technical points
Keep in mind when I say framework I do NOT mean a OSX like framework like
XCTest, I mean a third party library that doing two way communication with
your app.
a) It's not an Android Binding as that will not work, its a framework
wrapped up in a library using the bridging pattern
b) I want Swift to bootstrap the Android runtime indirectly when using the
framework. I want to make the Swift source the driving code and not the
Android Code. All events that the device sends out we be rerouted to Swift
code which will call the Java API using JNI in response
c) Android apps have a directory structure that must be maintained by the
framework to be valid. This will be handled by the framework.
d) Packages of Swift code will wrap the calls to the Java API which will
cause the need for a large library on the Swift side. The Swift developer
will use the Swift Library like any other and be unaware of its internal
routing to the Android API
e) This library will only work on Linux as there is where the Android
compilers are for ARM
Please provide input as it is welcome.
Right now I getting *crickets* which is not good.
I will be releasing a statement to the press when this work is working.
I want to state that the Swift Community actively supported it, including
Apple employees
I wish that statement to be true!
Sincerely yours,
Tony Constantinides

···

On Mon, Oct 10, 2016 at 12:08 PM, Tony Constantinides < constantinnovationsinc@gmail.com> wrote:

Ok,
I was trying to follow the evolution process which states to "discuss
your idea on the mailing lists" before i begin work on it.That is what I am
doing. If you feel this work is not part of swift-evolution I shall bother
this group no longer. You have to remember I am very new to interfacing
with the Swift team hence the cautious approach. I do realize this is a
proposal and not a pitch and I am prepare to provide a great many more
details in a proposal. If you wish to point me to another swift mailing
list then please do so. If you feel this a "third party lib" then tell me
where it slots in. In other words be helpful and not react like a teen age
girl.
  Of course I will begin development of this feature on github and give
talks to my local developer group. When I create a github with this
framework I going to have to add a licence. Making the software
copyrighted to my company and not link to the swift.org project in any
way seem odd to me. Not my idea of "open source" or contributing to a
"major open source project". You state that the Swift community members
have spent a great deal of time and effort in getting getting Swift to even
build on Android. Congrats! I here to take it to the next level.
If there is Swift community interest the code will be free via open
source. If there is none and judging by the response from the developers in
my "Bay Area Android Developer meetup group" that hard to believe then I
make it it commercial software to be sold.
Many thanks in advance.
Sincerely yours,
Tony Constantinides

On Mon, Oct 10, 2016 at 11:15 AM, Adrian Zubarev < > adrian.zubarev@devandartist.com> wrote:

It’s disappointing that you seem not to understand what this mailing list
is for. Building a Framework does not require the evolution process. It’s
all up to you to open a GitHub repository and just start building.

Sure you can ask for help, but I believe other platforms like
stackoverflow or even swift-users would be a better place for that.

And I think your statement about rejection is totally wrong. The core
team has enough work and responsibility to care about.

--
Adrian Zubarev
Sent with Airmail

Am 10. Oktober 2016 um 20:06:26, Tony Constantinides via swift-evolution (
swift-evolution@swift.org) schrieb:

I find it extremely disappointing if Swift core members reject enhancing
Swift to target additional mobile platforms as making Swift cross-platform
is a stated goal.


(Chris Lattner) #9

As others have said, this is outside of the scope of the current swift project. I’d suggest discussing this on swift-users and consider forming a new project around it. No one is trying to be mean about this, it just isn’t relevant to swift.org, which is why you’re not getting a lot of feedback.

-Chris

···

On Oct 11, 2016, at 2:34 PM, Tony Constantinides via swift-evolution <swift-evolution@swift.org> wrote:

Ok,
Any other feedback from the Swift community other than it does not belong as part of Swift? Or get the hell out of here?
I discussing this issue so people in the Swift community are aware of what I am planning to do and have the ability to shape if they they so wish.


(Xiaodi Wu) #10

Tony--

First off, welcome to the Swift community! Second, I think you're
misunderstanding the feedback here. The swift-evolution list is not a
mailing list for Swift community discussions in general. It's a mailing
list for proposals to change the core language (how do generics work? how
does control flow work? what about arrays, dictionaries, strings?). You'll
want to write to swift-users, or another forum where the Swift community is
active, to get feedback and participation about other libraries. If there's
something in the core language that you'll need to hook into to make
Android apps work better, then this is a great place to propose those
specific changes, and you could demonstrate a compelling use case by
describing how it enables critical features in your third-party library.

Cheers,

X

···

On Tue, Oct 11, 2016 at 4:34 PM, Tony Constantinides via swift-evolution < swift-evolution@swift.org> wrote:

Ok,
Any other feedback from the Swift community other than it does not belong
as part of Swift? Or get the hell out of here?
I discussing this issue so people in the Swift community are aware of what
I am planning to do and have the ability to shape if they they so wish.

Some Technical points
Keep in mind when I say framework I do NOT mean a OSX like framework like
XCTest, I mean a third party library that doing two way communication with
your app.
a) It's not an Android Binding as that will not work, its a framework
wrapped up in a library using the bridging pattern
b) I want Swift to bootstrap the Android runtime indirectly when using the
framework. I want to make the Swift source the driving code and not the
Android Code. All events that the device sends out we be rerouted to Swift
code which will call the Java API using JNI in response
c) Android apps have a directory structure that must be maintained by the
framework to be valid. This will be handled by the framework.
d) Packages of Swift code will wrap the calls to the Java API which will
cause the need for a large library on the Swift side. The Swift developer
will use the Swift Library like any other and be unaware of its internal
routing to the Android API
e) This library will only work on Linux as there is where the Android
compilers are for ARM
Please provide input as it is welcome.
Right now I getting *crickets* which is not good.
I will be releasing a statement to the press when this work is working.
I want to state that the Swift Community actively supported it, including
Apple employees
I wish that statement to be true!
Sincerely yours,
Tony Constantinides

On Mon, Oct 10, 2016 at 12:08 PM, Tony Constantinides < > constantinnovationsinc@gmail.com> wrote:

Ok,
I was trying to follow the evolution process which states to "discuss
your idea on the mailing lists" before i begin work on it.That is what I am
doing. If you feel this work is not part of swift-evolution I shall bother
this group no longer. You have to remember I am very new to interfacing
with the Swift team hence the cautious approach. I do realize this is a
proposal and not a pitch and I am prepare to provide a great many more
details in a proposal. If you wish to point me to another swift mailing
list then please do so. If you feel this a "third party lib" then tell me
where it slots in. In other words be helpful and not react like a teen age
girl.
  Of course I will begin development of this feature on github and give
talks to my local developer group. When I create a github with this
framework I going to have to add a licence. Making the software
copyrighted to my company and not link to the swift.org project in any
way seem odd to me. Not my idea of "open source" or contributing to a
"major open source project". You state that the Swift community members
have spent a great deal of time and effort in getting getting Swift to even
build on Android. Congrats! I here to take it to the next level.
If there is Swift community interest the code will be free via open
source. If there is none and judging by the response from the developers in
my "Bay Area Android Developer meetup group" that hard to believe then I
make it it commercial software to be sold.
Many thanks in advance.
Sincerely yours,
Tony Constantinides

On Mon, Oct 10, 2016 at 11:15 AM, Adrian Zubarev < >> adrian.zubarev@devandartist.com> wrote:

It’s disappointing that you seem not to understand what this mailing
list is for. Building a Framework does not require the evolution process.
It’s all up to you to open a GitHub repository and just start building.

Sure you can ask for help, but I believe other platforms like
stackoverflow or even swift-users would be a better place for that.

And I think your statement about rejection is totally wrong. The core
team has enough work and responsibility to care about.

--
Adrian Zubarev
Sent with Airmail

Am 10. Oktober 2016 um 20:06:26, Tony Constantinides via swift-evolution
(swift-evolution@swift.org) schrieb:

I find it extremely disappointing if Swift core members reject enhancing
Swift to target additional mobile platforms as making Swift cross-platform
is a stated goal.

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution


(Tony Constantinides) #11

Thank you for that clarification. I was confused about where it fitted in.
I discuss it on swift-users.

···

On Tue, Oct 11, 2016 at 2:51 PM, Chris Lattner <clattner@apple.com> wrote:

> On Oct 11, 2016, at 2:34 PM, Tony Constantinides via swift-evolution < > swift-evolution@swift.org> wrote:
>
> Ok,
> Any other feedback from the Swift community other than it does not
belong as part of Swift? Or get the hell out of here?
> I discussing this issue so people in the Swift community are aware of
what I am planning to do and have the ability to shape if they they so wish.

As others have said, this is outside of the scope of the current swift
project. I’d suggest discussing this on swift-users and consider forming a
new project around it. No one is trying to be mean about this, it just
isn’t relevant to swift.org, which is why you’re not getting a lot of
feedback.

-Chris