B4J Question HTML+CSS+Javascript Works in Browser But Not in WebView

sfsameer

Well-Known Member
Licensed User
Longtime User
If you run the project, the editor does not appear in the WebView.
If you view the HTML file in your browser, it works fine.
Any ideas to get it working in the WebView?

Get the project ZIP file here. (1.5MB)
Hello my dear friend :)

i have downloaded your project and hit run, it's working fine for me

1615238593364.png
 
Upvote 0

cklester

Well-Known Member
Licensed User
@sfsameer What version of B4J are you using? I'm using 8.90.

Is there anything on your system that you might have that I don't? Updated modules?
 
Upvote 0

sfsameer

Well-Known Member
Licensed User
Longtime User
@sfsameer What version of B4J are you using? I'm using 8.90.

Is there anything on your system that you might have that I don't? Updated modules?
Me too, ver 8.90
And there is nothing special in my windows so am not really sure why it's not working with you.
Could you do the following :
Click on release and copy the jar file to another pc and see if it works.
And if it did then I think you need to do a special configuration in your pc which I will look into it tomorrow and let you know :)
 
Upvote 0

cklester

Well-Known Member
Licensed User
Click on release and copy the jar file to another pc and see if it works.

Tried on another PC. Didn't work. However, they are probably both configured the same.

What version of Java are you using? Am using openjdk.

How can I tell what version of Java I'm using?

The path to my Java executable is C:\java\jdk-11.0.1\bin\javac.exe, so that means 11, yeah? 🤔

Thanks, @roerGarcia , for that confirmation! That's what I'm getting, and good enough English! 😁
 
Upvote 0

alwaysbusy

Expert
Licensed User
Longtime User
Unfortunately, it works on my PC too. You can try to add the conzole (yes with a z) library to your html. I use this lib a lot when debugging on mobile browsers. It sends all the logs to a visible window on top.

Unzip and copy both files to your '/Shared Files' folder. It should show you something like this and you may see some other errors that can help you identify the problem:

1615279367192.png


Alwaysbusy
 

Attachments

  • conzole.zip
    10.6 KB · Views: 230
Upvote 0

Daestrum

Expert
Licensed User
Longtime User
Working here too in java 14
1615305249686.png
 
Upvote 0

cklester

Well-Known Member
Licensed User
You can try to add the conzole (yes with a z) library to your html...

...Unzip and copy both files to your '/Shared Files' folder. It should show you something like this and you may see some other errors that can help you identify the problem:

Hey, AB, thanks for that! Upon my first attempt, after placing those files in the Shared Files folder, it still did not work for me.

However, yesterday, I remembered having to drag a file to the "Files Manager" tab in the IDE before it would work. I tried that with conzole.js, and now the Conzole window appears! However, nothing else does. It's a blank view. So, I think the app is not seeing everything else in the B4J/Files folder... namely, the other three folders.

The programming gods hate me.

If I get an error in the IDE log that says, "Asset file not found: editor.html," what should I do about that? That file is in the Shared Files folder, and does get placed in the B4J/Files folder upon app start-up, so I'm not sure what's going wrong here.
 
Upvote 0

cklester

Well-Known Member
Licensed User
Zipped all sub-folders in Files folder to a file (html_files.zip).
Have added Zip extraction method to the project.

I looked for and found the ArchiverPlusZip module in Informatix's ProBundle, but not sure how to utilize it.

But then I noticed your reference to the SD ZIP library. Does the SD library have the same class name (ArchiverPlusZip) as the other one?

Which one do I need, and how do I add it to the project?
 
Upvote 0

IndieDev

Active Member
Licensed User
I looked for and found the ArchiverPlusZip module in Informatix's ProBundle, but not sure how to utilize it.

But then I noticed your reference to the SD ZIP library. Does the SD library have the same class name (ArchiverPlusZip) as the other one?

Which one do I need, and how do I add it to the project?

Hi cklester,

The SD Zip library reference was an old version that I was trying out. Please ignore this reference.
Sorry about that.

My attached project uses ArchiverPlusZip.
Screenshot (38).png



Extract these 2 files (from Informatix's ProBundle ) to your Additional Library folder.
Screenshot (39).png


Set the path of B4J to the Additional Library folder. (Tools / Configure Paths)
My paths are set as below:
Screenshot (40).png


Rest you should be able to surmise from the given code.

Regards.
 
Upvote 0

cklester

Well-Known Member
Licensed User
@IndieDev Thank you! Your fix works for me.

So, the question becomes, why is it that I and @roerGarcia experienced a blank page while others did not?

Why does your solution work? Is it because of the location of the HTML/CSS/JS files (in the user's appdata folder instead of the app's folder)? Is this a work-around for some issue, or is it just the way it is?

@Erel , can you provide some insights?

At this point, even some of the graphics are not showing up properly. See @alwaysbusy 's screenshot above. You can see some of the button images can't be displayed, but it should look like this:

1615924503528.png
 
Upvote 0
Top