Posts

Showing posts from February, 2019

Method References by the Double-colon Separator :: in Java

The double-colon separator :: has been available since Java 8.  The purpose is to provide a way to refer to a method without executing it .  Method reference is similar to the sense of Lambda expression in that it requires a target method that fits in a functional interface. Procedural programming requires passing variables or objects as parameters.  Now with method references, we can pass a method as a parameter.  The double-colon :: separator allows references to static methods or instance methods.  The syntax of both is similar.  The below example demonstrates the use of method references to static methods. import java.util.function.*; class MyTools { // This class contains some simple static methods. static String changeI2We (String s) { return s.replaceAll( "I" , "we" ); } static String addAuthor (String s) { return s + " -- Calmalgo" ; } static Integer countWords (String s...

Google Play Requirement by Aug 1, 2019 - Using native code must provide a 64-bit version in addition to the 32-bit version

For Andriod apps, there is a requirement from Google Play Store that all apps using native code must provide a 64-bit version in addition to the 32-bit version by Aug 1, 2019. The requirement does not apply to a few scenarios including apps targeting Wear OS or Andriod TV.  Those form factors currently do not support 64-bit mode. According to the official Google Play Guides: The first thing to do is check to see if your app uses any native code. Your app makes use of native code if it: Uses any C/C++ (native) code in your app Links with any third party native libraries Is built by a third-party app builder that uses native libraries If your Andriod apps are entirely written in the Java language or Kotlin, you do not need to worry about the new requirement at all.  This is because those apps are already 64-bit ready. References: Get your apps ready for the 64-bit requirement - Andriod Developers Blog Ensure that your app supports 64-bit devices - Google ...