0

I have a very specific question for you today.

I am a bioenergeticist and with my basic skills I developped a tool that helps me create files for my patients.

I use it with a Lenovo tablet TB-X306F, originally Android 10 now 11. My tool is a short HTML file with a CSS and 3 pictures. There is a canvas that lets me draw arrows and circles around human body parts (background pic). There are also a few textareas that lets me type the client's name, his symptoms and so on. When I'm done I print to a PDF file and that gives me a nice sheet for each client.

In my office there is no internet access, so the html file, the css and the pictures need to be stored locally.

Until now I used Opera and the 'file:///storage/emulated/0/Download/yyyyy.html' trick and it did great. Until android 11 came. I guess the restrictions must have tightened because since last week, right after that update and still with Opera's authorizations maxed out, I get the error 'ERR_ACCESS_DENIED'.

I can't seem to find a way around it that completely works.

  • I tried Chrome, Firefox, Opera, same error.

  • I tried to store the files in a SD Card, same error.

  • I tried to store the html file as an Offline page in Chrome and Opera, it works a few times then either the page disappears or the canvas won't be showed anymore.

  • I tried installing Simplehttpserver app, but as I'm moving my tablet home to answer emails, then in the office where there is no internet, the server randomly changes ip, turns off then on...

  • I tried uploading the files to a storage website, then downloaded the files from Chrome. This time it opened the HTML file but the pictures don't appear.

  • The Webview that I tried didn't have the option to print, and this is mandatory for me.

  • Rolling back to android 10 would be a short term solution, since I will have to change the tablet someday anyway.

I'm getting out of ideas. Any help would be greatly appreciated.

Thanks, Olivier

1 Answer 1

-2

My suggestion is to add the following line of code to your AndroidManifest.xml:

android:usesCleartextTraffic="true"

After that reinstall the app. Now everything should work fine. Cheers

6
  • I might be too noobish into Android, but is it possible to have an AndroidManifest.xml file for a HTML webpage? Because it's all my tool is, one HTML, one CSS and a few pics.
    – Plantula
    Jul 7, 2021 at 16:08
  • No the question is totaly fine! Do you use Android Studio to put everything together as an App? If yes, then I will post a picture that shows you where to class is located. Jul 7, 2021 at 17:18
  • I had never even heard of Android Studio until today! I'm downloading it right now... Does it accept HTML code? That's about the only language I know.
    – Plantula
    Jul 8, 2021 at 19:33
  • Yes you can. I found a good tutorial for you to implement your HTML Code into Android Studio. Your project is simple and optimized for this task. Enjoy to learn my friend: abhiandroid.com/ui/html Jul 8, 2021 at 21:25
  • Thanks very much! Your link is very helpful and I was able to create an app thanks to this. One problem is, the canvas does not work on the HTML used in Android studio? The canvas borders appear, but I can't draw with the javascript script I used. Guess I'll need to try and learn creating a canvas directly in android studio.
    – Plantula
    Jul 15, 2021 at 15:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.