Java static methods in Kotlin

 The best way to represent a static Java method in Kotlin
11 September 2017   3049

You can place the function in the "companion object"

So the java code like this:

class Foo { public static int a() { return 1; } }

will become

class Foo { companion object { fun a() : Int = 1 } }

What is Companion Objects?

An object declaration inside a class can be marked with the companion keyword:

class MyClass {
   companion object Factory {
       fun create(): MyClass = MyClass()
   }
}

Members of the companion object can be called by using simply the class name as the qualifier:

val instance = MyClass.create()

However, on the JVM you can have members of companion objects generated as real static methods and fields, if you use the @JvmStatic annotation. See the Java interoperability section for more details.

Firefox to Launch Preview Browser

Firefox Preview uses the GeckoView engine built on the basis of Firefox Quantum and team states its 2x faster than previous Firefox browser for Android
28 June 2019   634

Mozilla introduced the first trial release of the Firefox Preview browser, developed under the codename Fenix ​​and aimed at initial testing by interested enthusiasts. The release is distributed through the Google Play catalog, and the code is available on GitHub. After stabilization of the project and implementation of all conceived functionality, the browser will replace the current edition of Firefox for Android, the release of which will be discontinued starting with the September release of Firefox 69 (only corrective updates of the Firefox 68 ESR branch will be published).

Firefox Preview uses the GeckoView engine built on the basis of Firefox Quantum technologies and a set of Mozilla Android Components libraries, which are already used to build Firefox Focus and Firefox Lite browsers. GeckoView is a version of the Gecko engine, designed as a separate library that can be updated independently, and Android Components includes libraries with typical components that provide tabbed browsing, automatic input completion, search hints, and other browser features.

Firefox Preview
Firefox Preview

These are some features developers claim their app has:

  • Faster than ever: Firefox Preview is up to 2x faster than previous versions of Firefox for Android.
  • Fast by design: with a minimalist start screen and bottom navigation bar, Preview helps you get more done on the go.
  • Stay organized: Make sense of the web with Collections, a new feature that helps you save, organize, and share collections of sites. Quickly save and return to tasks like your morning routine, shopping lists, travel planning and more.
  • Tracking Protection on by default: Everyone deserves freedom from invasive advertising trackers and other bad actors so Firefox Preview blocks trackers by default. The result is faster browsing and fewer annoyances.