Android Question Advice on creating a help file

RMarra

Member
Licensed User
Longtime User
I'm thinking of typing up a help file in MSWord and saving it as HTML in DirAssets and displaying in my app with a WebView. I'm worried that pictures won't show and that the HTML created by word will be too big.

I'm interested to hear if anyone has done this before. I'd also be interested in hearing your advice on a better way to do a user manual/help file.
 

DonManfred

Expert
Licensed User
Longtime User
Msword is the LAST software i would try to build a html file.

Use notepad
 
Upvote 0

RMarra

Member
Licensed User
Longtime User
Writing it all in html myself is a little over my head. I'll go online and see if I can find a wysiwyg html editor with less overhead than Word. But what about embedded pictures? Can I just reference pictures in DirAssets?
 
Upvote 0

RMarra

Member
Licensed User
Longtime User
The forum search is working. Try to use it one time.

What is your problem? This forum stretches back years and it's very difficult to find good information through all the outdated stuff. I always search first before asking. I tried the code i found by searching and it was from 2012 and did not work.

No one else gives me a hard time but you. Do us both a favor and just ignore my posts from now on.
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
My problem is that some people thinks they do not need to use the forumsearch.
It looks for me that it is easier to post just another question without trying to search for an answer first.

https://www.b4x.com/android/forum/bookmarks/?type=post&id=497506

another good example

B4X:
WebView1.LoadHtml($"<img src="${xui.FileUri(Dir, FileName)}"/>"$)
 
Last edited:
Upvote 0

RMarra

Member
Licensed User
Longtime User
You jumped on me about the pictures when what I was really asking was "is there a better way". I did not find anything that talked about "best practices" in my search. I considered creating a PDF and displaying it on screen, and then the HTML idea came to me. I used Word because that's what I had available. I was hoping there was a way to make the HTML default to the assets directory since I cannot control the HTML that Word builds. I mentioned the pictures because I already tried code I found in the search and it did not work.

I do try to work things out before I ask the community. I try to take apart and rework the examples I find to fit my needs. To find those examples, I have to read dozens of post that do not address my particular problem. This "forum style" of documentation is flawed in that you need to sift through pages and pages of people posting what doesn't work in order to hopefully find the solution. I've lost track of how many times I would find a post that sounds like it will help me and it has a note saying "this is the old way, don't do this" and the link takes you to a different subject all together. If Erel wants to hear my opinions and suggestions on improving the documentation, I would be glad to politely discuss it.

I don't know what it is about me that triggers your hostility. If you don't want to help me, then just don't. What benefit is there in fueling my frustration?

Having said all that... If anyone other than Don wants to offer me suggestions, I welcome them.
 
Upvote 0

Jeffrey Cameron

Well-Known Member
Licensed User
Longtime User
To hopefully clarify Don's example for you: Yes, put both your HTML and image files in your project's files and use the example method Don indicated. As long as your HTML IMG tags in your document reference only the full file name, e.g.
B4X:
<img src="img_help_01.png" alt="Help screen 01" />
the HTML page will display properly (when in Release mode, I've had issues having the images display in debug mode).

For my projects I have created a WebHelpView class that encapsulates everything by passing the main HTML page to display, and the activity. The class adds a full-screen panel with a WebView and heading label with a close button. The class loads the requested page then displays and brings the panel to the top, when the user clicks the "X" to close the help the class removes the panel from the activity.
 
Upvote 0

Sagenut

Expert
Licensed User
Longtime User
@RMarra
Do not take it as a personal attack.
Search function can give you the best or worst results with just 1 word more or 1 less.
From time to time you just need to catch the Magic Word with some tries.
Everyone of us got some answer that was looking not so nice, but when you will be more experienced you will look at these answers with different eyes.
Some users have answered the same question too many times, for someone else it's the first time to be helpful.
You will always find someone giving you the solution or the right hint.
I wish You a good stay in the forum. ;)
Don't give up.
 
Upvote 0

RMarra

Member
Licensed User
Longtime User
I installed BlueGriffon HTML editor and used it to build a test HTML in the assets directory. I placed a jpg in the assets and placed it onto the HTML and BlueGriffon generated the reference with "file:///" in the front, and that didn't work. So I edited the html and made it the way Jeffrey suggested:

<img src="image003.jpg" alt="boat">

but that didn't work either (I just got the alternate text). Then I tried Erel's WebViewAssetFile routine from

https://www.b4x.com/android/forum/threads/using-webview-files-in-the-assets-directory.69996/

And it now works, but only in release mode (that's what WebViewAssetFile was supposed to fix) but I'm ok with that. Now I'm going to work on a activity like Jeffrey's to make it look nice.

Thank you everyone.
 
Upvote 0

aeric

Expert
Licensed User
Longtime User
I more agree to Don Manfred. The search engine is working fine. We just need to find the best option since there are many ways of doing one thing. We need to experiment one by one the code contributed by the members here. It may take a bit of time. If one code sample doesn't work then just try the second one and so on. Not only in this forum, a developer should work this way, even when we use Google search, we found some "solutions" in stack overflow, not all the time, the first one come on top of the search results would work. As a developer, we need to be patient.
If after some attempts, we still couldn't find a working code snippets, post our code. We might make silly mistake which we might over look.
 
Upvote 0

aeric

Expert
Licensed User
Longtime User
The benefits of using Webview is user can zoom-in and zoom-out the text and allow a html button to be clicked. I normally hardcoded the html as a string
and use LoadHtml to view the article.

B4X:
webviewArticle.LoadHtml(strHtml)
 
Upvote 0
Top