Details
-
Bug
-
Resolution: Fixed
-
P3: Somewhat important
-
6.5.1
-
None
-
-
2023wk44FOQtforAndroid
Description
We get some linter issues of QtLoader.java
/.../src/android/java/src/org/qtproject/qt/android/bindings/QtLoader.java:161: Warning: Use of this function is discouraged because resource reflection makes it harder to perform build optimizations and compile-time verification of code. It is much more efficient to retrieve resources by identifier (e.g. R.foo.bar) than by name (e.g. getIdentifier("bar", "foo", null)). [DiscouragedApi] int id = resources.getIdentifier("bundled_libs", "array", packageName); ~~~~~~~~~~~~~ /.../src/android/java/src/org/qtproject/qt/android/bindings/QtLoader.java:197: Warning: Use of this function is discouraged because resource reflection makes it harder to perform build optimizations and compile-time verification of code. It is much more efficient to retrieve resources by identifier (e.g. R.foo.bar) than by name (e.g. getIdentifier("bar", "foo", null)). [DiscouragedApi] int id = resources.getIdentifier("fatal_error_msg", "string", ~~~~~~~~~~~~~ /.../src/android/java/src/org/qtproject/qt/android/bindings/QtLoader.java:216: Warning: Use of this function is discouraged because resource reflection makes it harder to perform build optimizations and compile-time verification of code. It is much more efficient to retrieve resources by identifier (e.g. R.foo.bar) than by name (e.g. getIdentifier("bar", "foo", null)). [DiscouragedApi] int id = resources.getIdentifier("qt_libs", "array", packageName); ~~~~~~~~~~~~~ /.../src/android/java/src/org/qtproject/qt/android/bindings/QtLoader.java:219: Warning: Use of this function is discouraged because resource reflection makes it harder to perform build optimizations and compile-time verification of code. It is much more efficient to retrieve resources by identifier (e.g. R.foo.bar) than by name (e.g. getIdentifier("bar", "foo", null)). [DiscouragedApi] id = resources.getIdentifier("use_local_qt_libs", "string", packageName); ~~~~~~~~~~~~~ /.../src/android/java/src/org/qtproject/qt/android/bindings/QtLoader.java:227: Warning: Use of this function is discouraged because resource reflection makes it harder to perform build optimizations and compile-time verification of code. It is much more efficient to retrieve resources by identifier (e.g. R.foo.bar) than by name (e.g. getIdentifier("bar", "foo", null)). [DiscouragedApi] id = resources.getIdentifier("bundle_local_qt_libs", "string", packageName); ~~~~~~~~~~~~~ /.../src/android/java/src/org/qtproject/qt/android/bindings/QtLoader.java:238: Warning: Use of this function is discouraged because resource reflection makes it harder to perform build optimizations and compile-time verification of code. It is much more efficient to retrieve resources by identifier (e.g. R.foo.bar) than by name (e.g. getIdentifier("bar", "foo", null)). [DiscouragedApi] id = resources.getIdentifier("system_libs_prefix","string", ~~~~~~~~~~~~~ /.../src/android/java/src/org/qtproject/qt/android/bindings/QtLoader.java:286: Warning: Use of this function is discouraged because resource reflection makes it harder to perform build optimizations and compile-time verification of code. It is much more efficient to retrieve resources by identifier (e.g. R.foo.bar) than by name (e.g. getIdentifier("bar", "foo", null)). [DiscouragedApi] id = resources.getIdentifier("load_local_libs", "array", packageName); ~~~~~~~~~~~~~ /.../src/android/java/src/org/qtproject/qt/android/bindings/QtLoader.java:304: Warning: Use of this function is discouraged because resource reflection makes it harder to perform build optimizations and compile-time verification of code. It is much more efficient to retrieve resources by identifier (e.g. R.foo.bar) than by name (e.g. getIdentifier("bar", "foo", null)). [DiscouragedApi] id = resources.getIdentifier("static_init_classes", "string", packageName); ~~~~~~~~~~~~~ Explanation for issues of type "DiscouragedApi": Discouraged APIs are allowed and are not deprecated, but they may be unfit for common use (e.g. due to slow performance or subtle behavior).
It should be refactored to use R.qt.bundled_libs or something like this.
Attachments
Issue Links
- is covered by
-
QTBUG-114593 Simpler Qt for Android Java bindings
- Closed