Android Question Inquiry about JsonLayouts

AlfaizDev

Well-Known Member
Licensed User
Longtime User
https://www.b4x.com/android/forum/t...onize-json-and-binary-layouts.167398/#content

Hello,
I tried the tool and it created JSO files.
But can I use them to compare the JSON files generated by B4A and B4I to see the differences in the layout within the same project on both platforms? At least this would prevent errors, since editing in the designer isn't done in the same place for both platforms.

In short: Is there a tool where I can upload JSON files for both platforms and it tells me the difference, i.e., if a label is added in B4A but not in B4I?
 
Solution
The code bundle tool packs all the layouts into a single json file. It can be used for this purpose:

1778756968555.png


The output:


Main layout differences:


1.bjl / 1.bal


  • B4J variant: 600x600; B4A variant: 320x480.
  • B4A has AutoScaleAll; B4J doesn’t.
  • Root is different: B4J Pane/Main; B4A Activity.
  • CLV:
    • B4J divider color: black 0xFF000000.
    • B4A divider color: white 0xFFFFFFFF.
    • B4J background: AliceBlue 0xFFF0F8FF.
    • B4A background: transparent 0x00FFFFFF.
  • AnotherProgressBar1:
    • B4J width: 30.
    • B4A width: 10.
    • Everything else important looks the same.

Item.bjl / item.bal


  • B4J variant: 600x600; B4A variant: 320x480.
  • B4A has AutoScaleAll; B4J doesn’t.
  • Root...

aeric

Expert
Licensed User
Longtime User
Paste the json files for both platform to AI and let AI find the difference for you.
 
Upvote 0

AlfaizDev

Well-Known Member
Licensed User
Longtime User
Paste the json files for both platform to AI and let AI find the difference for you.
Is there no other option?

I tried it, but it's tiring because of the numerous layouts. And if the AI corrects it, will that affect the original files, whether bal or bai?
 
Upvote 0

aeric

Expert
Licensed User
Longtime User
I think you get the text information of what are the differences. You can then manually check and fix them. In case the AI corrupted the layout files.
Always remember to make backups and do it in sandbox.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
The code bundle tool packs all the layouts into a single json file. It can be used for this purpose:

1778756968555.png


The output:


Main layout differences:


1.bjl / 1.bal


  • B4J variant: 600x600; B4A variant: 320x480.
  • B4A has AutoScaleAll; B4J doesn’t.
  • Root is different: B4J Pane/Main; B4A Activity.
  • CLV:
    • B4J divider color: black 0xFF000000.
    • B4A divider color: white 0xFFFFFFFF.
    • B4J background: AliceBlue 0xFFF0F8FF.
    • B4A background: transparent 0x00FFFFFF.
  • AnotherProgressBar1:
    • B4J width: 30.
    • B4A width: 10.
    • Everything else important looks the same.

Item.bjl / item.bal


  • B4J variant: 600x600; B4A variant: 320x480.
  • B4A has AutoScaleAll; B4J doesn’t.
  • Root is different: B4J Pane/Main; B4A Activity.
  • Label1:
    • B4J font size: 18.
    • B4A font size: 15.
  • ImageView1 and Label1 anchors / layout positions are effectively the same.

So the main real layout mismatches are: B4A AutoScaleAll, CLV divider/background, progress bar width, and Label1 font size.

The integrated tool isn't yet available for B4i, but it will be soon.
 
Upvote 0
Solution
Top