Android Tutorial [B4X] B4A, B4i, B4J and B4r API documentation - B4X Object Browser

Status
Not open for further replies.
API documentation - B4a, B4i, B4J and B4R (i.e. B4X) Object Browser (which also includes Code Snippet Management)

Hi everyone,

As you may or may not be aware, I have embarked on a project to bring better documentation to us all.

The first problem I have had is that the official and semi-official documentation tools aren't what I was hoping for. Not saying they aren't good, they just aren't what I need.

My first thankyou was called the B4a Object Browser. This version was for B4Android only. It is my own version of the XML file loader. I call it the B4a Object Browser.

The second thankyou is an updated version that supports B4A, B4I and B4J. This is called the B4X Object Browser.

If you know the Visual Studio Object Browser, you should have a good idea of what I am trying to emulate.

To run it you must have .NET Framework 3.5 SP1 installed, and you must install it from my setup.

I have only tested it on Windows, and not with Mono.
I am assuming that everyone that wants to use it, will be on Windows.

Here are some screenshots:

B4AObjectBrowser3.1.4.0.png


upload_2014-12-18_21-26-19.png


Download the appropriate zip, unzip it and run the setup. I suggest you scan it for viruses before you run it of course.

B4A Object Browser:
When it runs the first time, it will need to know where the B4a Library XML files are, so ensure you go into the Options and configure them.
If you are upgrading, you can Import your old settings, and in fact are prompted to do so if you have a blank configuration.

If you are asked to find the B4A Library XML files, browse to your B4a Library folder (usually C:\Program Files\Anywhere Software\Basic4android\Libraries, or if you are using 64 bit Windows, it is C:\Program Files (x86)\Anywhere Software\Basic4android\Libraries)

From this point, it will remember the path, so you will not have to enter it again.

B4X Object Browser:
The paths to your B4A, B4I and B4J installations (and the Libraries folders under them) will be determined automatically.

In the Options screen you can set multiple paths, with the ability to modify them.

It has multi-language support, and will detect your PC's language and apply the changes automatically. If you want to over-ride this, you may do so from the Options screen.

In B4A Object Browser, the following languages are supported:

Afrikaans
Arabic
Bulgarian
Chinese
Czech
Danish
Dutch
English
French
German
Hebrew
Indonesian
Italian
Japanese
Norwegian
Persian
Polish
Portuguese
Romanian
Russian
Spanish
Swedish
Thai
Ukrainian
Vietnamese

B4X Object Browser adds support for:
Catalan
Greek


I suggest everyone that uses this tool subscribe to the thread so you are informed of changes.

Have fun!

Dave

Change history:
B4A Object Browser
2.0.0.0 - First public release.
2.0.1.0 - Minor GUI update, remove the need to click Reload button during initial setup.
2.1.0.0 - See post #8
2.2.0.0 - See post #23
2.3.0.0 - see post #31
2.3.0.0 - see post #35
2.4.0.0 - see post #60
2.5.0.0 - see post #63
2.6.0.0 - see post #70
2.6.1.0 - see post #75
2.7.0.0 - see post #79
3.0.0.0 - (Pre-release)
3.0.1.0 - Major GUI updates
3.0.1.1 - Minor fixes to correct some "Copy" functionality that had been removed
3.1.0.0 - All known bugs fixed, plus multiple language support added. Separate link provided below. See post 112 for full info.
3.1.1.0 - Additional languages, ability to override GUI language, Chinese language fixed. See post 122 for more info.
3.1.2.0 - Fixes to French, German and Italian language translations. 15 languages now provided. Search history added.
3.1.3.0 - Portuguese language added, making this language number 16
3.1.4.0 - Updated ru and ja translations, Moved Options to View menu, Added support for DesignerName attribute. See post 128 for full details.
3.1.5.0 - Corrected some logic problems around Version Number and DependsOn. Fixed URL Links. See post 147 for full details.
3.1.6.0 - Increased search options, fixed some search bugs, added Hebrew. Full details in post 156.
3.2.0.0 - AutoUpdate, new language, a couple of minor bugfixes. Full details in post 157.
3.2.1.0 - New languages, a few bugfixes. Full details in post 164.
3.2.2.0 - Updated Thai translation.
3.2.3.0 - Fixed further Thai translation strings, arabic and Thai language settings, memory corruption error when switching from R-L and L-R languages and more
3.2.4.0 - Added the ability to override language settings.* See "How to override language setting.txt" in the installation directory.
3.2.4.1 - Fixed bug when overriding language settings.
3.2.4.2 - Fixed bug when selecting the following languages: Arabic, Bulgarian, Hebrew, Thai
3.2.4.3 - Fixed bug when showing empty parentheses, Search and Clear Search buttons, bug where Clear Search button forced library reload even if no search text was entered
3.2.4.4 - Fixed bug where installer did not remove previous version
3.2.5.0 - Added ability to select viewing of Class_Globals and Property Get / Property Set
3.2.5.1 - Added ability to select viewing of DesignerCreateView
3.2.5.2 - Added Romanian language
3.2.5.3 - Fixed problem when selecting Romanian
3.2.5.4 - Fixed 2nd problem when selecting Romanian
3.2.5.5 - Added Vietnamese language
3.2.5.6 - Added preliminary support for B4a 3.0 (Beta)
3.2.5.7 - Added ability to show duplicate Library Short Names
3.2.5.8 - Forced GUI to always show Full type name when showing Class and Library annotations
3.2.5.9 - Fixed a bug when reloading libraries after performing a search. Also added Donate form.
3.2.5.10 - Set XML Reader to null after closing the file, plus set properties to remove flickering when displaying file data.
3.2.5.11 - Corrected an issue where a blank History would cause an application error
3.2.5.12 - Added Czech, Danish and Persian languages
3.2.5.13 - Persian language updated
3.2.5.14 - Added "Always on top" setting (under "Always on top" menu setting) and modified each Form to follow this setting
----------- Note: No further updates will be performed to B4a Object Browser

Full list of changes here (before 3.2.5.1): http://www.b4x.com/android/forum/th...n-b4a-object-browser.25682/page-9#post-172076

B4X Object Browser
1.0.0.0 - First public release
4.0.0.1 - Minor changes - mainly updating graphics to reflect Anywhere Software changes.
4.0.0.2 - Bug fixes, Desktop icon.
4.1.0.0 - Code Snippet Management added.
4.1.1.1 - Spanish language updates
4.1.1.2 - Modified the Method / Property / Field Copy function appropriately to copy either the selected text or all text
4.1.1.3 - Performed multiple bug-fixes to correct issues with right-click commands
4.1.1.4 - Performed another bug-fix to the right-click menu (for Events list)
4.1.1.5 - Performed another bug-fix to the right-click menu (for copying Fullname)
4.1.2.0 - Added support for B4R
4.1.3.0 - Changed auto-update download to .msi (instead of .exe)

I have put together a pdf to understand how to use it. It is included in the setup, but you can get it separately here (559 Kb).
Grab the setup and unzip and install it. This must be done this way because of the file size being too big for the forum. (>2 MB)...

B4a Object Browser
Version 3.2.0.0 (NOT AutoUpdate) is available here.
Version 3.2.1.0 (AutoUpdate enabled) is available here.
All newer versions (from Version 3.2.2.0 onwards) are available through AutoUpdate, and will not be provided here (other than the link below).
The latest version is always available from here.

B4X Object Browser
The latest B4x Version is available from here. AutoUpdate will take over from that point.
 

Attachments

  • upload_2014-12-11_22-32-46.png
    upload_2014-12-11_22-32-46.png
    106.1 KB · Views: 2,749
Last edited:

Roger Garstang

Well-Known Member
Licensed User
Longtime User
Nice. Something like this should be a part of B4A. All the files are there, it would only make sense to make use of them. It is even useful for those of us developing libraries to see full return types and our own documentation.

Just a Couple Suggestions:
1. XML always takes a while to parse. The Yellow Loading thing/label drawing over the controls just looks weird. I think I've only seen that in old Windows 3.x and JAVA apps. Adding a Status bar with a Progress Bar in it would look really sharp. I mostly do Win Mobile in C# lately and prefer straight code without .Net in my Desktop apps, so I can't remember if .Net has a built-in Progress Bar you can add to a Status Bar. If not you can just put the progress bar on the form or in other IDEs I just set the parent of the progress bar to the status bar then size it to match the panel size and it works well. I do remember .Net is strict on making you delegate something as simple as a progress update and won't let you update it from the GUI thread which got annoying too.

2. Lots of flicker when the Treeview is updating. Might be a good idea to call BeginUpdate on it, load it, then call EndUpdate to make it smoother.
 

Vader

Well-Known Member
Licensed User
Longtime User
Nice. Something like this should be a part of B4A. All the files are there, it would only make sense to make use of them. It is even useful for those of us developing libraries to see full return types and our own documentation.

Just a Couple Suggestions:
1. XML always takes a while to parse. The Yellow Loading thing/label drawing over the controls just looks weird. I think I've only seen that in old Windows 3.x and JAVA apps. Adding a Status bar with a Progress Bar in it would look really sharp. I mostly do Win Mobile in C# lately and prefer straight code without .Net in my Desktop apps, so I can't remember if .Net has a built-in Progress Bar you can add to a Status Bar. If not you can just put the progress bar on the form or in other IDEs I just set the parent of the progress bar to the status bar then size it to match the panel size and it works well. I do remember .Net is strict on making you delegate something as simple as a progress update and won't let you update it from the GUI thread which got annoying too.

2. Lots of flicker when the Treeview is updating. Might be a good idea to call BeginUpdate on it, load it, then call EndUpdate to make it smoother.

1. Fixed
Statusbar added
I am also investigating having an additional Option to allow loading of XML data either at the beginning, or upon clicking the Namespace/File. This will speed up loading immensely (but spread the wait time out over the user's runtime session).

2. Fixed
Apparently there is a bug in .Net that stops BeginUpdate and EndUpdate from working properly - the Treeview never redraws. I however fixed it by creating a new BufferedTreeView that has Double Buffering enabled. Not my code, but works brilliantly.
 

Vader

Well-Known Member
Licensed User
Longtime User
Version 2.2.0.0 Added to first post.

Additions:
Renamed to B4A Object Browser
Multiple paths can now be specified
Statusbar added (progress and text) to show what load action is being performed
Option added to allow loading of Libraries upon demand (ie when you click it), and set to default
When choosing a file, the treeview expands that file's details automatically

Bugfixes:
Treeview flickering is now much improved or removed
When viewing Properties with Don't show empty parentheses selected, an empty bracket was shown in the usage.

Known issues:
Unicode text still not displaying correctly
HTML codes not handled (eg <U>Text</U> is not displayed as Text)
 

corwin42

Expert
Licensed User
Longtime User
Great tool.

Just some comments:

- If a method has the BA object as the first parameter you should hide it. It is hidden in the IDE, too.

- There is a bit more documentation in the XML. If the library is selected on the left can you display the library documentation and if a class is selected and not a member can you display the object documentation?
 

Vader

Well-Known Member
Licensed User
Longtime User
Great tool.

Just some comments:

- If a method has the BA object as the first parameter you should hide it. It is hidden in the IDE, too.

- There is a bit more documentation in the XML. If the library is selected on the left can you display the library documentation and if a class is selected and not a member can you display the object documentation?

Please provide an example of each and I will ensure I cater for it in the next version (which will be soon).
 

corwin42

Expert
Licensed User
Longtime User
You can see the BA parameter in AHQuickAction library in AHQuickAction.Initialize method.

I think nearly all standard B4A libraries have a library documentation and an class/object documentation.
 

Vader

Well-Known Member
Licensed User
Longtime User
You can see the BA parameter in AHQuickAction library in AHQuickAction.Initialize method.

I think nearly all standard B4A libraries have a library documentation and an class/object documentation.

The documentation of each method/property is an HTML text, so they may contain tags <></> and special chars like &amp; or &quote;. I admit it's not very common but if you want to create a perfect tool...

Thanks guys. Rest assured I am working on implementing your suggestions.

I have already fixed the following:
Class comments not displayed
Property Read or ReadWrite was not shown (I had to work out that it depends on the number of parameters)
Property Return type was not shown
Class Object Wrapper value was not shown
Additional option added to not display BA object if it is the first parameter of a Method

BREAKING NEWS
I have also implemented a create documentation feature where you can get the tool to create RTF documentation for the selected scope (Library/Class/Method/All)
As an example, the complete B4A documentation set is around 1129 A4 pages, and took about 10 minutes for the tool to create it.

This is actually the real reason why I have taken the time to create this tool - I was being selfish and needed documentation ;).



And more...

Watch this space.
 

Vader

Well-Known Member
Licensed User
Longtime User
You can see the BA parameter in AHQuickAction library in AHQuickAction.Initialize method.

I think nearly all standard B4A libraries have a library documentation and an class/object documentation.

I can't find any XML file that has documentation at the Library level. Class yes, Library no.

Do you have one for me?
 

Vader

Well-Known Member
Licensed User
Longtime User
Updated to 2.3.0.0

Toolbar buttons for all menu items
Extra toolbar buttons for:
  • B4A documentation link (link is specified in Options)
  • Forum landing page
  • Android Packages landing page
Any selected node in Classes and methods/Properties/Fields list can be searched (Right-click menu) - opens in Google search window
Properties now specified as ReadWrite or ReadOnly
Properties now have Return Type listed
Classes have Wrapper shown
Classes have Comment shown
Standardised detail output to my upcoming documentation style (eg "Usage" becomes "Syntax")
Treeview details are sorted before being written to Treeview (allows documentation to be sorted properly)
Copy and Copy RTF (for details pane) right-click options
Control of Full or short typename display across whole application is controlled by option
Added option to hide BA Object if it is the first parameter in a method (this is the default value)

Known issues:
Unicode and HTML codes as per previous versions
Re-setting of options required as per previous versions

Link in Post 1.
 
Last edited:

Roger Garstang

Well-Known Member
Licensed User
Longtime User
Love the new Copy and RTF options. Good idea on just loading the root elements in the tree too and just loading as needed. There is still some pretty good flicker though...especially on large trees like Core, Phone, or Dialog. It appears to be redrawing/rebuilding the entire tree for each element added instead of just adding the elements to that child node.

So, on the progress bar, did you use the repeating one to not have to update it with all the delegating and such, or was there no way of know how far along the processing of the XML was? I never did get why Microsoft even added that style as it doesn't do much more than setting the mouse pointer to a wait cursor does. Without actually showing progress it is only slowing things down by needing to draw. Updating progress bars with a status will slow things down too once available. Usually I have a variable storing the current percentage and only update it when changed (Sometimes only on Even Percents too) since each redraw of it will add delay.
 

Informatix

Expert
Licensed User
Longtime User
Love the new Copy and RTF options. Good idea on just loading the root elements in the tree too and just loading as needed. There is still some pretty good flicker though...especially on large trees like Core, Phone, or Dialog. It appears to be redrawing/rebuilding the entire tree for each element added instead of just adding the elements to that child node.
On my slow PC at work, this flickering is going to kill my eyes. ;)
 

Roger Garstang

Well-Known Member
Licensed User
Longtime User
It isn't that I don't like the tool or it is stopping me from using it or anything. The tool is great. I'm just giving feedback. .NET likes to impose a lot of limitations and has issues of its own, so is most likely a big part of the cause. My Trees in Win Mobile draw fine, so it could be a desktop thing too...who knows. Most of my desktop applications I make with PowerBASIC and FireFly. There are a lot of redraw and child clipping flags you have to use to really get things flicker free that .NET may not expose (ex. resize the window and the tree flickers too)...I don't get this in applications I make with PowerBASIC. You gain other things in Visual Studio like Anchors, Min/Max Window Size, Scaling, etc that you have to make yourself in lower level languages though too, so it is a trade-off.
 

Vader

Well-Known Member
Licensed User
Longtime User
Thanks for the additional feedback guys. I have updated the first post with a couple of extra things to try and fix the flickering. I haven't upped the version number so you won't have to re-do the config.

Let me know how that improves things (if at all).


Dave
 

Vader

Well-Known Member
Licensed User
Longtime User
So, on the progress bar, did you use the repeating one to not have to update it with all the delegating and such, or was there no way of know how far along the processing of the XML was? I never did get why Microsoft even added that style as it doesn't do much more than setting the mouse pointer to a wait cursor does. Without actually showing progress it is only slowing things down by needing to draw. Updating progress bars with a status will slow things down too once available. Usually I have a variable storing the current percentage and only update it when changed (Sometimes only on Even Percents too) since each redraw of it will add delay.

Correct.
 

derez

Expert
Licensed User
Longtime User
Good job, Vader. I started to use it and I like it very much :sign0188:

I see that when I try to open a library which is made by converting a b4a class to a library I get an error.
I attach an example of such library.
Thanks.
 

Attachments

  • Message.zip
    1.2 KB · Views: 472
Last edited:

Vader

Well-Known Member
Licensed User
Longtime User
Good job, Vader. I started to use it and I like it very much :sign0188:

I see that when I try to open a library which is made by converting a b4a class to a library I get an error.
I attach an example of such library.
Thanks.

The error you have reported is due to the following:
B4X:
Method _asview has no comment
Method _class_globals has no comment
Method _frame_color has no comment
Method _line_color has no comment
Method _set_button_font_size has no comment

I have made changes so that problems such as this do not cause the tool to crash. This will be uploaded tonight (ie in the next few hours).

Edit: I also see a few other things:
Your Library (ie, not class) has a "DependsOn" node. I do not handle this, and so will have to write that in also.
The names of your Methods have an Attribute called "DesignerName" (yes, Attribute, not value), which I will also have to handle.

Thanks for reporting it.

Edit: Is there a reference for these files that I can review to ensure I support all values and attributes?

Dave
 
Last edited:
Status
Not open for further replies.
Top