Android Question "Ancient" is better? HTML/CSS problem?

boten

Active Member
Licensed User
Longtime User
I have 2 HTML files, both contain identical text (in Hebrew).
The difference is that frnk.htm links to stylesheet p.css, while reg.htm does not.
stylesheet p.css defines FrankRuehl font in file frank.ttf

all 4 files:
frnk.htm
reg.htm
p.css
frank.ttf

are copied to DirInternal.

A button switch a webview display between frnk.htm / reg.htm

Compiling and running on Galaxy S4, android 4.2.2: FrankRuehl font is shown and on button click switch to default font

compiling and running on Galaxy S7, android 7.0: default font is shown both files, FrankRuehl not shown.

Attached is the project, and 2 images, each containing 2 screenshots
 

Attachments

  • hebtest.zip
    38.3 KB · Views: 200
  • s4-screens.jpg
    s4-screens.jpg
    193.3 KB · Views: 214
  • s7-screens.jpg
    s7-screens.jpg
    173.9 KB · Views: 202

Erel

B4X founder
Staff member
Licensed User
Longtime User
Tip:
B4X:
Sub Copy2Int(Fn As String)
   If File.Exists(File.DirInternal,Fn) Then File.Delete(File.DirInternal,Fn)
   File.Copy(File.DirAssets,Fn,File.DirInternal,Fn)
End Sub
1. You don't need to check whether a file exists before you try to delete it. Nothing happen if it doesn't exist.
2. You don't need to delete the target file before you copy. It will be overwritten anyway.

Your code does work on Nexus 5X running Android 8. I don't know whether it is related or not (probably not) however there is an extra slash in the URL.
Better to write it like this:
B4X:
s="file://" & File.Combine(File.DirInternal, "frnk.htm#begin")
 
Upvote 0

boten

Active Member
Licensed User
Longtime User
Tip:

1. You don't need to check whether a file exists before you try to delete it. Nothing happen if it doesn't exist.
2. You don't need to delete the target file before you copy. It will be overwritten anyway.
agree on both. however they do no harm to copying the files


Your code does work on Nexus 5X running Android 8. I don't know whether it is related or not (probably not) however there is an extra slash in the URL.
Better to write it like this:
B4X:
s="file://" & File.Combine(File.DirInternal, "frnk.htm#begin")

Did you see FrankRuehl font on the Nexus5x?

// brings the same result as /// (i'm used to file:/// from windows' browsers)


So still wondering the "glitch" in galaxy S7+android 7.0
 
Upvote 0
Top