B4A v5.80 includes a new attribute named #ExcludeClasses.
Example:
During compilation, all classes from all referenced libraries, that their full name (package + class) starts with one of the above prefixes, will not be included in the APK.
Why is it useful?
If you are only interested in the maps functionality of google play services:
Example:
B4X:
#ExcludeClasses: com.google.ads, anywheresoftware.b4a.phone.RingtoneManager
Why is it useful?
- Smaller APK, faster compilation and faster installation. This is especially useful when referencing the large google play services library.
- Removing libraries based on the selected build configuration. Like all other attributes you can use compilation symbols to add or remove this attribute.
- Removing unsupported classes. For example, Amazon rejects APKs that include the RingtoneManager classes. So instead of modifying the Phone library, you can exclude the problematic classes.
If you are only interested in the maps functionality of google play services:
B4X:
#ExcludeClasses: .games, .drive, .ads, .fitness, .wearable, .measurement, .cast, .auth, .nearby
#ExcludeClasses: .tagmanager, .analytics, .wallet, .plus, .vision, .gcm
Last edited: