title: Get string from Flutter in Android specific code (Java/Kotlin)
body: <p>I have my strings in <strong>.arb</strong>, as usual for Flutter apps, and I need to use them in my Android specific code (written in Java/Kotlin).</p>
  <p>My code is always resulting in <strong>not implemented</strong> (I tried invoking both <strong>getStringResource</strong> and <strong>Localization.getStringResource</strong> and the result is the same).</p>
  <p>How can I load Flutter strings from Android specific code?</p>
  <p><strong>app_en.arb:</strong></p>
  <pre class="lang-dart prettyprint-override"><code>{
      &quot;helloWorld&quot;: &quot;Hello World!&quot;,
      &quot;@helloWorld&quot;: {
        &quot;description&quot;: &quot;Hello world message&quot;
      }
  }
  </code></pre>
  <p>This is the Android specific code (Kotlin):</p>
  <pre class="lang-kotlin prettyprint-override"><code>package com.example.flutter_application
  
  import android.util.Log
  import androidx.annotation.NonNull
  import io.flutter.embedding.android.FlutterActivity
  import io.flutter.embedding.engine.FlutterEngine
  import io.flutter.plugin.common.MethodChannel
  import io.flutter.plugin.common.MethodChannel.Result
  import org.json.JSONObject
  
  class MainActivity : FlutterActivity() {
      private val CHANNEL = &quot;samples.flutter/myChannel&quot;
      private val TAG = &quot;TestFlutterString&quot;
  
      override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) {
          super.configureFlutterEngine(flutterEngine)
          MethodChannel(flutterEngine.dartExecutor.binaryMessenger, CHANNEL)
              .setMethodCallHandler { call, result -&gt;
                  if (call.method == &quot;test&quot;) {
                      testLoadFlutterString(flutterEngine)
                  } else {
                      result.notImplemented()
                  }
              }
      }
  
      /**
       * Tries to load a string from flutter code and print it to log
       */
      private fun testLoadFlutterString(flutterEngine: FlutterEngine) {
          val callback = object : Result {
              override fun success(result: Any?) {
                  Log.d(TAG, &quot;success: ${result.toString()}&quot;);
              }
  
              override fun error(errorCode: String?, errorMessage: String?, errorDetails: Any?) {
                  Log.d(TAG, &quot;error: $errorCode - $errorMessage&quot;);
              }
  
              override fun notImplemented() {
                  Log.d(TAG, &quot;not implemented&quot;);  // &lt;---- This is the current result
              }
          }
          val args = JSONObject()
          args.put(&quot;key&quot;, &quot;helloWorld&quot;)
          args.put(&quot;locale&quot;, &quot;en&quot;)
          flutterEngine.localizationChannel.channel.invokeMethod(
              &quot;Localization.getStringResource&quot;,
              args,
              callback
          )
      }
  }
  </code></pre>