Other B4A v13.5 BETA - integrated code bundle and more

Erel

B4X founder
Staff member
Licensed User
Longtime User
I'm happy to release a new BETA version of B4A. The integrated code bundle tool is now available in B4A (and B4J).
Code Bundle is a tool that packs your project together with additional relevant information into a single json file, that can be provided to AI assistants for debugging, learning, refactoring and other tasks.



The bundle is created with a click of a button (Ctrl + R). The bundle includes:

  • Project code + list of public APIs. Keys are sanitized based on heuristic templates.
  • (optional) Logs + compilation output + warnings and errors list. Compilation output is included when the dialog is visible.
  • (optional) Layouts + designer script.
  • (optional) Paths configuration.
  • List of files. Files content is not added.
  • List of libraries with additional information for each library.
  • Manifest editor.
  • Current caret location with the code around it - the AI knows where you are focused on right now.
  • Additional information about the IDE and useful links for the AI to find more information.
How to use:
- Click on Ctrl + R. A json file will be created and copied to the clipboard. Paste into the AI assistant and ask questions.

Other improvements:
  • The Starter service is being deprecated due to restrictions applied by Android, which can lead to crashes. Removing the Starter service no longer affects the behavior of unhandled exceptions.
  • New warning in B4XPages projects when the starter service is included.
  • Application_Error sub can be added to the Main module (when the Starter service is excluded).
  • B4XPages project template updated accordingly.
  • New log filter:


    Error - includes the app logs and system level error logs. Very useful when looking for ANRs, startup errors and other mysterious crashes.
  • Autocomplete in #If lines.
  • List.Sublist - Very fast method that returns a read-only sub-list.
  • Fix for String.ToLower not explicitly setting the locale. Mainly fixes the Turkish I: https://www.b4x.com/android/forum/t...ctly-for-the-turkish-language.163961/#content
  • New #Macro / comment link options: (case insensitive)
    • librariesrefresh - set to True to automatically refresh the libraries after the task runs.
    • codesync - set to True to force the IDE to synchronize the code modules with the files.
    • autosave - set to True to automatically save the project BEFORE running the task. Note that Tools - IDE Options - Auto Save should be enabled for this to have effect.
    • filessync (not new) - set to True to synchronize the Files tab after the task.
    • cleanproject (not new) - set to True to "clean project" after the task
    • %STATE1% - new variable that causes the IDE to create a temporary file with the IDE state based on the new options under Tools - IDE Options. The file path will be passed to the process. This is used by Code Bundle and can be used by other similar tools. Note that the format can be modified in the future.
    • NoTimeout - set to True to disable the default process timeout (currently not available in B4J).
    • ide://KillProcesses - new option to kill all the currently running processes. Useful when running non-ui processes with no timeout (currently not available in B4J).

      Note that starting a B4J app as an external tool is as simple as:
      B4X:
      ide://run?File=<path to jar>\App.jar&NoTimeout=True
  • B4X Map collection can now wrap Java Maps.
  • Other bug fixes and minor improvements.
Download link: https://www.b4x.com/android/files/beta.exe
 

ema01

Active Member
Licensed User
Longtime User
The Starter service is being deprecated due to restrictions applied by Android, which can lead to crashes. Removing the Starter service no longer affects the behavior of unhandled exceptions.
Where should i put then objects that need to live *forever* in a non-B4XPages project?
For example: Localizator
 
Upvote 0

JohnC

Expert
Licensed User
Longtime User
I wanted to revisit a suggestion I made earlier regarding CodeBundle and AI export support:


First, I really like the new integration of CodeBundle directly into the B4A IDE. I think this is a very smart addition and can become extremely useful for AI-assisted development, debugging, and project analysis.

However, I still have a few concerns and suggestions:

1. I would like the ability to explicitly exclude additional code/data from the generated JSON — not just API keys. There are many situations where developers may want to hide proprietary logic, internal comments, credentials, customer-specific code, licensing logic, URLs, SQL, or other sensitive sections from AI analysis.

2. While the current template filtering for API keys is helpful, I personally would not feel fully comfortable relying solely on pattern/template matching to guarantee sensitive code is removed correctly. A missed match could unintentionally expose code or credentials to an external AI service.

Because of that, I still think an explicit compiler directive or exclusion mechanism would be safer and more flexible. Something like:

#If Not(CodeBundle)
' Sensitive code here
#End If

or any equivalent exclusion feature that guarantees specific sections are never exported into the JSON bundle.

I also think this could help with another important issue: AI context size limits. Some projects may simply be too large for an AI to analyze effectively in a single request. An exclusion mechanism could allow developers to intentionally omit large sections, helper modules, generated code, or even entire modules that are not relevant to the current AI discussion, keeping the generated JSON smaller and more focused.

Additionally, I think the compiler directive name itself ("CodeBundle") should ideally be a reserved/built-in conditional symbol automatically enabled whenever the CodeBundle feature is used, regardless of the current build configuration.

The reason is safety and reliability. I would not want to depend on manually switching to a special build configuration that defines a custom conditional symbol before generating the JSON. It would be very easy to accidentally run CodeBundle using the wrong build configuration and unintentionally expose code that was supposed to be excluded.

If "CodeBundle" were automatically defined internally by the IDE/compiler whenever the CodeBundle process runs, then the exclusions would always work correctly and automatically with no extra steps required from the developer.

Additional advantages of an explicit CodeBundle exclusion/compiler-directive approach:

* Helps protect sensitive information, proprietary business logic, credentials, licensing systems, and intellectual property from accidental AI exposure.
* Reduces generated JSON size, helping with AI token/context limits, faster processing, and lower AI costs.
* Improves AI analysis quality by excluding unrelated modules, helper code, generated code, and other unnecessary project context.
* Makes enterprise/corporate usage more practical by supporting stricter security, compliance, and auditing requirements.

I think features like this would greatly increase both developer confidence and practical usability of CodeBundle with AI tools.
 
Last edited:
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Where should i put then objects that need to live *forever* in a non-B4XPages project?
For example: Localizator
The new warning is limited to B4XPages projects for this reason. In non-B4XPages projects the starter service serves a function that is not simple to replace. This is not the case with B4XPages.
The issues with the starter service seems to be limited to debug sessions so I wouldn't classify them as critical at this point.

Overall the direction of Android in related to services is quite clear. They become more restricted and problematic with each update of Android.
 
Upvote 0

ema01

Active Member
Licensed User
Longtime User
The issues with the starter service seems to be limited to debug sessions so I wouldn't classify them as critical at this point.
are you referring to the issuse that the app doesn't start the first debug session of the day?

Overall the direction of Android in related to services is quite clear. They become more restricted and problematic with each update of Android
Yep, too bad we have special use cases that require foreground services running forever (we keep getting the clearance, for now...)
 
Upvote 0

Alessandro71

Well-Known Member
Licensed User
Longtime User
deprecation of the Starter Service can have quite an impact on projects that started long time ago.
if the issue is really limited to debug sessions and not affecting the release, it can be manageable.
a whole different matter would be if this is an anticipation of some (future?) Android release restriction
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
are you referring to the issuse that the app doesn't start the first debug session of the day?
Probably. It can happen when the screen is turned off while you run the app. A more serious issue is with ANR during debugging that is caused by the starter service.

Let me clarify that the starter service behaves exactly the same in this new version. The changes are:
1. A warning in B4XPages project, where the starter service is less needed any way.
2. Better error handling when the starter service is excluded.
 
Upvote 0

Jmu5667

Well-Known Member
Licensed User
Longtime User
So, for non B4XPages projects, we can still use the starter server ?
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
So, for non B4XPages projects, we can still use the starter server ?
You can use the starter service in all types of projects. Nothing has changed regarding its behavior.

We are seeing issues related to the starter service with latest versions of Android. Currently only during debug mode.
My recommendation is to stop using the starter service with B4XPages, where it isn't really needed anyway.
 
Last edited:
Upvote 0

Jmu5667

Well-Known Member
Licensed User
Longtime User
Thanks for being very clear on this !
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…