Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Chenai Nakam
@chenakam
I have successfully upgraded and loaded the sbt project, and I got the following error when compiling.
Chenai Nakam
@chenakam
A large number of APIs are not compatible anymore.
Perry
@pfn
yep, it's pretty sucky @chenakam -- need to dig through and adapt to all the new changes
Maciej Gorywoda
@makingthematrix

Hi all. And Happy New Year.

I'm working at Wire, an encrypted messenger,. Our Android client app is written in Scala. We're slowly migrating it to Kotlin.
I want to make a conference talk about the attempts of writing Scala on Android - how it went, what were the problems, what can still be done in the future.
Especially, @pfn, if you have some time and want to talk about this, I'd like to ask you some questions about your experiences. But everyone else, please ping me if you want to talk. I will be checking this channel every few days, but you can also find me on Twitter, where I live, basically. https://twitter.com/makingthematrix

Maciej Gorywoda
@makingthematrix
Haha :) That Scala 2.13 app is just a small experiment, but it got some attention. It looks like there is some interest in Android in the community after all.
In the near future I will try to investigate more and write some blog posts about Scala + GraalVM + Android + Gluon Mobile. There are many people working hard on each of these components. I guess my contribution can be simply to describe how to put them all together without much pain.
Bjorn Regnell
@bjornregnell
That would be amazing!
Rohan Sircar
@rohan-sircar
Would be great if you could get scalafx working (on graalvm at least if not on android). All my attempts to do so failed.
The javafx api is yucky.
Bjorn Regnell
@bjornregnell
@makingthematrix Would it be possible to implement your scheme in an sbt plugin or is it necessary to use mvn to get your dummy android app to fly?
You mention here https://github.com/makingthematrix/scala_android_dummyapp that there are mvn-plugins that are not available for sbt so my questionb is if it is feasible/possible to port/reimplement those for sbt or if sbt is a dead end for building android apps?
Maciej Gorywoda
@makingthematrix
@rohan-sircar So far it looks like JavaFX is working well for me. But I just started.
@bjornregnell I believe whatever mvn can do, sbt can do better ;) It's certainly not a dead end. It's just that someone needs to write those plugins for sbt. Maybe me in the future.
Maciej Gorywoda
@makingthematrix
But first I want to play a bit with all the usual features of an Android app. If it turns out, for example, that I can't have push notifications, then that's basically a blocker and no sbt plugins will change that.
Bjorn Regnell
@bjornregnell
Aha. Makes sense! It is really nice that you are digging in to this. It's one of the best things that has happened with Scala for Android for a while now :thumbsup: @makingthematrix
Maciej Gorywoda
@makingthematrix
thank you :)
Rohan Sircar
@rohan-sircar
@makingthematrix I just find it interesting that it's possible to make android apps without having to use android sdk or having explicit scala support for android.
Chenai Nakam
@chenakam
JavaFx is an obsolete technology.
Rohan Sircar
@rohan-sircar
Depends on what you mean by "obsolete".
Chenai Nakam
@chenakam
There are a lot of great cross-platform UI technologies out there, the most widely used are flutter, react native. If the official support is not good and the API is not updated in time, it will cause a lot of problems while build.
Chenai Nakam
@chenakam
But in my experience, the Android Native API is the least hassle.
Chenai Nakam
@chenakam
@makingthematrix I can give you a slightly more complicated example if you're interested: https://github.com/dedge-space/assoid, this is a lib project.
Maciej Gorywoda
@makingthematrix
@chenakam : Thanks. I'm aware of React Native. I need to learn more about it but my first impression is that there's quite a lot of workaround. Going from Scala I would need Scala.js, then that would be translated to JS, then that would be put in a wrapper, and then that would be compiled. I'm not sure but shouldn't that mean that the result app is not as fast and more bloated than the GraalVM approach?
And funny thing with JavaFX. It actually was deemed obsolete a few years ago, but since it's a separate project now, it looks like there's more work on it than ever.
I'd say I'd give it a try :)
Maciej Gorywoda
@makingthematrix
Anyway, at this moment I don't think these two approaches need to be competitors. Any solution that actually works is good for me.
Rohan Sircar
@rohan-sircar
If JavaFX is "obsolete" then I wonder what that would say about Swing. Given JavaFX is much more featureful than it and yet Swing is used in a major IDE.
It's no react for sure, it doesn't have the corporate backing that it and android have either. But it's open source, relatively actively maintained, and there are things it can do that either of those cannot - good integration with scala for one.
At the end of the day your requirements decide what you should go with, and there are requirements where JavaFX is the right choice.
Chenai Nakam
@chenakam
I wrote about Swing a long time ago, and I think Android Native's UI components are probably the most advanced and appropriate by comparison, especially when combined with Scala/Java. Learning about other UI component libraries is also a waste of time if not necessary.
For reference only.
Maciej Gorywoda
@makingthematrix
@chenakam : I'm kind of disappointed with the current state of Android widgets, tbh. I don't say JavaFX is better, but especially since Android 11 came out, my work is mostly about fixing bugs which are there in our app because the new SDK broke something. I would really like to have an alternative.

By the way, I decided to dig a bit deeper into JavaFX widgets. I want towrite more examples, each one testing one of the main features and Android app should have. The first one (well, second, if I count the dummy one) is based on "Fifty States" from Gluon Mobile samples. It's a scrollable list of European Union countries and Scotland. The flags of countries are being downloaded from Wikipedia in the run time and stored in a file cache.

I also added some notes about problems I faced, how you can write this from scratch, and what next I want to do.
Here's the link to GitHub: https://github.com/makingthematrix/scalaonandroid/wiki/European-Union-(and-Scotland)-example

Ondra Pelech
@sideeffffect
I awesome to hear that one can use Scala to build Android apps again! :tada:
Have you had any experience developing Android apps with Scala and React Native? ( https://slinky.dev/docs/native-and-vr/ )
If yes, how would you compare these two approaches? Scala+Gluon+GraalVM vs Scala.js+Slinky+ReactNative
Maciej Gorywoda
@makingthematrix
@sideeffffect : No, I didn't use React. But the last few years I work on Wire, an encrypted messager, in the Android team. We slowly migrate the codebase to Kotlin, but still 2/3 of it is in Scala (but it's Scala 2.11).
Chenai Nakam
@chenakam
@makingthematrix Android's component library is a bit complicated, due to the legacy issues of various versions.
And I just looked at Gluon and expect it to beat Flutter. It's worth a try.
Maciej Gorywoda
@makingthematrix
yup :)
Shafqat Ullah
@shafqatevo
A bit off-topic: does anyone here have experience with using Akka from a Kotlin Android app? What's the simplest way to go about it?
Shafqat Ullah
@shafqatevo
Our goal is to reuse certain Akka ActorSystems from backend in the Android app code
Maciej Gorywoda
@makingthematrix
@shafqatevo : You probably want to into the Java side of Akka (wow, the sound of it...) : https://developer.lightbend.com/guides/akka-quickstart-java/?_ga=2.162834234.724702319.1611691699-389016145.1611581822
From there it shouldn't be much trouble to use it in Kotlin
Chenai Nakam
@chenakam
直接用 Scala 写 Android app 不好吗?
Maciej Gorywoda
@makingthematrix
Hey,
A month ago I had a talk about Scala on Android on the ScalaLove conference. The video has just been published. And I also turned the transcription into a blog post:
https://makingthematrix.wordpress.com/2021/03/17/scala-on-android/
And here's a direct link to the video: https://youtu.be/i_fWL0tEsVM
Bjorn Regnell
@bjornregnell
coool! great talk! very interesting!!
Bjorn Regnell
@bjornregnell
perhaps this gitter thread should be renamed scala-android as it is about more then "just" the sbt plugin...
Bjorn Regnell
@bjornregnell
@makingthematrix I hope your interesting and enlightening talk will trigger the scala-android community to start experimenting with your stack. I'll have a go when I get some time over!
Maciej Gorywoda
@makingthematrix
@bjornregnell : Hey, thanks! :) I think a Gitter channel is linked to the repository. But if there's enough interest, maybe we can get a channel on one of Discord servers for learning Scala (I know about three already. Happy times.)