Wish Have access to ALL the source code

antonomase

Active Member
Licensed User
Longtime User
I wish to have access to all my source code including the .bal files which are stored in a binary proprietary format.
At least, can you add the possibilty to export/import the .bal files in a human readable format ?
 

HotShoe

Well-Known Member
Licensed User
Longtime User
After compiling your app, go to your apps directory and look in

Objects\src\your\package\name\

You'll find all the java source including layout files.

--- Jem
 

antonomase

Active Member
Licensed User
Longtime User
Hi,

I just have the .java files in src
And the directory res\layout is empty

Do you set an option to generate the layout files ?
 

antonomase

Active Member
Licensed User
Longtime User
Playing with words
Having a binary proprietary and undocumented format is not "having access" to the file.

By example, i cannot comment the bal files, i cannot integrate them into versionning, ...
 

thedesolatesoul

Expert
Licensed User
Longtime User
You do have access to the file.
Think of it, you need an image viewer to view a bitmap file, and text viewer to view a text file, and so on. You need the B4A designer, to view the bal file.

You can integrate a bal file into versioning as a binary file. You cannot diff them, but you will have comments on the commit to tell you what changes are in each version.
 

antonomase

Active Member
Licensed User
Longtime User
Yes, I need a text viewer to view my text file. I can use any text viewer to view all my text files.
Yes, I need an image viewer to view my png, gif or jpeg files. I can use any image viewer to view all my image files.

What is a bal file ? a file which contains Views properties (type of the view, top, left, width, height, color, ...) and source code for scaling the views. All of that can be described as comprehensive text.

The reason that this is a binary file is a technical reason.
If you want to keep the binary format, can you imagine an export into text format : xml for the views properties and source code for designer script ?
 

thedesolatesoul

Expert
Licensed User
Longtime User
I dont really agree with your example of 'any' viewer. Do you want to load bal files in another viewer? Which viewer do you want to use?
 

antonomase

Active Member
Licensed User
Longtime User
I dont really agree with your example of 'any' viewer. Do you want to load bal files in another viewer? Which viewer do you want to use?
By example, I want Doxygen can read my .bal files to generate javadoc documentation.

Or I want to edit one .bal file to remove the characters "help_" of all the views that are named lbl_help_xxx ou radio_help_yyy with just a find/replace.

Or I want to publish an application as an open source application.

I can understand that the binary format is used for technical reasons or to protect some commercial "secrets". But with this binary format, i'm not proprietary of my own application.
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
or to protect some commercial "secrets"
Which secrets? It just stores the layout values in a compact and efficient way so it can be sent and processed quickly by the connected device and at runtime.

I want Doxygen can read my .bal files to generate javadoc documentation
How can it be possible? The layout file is not Java source code.

If you want to build the layout in code then don't use the visual designer.
 

thedesolatesoul

Expert
Licensed User
Longtime User
I am not disagreeing with you on the fact that you want a 'text' based layout (which is easier to manipulate which is why I write all my layouts in code).
I am disagreeing on the fact that a bal files is 'closed', just because it is not rendered in text format.

As Erel said you cannot generate javadocs from layout files (even in Eclipse they are xml).
Editing bal files, is probably a nice thing to have in text but I would not trade it off for layout inflation speed which is a pretty expensive operation.
Publish application as open source: I think this is where my definition of source differs from you. As long as there is an available viewer and editor, I think the bal file is open source (not the bal format, but only the bal file).
 

antonomase

Active Member
Licensed User
Longtime User
Which secrets? It just stores the layout values in a compact and efficient way so it can be sent and processed quickly by the connected device and at runtime.

I don't know which secret. But it seems to be very difficult to have access to the source file of what I have writen in Basic4Android.

The compact way to store datas is an argument which is strange when computers have hard drives with terabytes.
I can't imagine it would be very long to transform a text file into binary when compiling a project.

How can it be possible? The layout file is not Java source code.
With Doxygen, you can documentate files which are not written in Java : SQL files, XML files, PHP files, C files, ... You can have the documentation of all parts of your project in a coherent way.

If you want to build the layout in code then don't use the visual designer.
I don't want to write the layout code.
I want to use the possibilities of the compiler which I bought.
But I find damage not to be able to have access to all my files in an understandable and easily modifiable shape.

I am going to stop the discussion here because the subject seems to be too polemical.
 

nikolaus

Member
Licensed User
Longtime User
I don't want to write the layout code.
I want to use the possibilities of the compiler which I bought.

Please be more kind, Erel is doing a very good job. You can use the possibilities of what you bought after a serious free trial period. There is nowhere a promise for user readable and manually editable layout templates.

Despite that I am sharing your wish. My suggestion was to implement a 'Generate Activity Layout Code' in Designer (http://www.b4x.com/android/forum/threads/designer-generate-activity-code.39364/). That would overcome perfomance issues during compilation and offer a simple base for manual layout editing in code.

But: This is a whish, and I am asking kindly if Erel could do that and will respect his commercial and technical decision. If there is not enough demand for a feature like that or if it is too difficult, there is no reason for him to implement it. And twice no reason to tell him, I want it since I purchased his product. I already got what I bought, a great tool, good support and a friendly and helpful community.

BTW you mentioned you might want to publish an open source application.

As long as you just want to give sources to your customer he or she will simply need to purchase a copy of B4A and can read, use, modify your code in any way. The same is valid with the public. Since B4A basic code is proprietary where is the problem and who could use it without B4A? The generated Java code references various libraries from anywhersoftware, so a human readable design template wouldn't provide fully open source anyway.

If you are thinking of Open Source Software in the common (erroneous) sense of Free Software - which is named Free Software and has to be Open Source but a lot more: There is no way to make Free Software with B4A. Free Software must exclusively use compilers, libraries etc. that are Free Software themselves.

Do not blame Erel for that. He is offering a commercial and proprietary rapid development tool. A real great and reasonably priced one just to mention. If you want to do Free Software then go the stoney way, get free development tools, learn to use them and spend a lot more time on your projects than with B4A.

Regards
Nikolaus
 
Last edited:
Cookies are required to use this site. You must accept them to continue using the site. Learn more…