Android stupidity?
-
Finished creating an html document with pics and styling. Wanted to read it on my phone and see if everything looks ok there. The only way to do so seems to be to install an http server on the phone... Can't just dump everything into a subdirectory and click on the html file because android restrictions keep browsers from loading the css and other files. Is the potential risk from loading local javascript files so much greater than loading javascript files off the web that this is needed? Before finding the local server option, I read items saying that if you dumped things into the browser's 'Download' folder, it could access everything from there. But Android restrictions keep you from viewing those download folders through the file viewer (at least on my Samsung device), saying that 'Android->data' files cannot be accessed due to android restrictions, but can be shown on a computer... Compound this with the fact that I had to use the Google Play store for the first time in ages, and it is becoming a complete crap-fest of worthlessness.... < / vent>
Our Forgotten Astronomy | Object Oriented Programming with C++ | Wordle solver
-
Finished creating an html document with pics and styling. Wanted to read it on my phone and see if everything looks ok there. The only way to do so seems to be to install an http server on the phone... Can't just dump everything into a subdirectory and click on the html file because android restrictions keep browsers from loading the css and other files. Is the potential risk from loading local javascript files so much greater than loading javascript files off the web that this is needed? Before finding the local server option, I read items saying that if you dumped things into the browser's 'Download' folder, it could access everything from there. But Android restrictions keep you from viewing those download folders through the file viewer (at least on my Samsung device), saying that 'Android->data' files cannot be accessed due to android restrictions, but can be shown on a computer... Compound this with the fact that I had to use the Google Play store for the first time in ages, and it is becoming a complete crap-fest of worthlessness.... < / vent>
Our Forgotten Astronomy | Object Oriented Programming with C++ | Wordle solver
David O'Neil wrote:
Is the potential risk from loading local javascript files so much greater than loading javascript files off the web that this is needed?
The only (?) way I could see this *maybe* being justifiable might be the fact that your connection to a web server is probably going to be done over https, which might buy you some assurance that files served can be trusted[*]. You might not have this assurance when loading files locally (who knows where *they* came from, and will vouch for them being safe?) [*] And yes, I realize that a server can be compromised and then *none* of its files can be trusted. But at least you do get that minimal level of trust...
-
David O'Neil wrote:
Is the potential risk from loading local javascript files so much greater than loading javascript files off the web that this is needed?
The only (?) way I could see this *maybe* being justifiable might be the fact that your connection to a web server is probably going to be done over https, which might buy you some assurance that files served can be trusted[*]. You might not have this assurance when loading files locally (who knows where *they* came from, and will vouch for them being safe?) [*] And yes, I realize that a server can be compromised and then *none* of its files can be trusted. But at least you do get that minimal level of trust...
I'm with you, especially on the maybe. I'd really like to see the research that shows this scenario being a real-world problem. Some idiot plugging into a malware USB dongle? That I can see, but something actually in internal memory??? That makes no sense... Unless 'quick share' and other things are an attack vector... Still, what is the research?
Our Forgotten Astronomy | Object Oriented Programming with C++ | Wordle solver
-
Finished creating an html document with pics and styling. Wanted to read it on my phone and see if everything looks ok there. The only way to do so seems to be to install an http server on the phone... Can't just dump everything into a subdirectory and click on the html file because android restrictions keep browsers from loading the css and other files. Is the potential risk from loading local javascript files so much greater than loading javascript files off the web that this is needed? Before finding the local server option, I read items saying that if you dumped things into the browser's 'Download' folder, it could access everything from there. But Android restrictions keep you from viewing those download folders through the file viewer (at least on my Samsung device), saying that 'Android->data' files cannot be accessed due to android restrictions, but can be shown on a computer... Compound this with the fact that I had to use the Google Play store for the first time in ages, and it is becoming a complete crap-fest of worthlessness.... < / vent>
Our Forgotten Astronomy | Object Oriented Programming with C++ | Wordle solver
Would it be a viable alternative to host that html page onto GitHub (using a free account) and access that GitHub page from the mobile browser. (Depends on the privacy of that html content, pictures)
-
Would it be a viable alternative to host that html page onto GitHub (using a free account) and access that GitHub page from the mobile browser. (Depends on the privacy of that html content, pictures)
Probably possible, but the fact that android requires such workarounds seems unbelievably stupid.
Our Forgotten Astronomy | Object Oriented Programming with C++ | Wordle solver
-
Finished creating an html document with pics and styling. Wanted to read it on my phone and see if everything looks ok there. The only way to do so seems to be to install an http server on the phone... Can't just dump everything into a subdirectory and click on the html file because android restrictions keep browsers from loading the css and other files. Is the potential risk from loading local javascript files so much greater than loading javascript files off the web that this is needed? Before finding the local server option, I read items saying that if you dumped things into the browser's 'Download' folder, it could access everything from there. But Android restrictions keep you from viewing those download folders through the file viewer (at least on my Samsung device), saying that 'Android->data' files cannot be accessed due to android restrictions, but can be shown on a computer... Compound this with the fact that I had to use the Google Play store for the first time in ages, and it is becoming a complete crap-fest of worthlessness.... < / vent>
Our Forgotten Astronomy | Object Oriented Programming with C++ | Wordle solver
To test HTML in my local network I just set up a tiny server in Python. You can then access it from your terminal/mobile/PC. The server script can be found all over the Internet. The code is:
import os
from http.server import HTTPServer, CGIHTTPRequestHandler
os.chdir('D:\serverfolder')
server_object = HTTPServer(server_address=('',8080),RequestHandlerClass=CGIHTTPRequestHandler)
server_object.serve_forever()Then put your HTML in the folder of your choice mentioned on the os.chdir line, and connect from the browser to your IP address, e.g. http://192.168.1.72:8080/webpagename.html The nice thing is that it really does test the HTML and file links to local OS folders, etc. doesn't get in the way. http only so insecure and only to be used locally but, adequate for testing and accessible from anywhere on your local network.
-
To test HTML in my local network I just set up a tiny server in Python. You can then access it from your terminal/mobile/PC. The server script can be found all over the Internet. The code is:
import os
from http.server import HTTPServer, CGIHTTPRequestHandler
os.chdir('D:\serverfolder')
server_object = HTTPServer(server_address=('',8080),RequestHandlerClass=CGIHTTPRequestHandler)
server_object.serve_forever()Then put your HTML in the folder of your choice mentioned on the os.chdir line, and connect from the browser to your IP address, e.g. http://192.168.1.72:8080/webpagename.html The nice thing is that it really does test the HTML and file links to local OS folders, etc. doesn't get in the way. http only so insecure and only to be used locally but, adequate for testing and accessible from anywhere on your local network.
Thanks for the reply. I've already solved it with a server on the phone, but maybe someone comes across this some day and finds it helpful! I must also admit that I haven't played with Python, but I'll keep it in mind in the future.
Our Forgotten Astronomy | Object Oriented Programming with C++ | Wordle solver