Android Question UsageStatsManager for B4A

manojk

Member
Licensed User
Team,

I read a blog on usage stats manager , but I have few doubts on that , Iam new to B4A and hence need your guidance on this . I see that the code given is for B4X but I want to implement it in B4A.

When I tried running the same in B4A tool , it gives error in the "Dim um As UsageStatsManager" line in the "UseMex.b4a" module

My goal is to get the app usage stats in B4A and write to file in android device storage on a periodic basis as a background service. thanks in advance
 

manojk

Member
Licensed User
Sorry to be naive Erel , do I need to install B4X for using this library. As of now I have installed and configured only B4A in my machine
 
Upvote 0

Brian Dean

Well-Known Member
Licensed User
Longtime User
... do I need to install B4X for using this library.
No, you don't. In fact there is no such thing as the "B4X product"; the B4A, B4J and B4i products are all B4X. "B4X" just means that exactly the same code can be written to run under Android, Java or Apple OS. You might need to use #if B4J ... or #if B4A when you use platform specific features, like mouse and keyboard versus touch input, but these can all live within the same code module. However some libraries are platform specific, which is one reason why there are separate B4A, B4J and B4i products.

What Erel is asking is - did you download the UsageStatsManagerV1.0.zip package, unzip it, and put the two files (.jar and .xml) into your "Additional Libraries" folder? Then open the Libraries tab in B4A (right click and "Refresh" if B4A was already open) and tick the UsageStatsManager entry.
 
Upvote 0

manojk

Member
Licensed User
Thanks Brian for the clarification on the B4X suite :) , I extracted the .jar and .xml into a different folder called additional librarires and the module is working fine...appreciate your help ..thx
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
For the Additional Libraries folder you should use a structure like this:

1607010597967.png


More information in the B4X Getting started booklet HERE.
The booklets can be found HERE.
 
Upvote 0
Top