Erel B4X founder Staff member Licensed User Longtime User Feb 4, 2016 #1 B4A v5.80 includes a new attribute named #ExcludeClasses. Example: Code: Copy #ExcludeClasses: com.google.ads, anywheresoftware.b4a.phone.RingtoneManager 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? 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. As google play services is the main candidate for this feature, any prefix that starts with a dot will be converted to google play services package (com.google.android.gms). If you are only interested in the maps functionality of google play services: Code: Copy #ExcludeClasses: .games, .drive, .ads, .fitness, .wearable, .measurement, .cast, .auth, .nearby #ExcludeClasses: .tagmanager, .analytics, .wallet, .plus, .vision, .gcm Last edited: Feb 23, 2016
B4A v5.80 includes a new attribute named #ExcludeClasses. Example: Code: Copy #ExcludeClasses: com.google.ads, anywheresoftware.b4a.phone.RingtoneManager 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? 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. As google play services is the main candidate for this feature, any prefix that starts with a dot will be converted to google play services package (com.google.android.gms). If you are only interested in the maps functionality of google play services: Code: Copy #ExcludeClasses: .games, .drive, .ads, .fitness, .wearable, .measurement, .cast, .auth, .nearby #ExcludeClasses: .tagmanager, .analytics, .wallet, .plus, .vision, .gcm
MikeH Well-Known Member Licensed User Longtime User Feb 10, 2016 #21 I like this ExcludeClasses attribute, thanks Erel. Do you think an IncludeClasses attr would be possible so that instead of typing: Code: Copy #ExcludeClasses: .games, .drive, .fitness, .wearable, .measurement, .cast, .auth, .nearby, .tagmanager, analytics, .wallet, .plus, .vision, .gcm, .maps when we only want ads we could instead type Code: Copy #IncludeClasses: .ads Upvote 0
I like this ExcludeClasses attribute, thanks Erel. Do you think an IncludeClasses attr would be possible so that instead of typing: Code: Copy #ExcludeClasses: .games, .drive, .fitness, .wearable, .measurement, .cast, .auth, .nearby, .tagmanager, analytics, .wallet, .plus, .vision, .gcm, .maps when we only want ads we could instead type Code: Copy #IncludeClasses: .ads
Erel B4X founder Staff member Licensed User Longtime User Feb 10, 2016 #22 #ExcludeClasses is not just for excluding classes from google play services. It is a general feature to remove classes during compilation. Upvote 0
#ExcludeClasses is not just for excluding classes from google play services. It is a general feature to remove classes during compilation.
S sorex Expert Licensed User Longtime User Feb 10, 2016 #23 The best I could get was from 2MB > 1458K but I see there is still a lot of i mages (235K) included from Google Plus which was excluded. Did they somehow sneak in with gms.internal? Edit: must be the additional res line for admob that added it... Upvote 0
The best I could get was from 2MB > 1458K but I see there is still a lot of i mages (235K) included from Google Plus which was excluded. Did they somehow sneak in with gms.internal? Edit: must be the additional res line for admob that added it...
Erel B4X founder Staff member Licensed User Longtime User Feb 10, 2016 #24 sorex said: must be the additional res line for admob that added it... Click to expand... That's true. Upvote 0
sorex said: must be the additional res line for admob that added it... Click to expand... That's true.
abhishek007p Active Member Licensed User Longtime User Feb 14, 2016 #25 What is the code if i *only* want to show AdMob ads on my apps ? Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Feb 14, 2016 #26 Code: Copy #ExcludeClasses: .games, .drive, .fitness, .wearable, .measurement, .cast, .auth, .nearby #ExcludeClasses: .tagmanager, .analytics, .wallet, .plus, .vision, .gcm, .maps Last edited: Feb 23, 2016 Upvote 0
Code: Copy #ExcludeClasses: .games, .drive, .fitness, .wearable, .measurement, .cast, .auth, .nearby #ExcludeClasses: .tagmanager, .analytics, .wallet, .plus, .vision, .gcm, .maps
Pendrush Well-Known Member Licensed User Longtime User Feb 22, 2016 #28 Instead Code: Copy #ExcludeClasses: .games, .drive, .fitness, .wearable, .measurement, .cast, .auth, .nearby #ExcludeClasses: .tagmanager, analytics, .wallet, .plus, .vision, .gcm, .maps Use Code: Copy #ExcludeClasses: .games, .drive, .fitness, .wearable, .measurement, .cast, .auth, .nearby #ExcludeClasses: .tagmanager, .analytics, .wallet, .plus, .vision, .gcm, .maps Difference is DOT in front of word analytics Upvote 0
Instead Code: Copy #ExcludeClasses: .games, .drive, .fitness, .wearable, .measurement, .cast, .auth, .nearby #ExcludeClasses: .tagmanager, analytics, .wallet, .plus, .vision, .gcm, .maps Use Code: Copy #ExcludeClasses: .games, .drive, .fitness, .wearable, .measurement, .cast, .auth, .nearby #ExcludeClasses: .tagmanager, .analytics, .wallet, .plus, .vision, .gcm, .maps Difference is DOT in front of word analytics
S sorex Expert Licensed User Longtime User Feb 29, 2016 #29 @Erel , Can I use this on the core libs aswell? Like using only the phone awake from the phone library to roll back some "install rights" Edit: I see that it only added the "prevent phone from sleeping" when tagging the phone lib, which is fine. Last edited: Feb 29, 2016 Upvote 0
@Erel , Can I use this on the core libs aswell? Like using only the phone awake from the phone library to roll back some "install rights" Edit: I see that it only added the "prevent phone from sleeping" when tagging the phone lib, which is fine.
Erel B4X founder Staff member Licensed User Longtime User Feb 29, 2016 #30 There is no relation between the classes and the permissions added. Adding the Phone library will not add any permission to your app. Only when you declare a PhoneWakeState variable then the relevant permission will be added. Upvote 0
There is no relation between the classes and the permissions added. Adding the Phone library will not add any permission to your app. Only when you declare a PhoneWakeState variable then the relevant permission will be added.
walterf25 Expert Licensed User Longtime User Feb 29, 2016 #31 Informatix said: I will continue to use ProGuard as it shrinks my APK automatically, but it's a great feature anyway. The new version is more and more attractive. Click to expand... How can we use ProGuard?, is there any tutorials you can point us to so that we can try it as well? Thanks, Walter Upvote 0
Informatix said: I will continue to use ProGuard as it shrinks my APK automatically, but it's a great feature anyway. The new version is more and more attractive. Click to expand... How can we use ProGuard?, is there any tutorials you can point us to so that we can try it as well? Thanks, Walter
Informatix Expert Licensed User Longtime User Mar 2, 2016 #32 walterf25 said: How can we use ProGuard?, is there any tutorials you can point us to so that we can try it as well? Thanks, Walter Click to expand... Proguard is a bit complex to use for B4A developers and I don't know any tutorial. There's a documentation: http://proguard.sourceforge.net/index.html#manual/introduction.html Upvote 0
walterf25 said: How can we use ProGuard?, is there any tutorials you can point us to so that we can try it as well? Thanks, Walter Click to expand... Proguard is a bit complex to use for B4A developers and I don't know any tutorial. There's a documentation: http://proguard.sourceforge.net/index.html#manual/introduction.html