I'm happy to release v11.50. This is an important update.
Download link:
One of the major steps during compilation is the conversion of the Java bytecode into Android (Dalvik) runtime bytecode. It is called "dexing". This was done by the optimized dexer which was implemented before B4A v1.00 was released. The main problem with the previous tool was the lack of support for Java 8 features, which are now used by many newer SDKs.
The workarounds didn't always work.
Starting from v11.50 the optimized dexer was removed and B4A uses Google's D8 tool during compilation. It is more powerful and it is also faster, especially with larger projects, as it allows implementing incremental compilation. Libraries are dexed once when needed. The code is also dexed incrementally.
Other than that this version also adds support for targetSdkVersion = 31. I still recommend setting it to 30 for now.
If you want to set targetSdKVersion to 31 then the main changes are:
- When requesting the fine location permission the user can choose to limit your app to coarse location. The code to handle it is:
- With a few exceptions it is no longer possible to start services in the background. One of the consequences of this restriction is that push notification messages should be sent as high priority messages. You need to set it in the B4J sending code:
- StartServiceAt / StartServiceAtExact: You need to use StartServiceAtExact and add this "non-dangerous" permission:
Download link:
B4A – The simple way to develop native Android apps
B4A includes all the features needed to quickly develop any type of Android app. B4A is used by tens of thousands of developers from all over the world, including companies such as NASA, HP, IBM and others.
www.b4x.com
The workarounds didn't always work.
Starting from v11.50 the optimized dexer was removed and B4A uses Google's D8 tool during compilation. It is more powerful and it is also faster, especially with larger projects, as it allows implementing incremental compilation. Libraries are dexed once when needed. The code is also dexed incrementally.
Other than that this version also adds support for targetSdkVersion = 31. I still recommend setting it to 30 for now.
- Optimized dexer replaced with D8 tool.
- Support for targetSdkVersion=31.
- New #ExcludedLib attribute that is required in some cases when multiple native libraries with different versions are referenced.
- Updated internal libraries: OkHttp v1.50, OkHttpUtils2 v3.00, PreoptimizedCLV v1.21, Network v1.53, B4XTable v1.22, KeyValueStore v2.31, SMM v1.12, NB6 v1.02, FirebaseNotifications v2.01, B4XCollections v1.13
- #ExcludedClasses attribute removed.
- Bug fixes and other minor improvements.
If you want to set targetSdKVersion to 31 then the main changes are:
- When requesting the fine location permission the user can choose to limit your app to coarse location. The code to handle it is:
B4X:
rp.CheckAndRequest(rp.PERMISSION_ACCESS_FINE_LOCATION)
Wait For B4XPage_PermissionResult (Permission As String, Result As Boolean)
If Result Or rp.Check(rp.PERMISSION_ACCESS_COARSE_LOCATION) Then
'we have location permission
End If
B4X:
m.Put("priority", 10)
B4X:
AddPermission(android.permission.SCHEDULE_EXACT_ALARM)