 Hello and welcome, trying something new here, little podcast, where I'm just gonna talk about a topic. Today's topic, well, it's gonna be websites as applications, okay? I love HTML, I love JavaScript. One of the things I love about one, that it's plain text. Anytime you can get plain text, in my opinion, it's better because it's easy modifiable, you can see what's going on. Great thing about HTML, JavaScript, CSS, even though a lot of people will complain about it, almost the majority of applications in the world are written in these languages. HTML is not a programming language, it's a markup language, but they're languages. And when I say most applications, every web page has some sort of JavaScript in it, and obviously created with HTML and CSS. So it's everywhere, it's easy to use. Some people will complain that it's slow, but for most applications, that's not an issue. And as I always say, it's more important to write good code than worry about the language you're writing it in. You could write horrible, horrible C or C++ code, and it will run horribly, and you can write really good JavaScript that runs great, even on slower devices. Obviously, there are gonna be situations where you want the most speed out of what you're doing if you're doing a lot of processing. But for regular applications, you don't need a lot of speed, right? So, and when I say that, most applications, the things that you do daily, especially work applications, are just forms. I mean, you think about even like something like Word or Excel or spreadsheets of some sort, it's just text and text fields and text inputs and modifying that text. You go to Google, you type something into the search bar, that's a form, that's just text. You go to YouTube or pretty much any other site, you're interacting with forms. You go to work, enter stuff into form, data entry, it might be the boring stuff, but this is most of what applications are, and especially in the business world. So you don't need a whole lot of speed, and not saying that speed isn't important, you should always write your code as best and as fast as possible, but there's other things that sometimes are important, like how quick does it take to develop, and when it comes to HTML and JavaScript is compatibility. HTML, JavaScript, CSS, regardless of what system you're on, you're on a modern system, you're gonna have a web browser. You already have all the tools built in, and if you have a modern web browser, you can do some amazing things. You can do 3D gains, and again, when it comes to something like that, you might see a little lag if you're processing a lot of physics, but as far as rendering out using HTML5, it's using WebGL, which is gonna render out just like any other locally run application, because once it's pulled down to your browser, it is local, right? It's just the transfer time, and when you buy a game or you install a game, you're pulling all that stuff down from the internet already, so there's no difference once it's loaded. The problem I've faced in the past when I was creating HTML games, and really I use Godot for pretty much all my game development now, back when I was using Phaser or 3JS, the slowdowns were processing physics, right? If I had a lot of physics, a lot of bodies colliding, checking collisions, that takes up a lot of processing. Doing that with JavaScript could cause some lag, although I'm not the best at programming, and someone who knows a little bit more about those topics than me probably could have written the code better. That being said, I recently was looking at an application that was way too large for what it did, and one of the issues was they were using all these libraries for all these different architectures, and the thing is, it didn't need to be, it was just displaying images and text from a website and it had a few forms, all from a webpage, but it wasn't using HTML. It was, well, some of it was HTML, but a lot of it was just grabbing JSON information and then displaying it within the app, and that particular app coincided with a website that had pretty much all that same information, so they rewrote a whole nother in from an interface when you already had the webpage, which worked fine. So why did they do this? Why, and it ended up being so large because they had all these libraries, which in the video I showed that I created an app that basically I took that website and packaged it as an APK for an Android device, and it went from, in the video, their package was 70 megabytes. Later on, I found that when you actually get the application from the app store, I think it's only 20 megabytes, and because when you upload it to Google Play, they strip it out, and so when they'll split it up for different architectures, so if you're running an ARM-based processor, it will download the ARM64 for you. If you're running ARM32, it will download an ARM32 processor package and ignore the other files, where when I pull it down, it was one APK that was good for all platforms, but it was still, when it broke down to different architectures, was still over 20 megabytes, where the package I made was just under 200 kilobytes, I think, or around 200 kilobytes, because basically I had the icon from the webpage and links to the webpage, and then it just loads the webpage. The first time you load it might load a little slow because it's got to cache some stuff, but not very long in the video, it hung for a second, but that doesn't always happen when I do this. The thing is, the other application is pulling from the same sources, so it would have the same lag if there was a slow internet connection. Someone in the comments commented how much they hate when people take websites and package them as applications, and in many cases, I do agree, I used to hate that a lot as well. I kind of gone towards doing that for my personal applications, and again, I say personal applications, and that's where some of the differences are. One of the things I wouldn't trust about stuff like that is someone already has a website that does everything, but then they're offering up an app that they want you to install. This happens all the time, like you go to county buildings, you see commercial online, it's like they have a website that does everything that you need to do, but then they really, really want you to install their app, and I question why. Because once you install an application, it's going to have more permissions. When you load up a website in a web browser, the web browser will stick to it, it's somewhat sandboxed, right? But you saw an APK, and yeah, Android has all these permissions, which I don't trust and don't understand anyway. When I say I don't understand, I get what they're trying to do, I just don't think the concept is a good one, but once you install an application, it could be doing other things in the background. So when someone says install my app when they already have a website, I question why. I don't trust it, especially if it's proprietary, which I'm not going to install because of that alone, but also it doesn't really seem like it's necessary to package a website as an application because modern web browsers, if you just put a few things in the header of your website and you create a shortcut of that website on your home screen on a mobile device, it's going to load kind of like a local, a native application. You can get it to load if you're using a Chromium based browser. It will load without the toolbar if you tell it to. It will give it an icon on the desktop. It will give you a little splash screen as it's loading. So it almost seems silly to package as an APK. So why would you want to package it as an APK? An Android app, that is. Well, I have had it happen to me a number of times. It's happened to my wife and I make web apps for people at work to simplify stuff because where I work they use horrible, horrible programs. So I will create websites, web pages on my web server that interact with the services we already have, but I create better interfaces in my opinion and I'll give people these links. I'll say put an icon or a shortcut on your home screen, but then later on they update their web browser and those links disappear. It's happened to me. Like I said, it's happened to my wife and it's happened to a number of coworkers of mine. It is super annoying. And the reason for this is, and I've mentioned this in previous videos, back in the day you wanted to add a shortcut to a website on your home screen or your desktop. You say use the default browser, open this link. And then if you ever change your default browser those shortcuts still work. You could specifically say open with this browser, but normally you would say open up this website with whatever the default web browser is. So you can change your default web browser and those links will still work. Well, that's not the way that mobile devices add shortcuts to your home screen. And even on desktop, if you're using something like Brave and you say add shortcut to home screen, what it does is it takes that website, puts it in a database for your user that Brave browser or Chrome or Chromium uses. And then on the home screen it creates a shortcut that says, okay, look in the database for this ID and then load this web page. Well, if anything happens to that database those links don't work anymore. For a majority of the time the shortcuts just completely disappear. This makes me look bad when I've put a link for somebody to an application I made on their phone and then it disappears. So I learned how to package a website as an APK that I could share with people. It's super simple. I have a video coming up on it. I have a script that makes it easy once you have your system set up and they install this APK and then you don't have to worry about the web browser, what web browser they're using and whether the update's going to remove it because it just uses the built-in web view for the Android device. So that's one reason to package a website as an APK. Another reason I don't really do this but you could directly make a HTML CSS web interface but packaging as APK you can give it extra permissions to actually interact with the system. I haven't done that. That is something you could do. If you already know how to create stuff with HTML it's a great way to go. But again, one of my concerns when companies package websites as APK or they just say open up an app when they already have a website is what is that app doing? And that's not really a concern though when I am the developer. So when I'm packaging websites as APKs as Android apps I'm doing it for myself or people that I know so I'm not worried about security what is this app doing because I created the app. And I'm not concerned about size because again, your phone, your mobile device and your desktop should be able to do 99% of the things you need to do out of the box. You shouldn't have to install a bunch of excess applications. So if I want to load up something I created all the tools should already be there and that's true when it comes to a web interface. So when you're packaging something as an APK or a website as an APK the size is super small as I've talked about in the previous video. You know, I packaged a website and it was about 200 kilobytes and some of that's the icon. And that's because it's not packaging the web view it's not packaging anything. It's just basically I have a little bit of HTML with JavaScript built into the APK that actually just forwards to the website. I could load all the HTML and CSS and JavaScript locally within the APK so I wouldn't even need an internet connection. But what my little script does is it has a very small HTML page that's a load screen. It loads up a JavaScript file that has one line that says towards this website. Could be a little better. I could have a check if there is a web connection. If not display a local interface saying there's no web connection but mine just kind of tries to forward to it. So if you don't have an internet connection you'll get an error there. But again, the file size is really small because it already has your device already has a web viewer on it and you don't need extra tools for that. So the APK is super small. And again, I love anything that's plain text. It just makes things so easy to work with. Another reason that I don't like packaging websites as applications and it's not so much on mobile devices because you wouldn't do this on mobile devices at least not with ease is I like running websites in my web browser because I had developer tab that I can open up and modify stuff and I can write my own plugins for the web browser. Again, you don't really do that on mobile devices. I wish there was more of that on mobile devices. I know there's some options out there but none of them seemed super great but on my desktop device I can write some basic JavaScript and say, hey, when this page loads do this, modify the website in this or grab this information and forward it along. I write little JavaScripts all the time while these little plugins for or add-ons or whatever they're called for, Brave browser, Chrome-based browsers. It just makes life easier when people create applications as web pages because even though CSS is, or CSS is great, C and C++ are great low-level programming languages or at least lower level than JavaScript. To modify it, I need to get the source code which isn't always available. Even it is available, I need to get it and then I need to compile it. I mean to make sure I have all libraries and the proper compilers and how to compile it where when something is written in a script like JavaScript and HTML I can modify it real time in the web browser and it's super simple and I love that. At work, sometimes we have these interfaces and it's like, oh, this interface is horrible and there's nothing I can do about it because it's local but luckily over the years so many things have gone to web-based applications and even if I hate the web-based applications I can modify them. I can again, write plugins for my browser add-ons, extensions, whatever they're called. Or lots of times I can just use W get and write a shell script or use curl and a shell script and I can pull down information. Like at work, we used to have an interface that would display how much sick time and vacation time we've built up and every month I'd go and I make sure that I'd log and I had a database of my own stuff but I'd have to be at work, I'd have to open up that application, type in my information, go to it. Well now they've moved it all to a website. I have a shell script that I run and in my shell it lists all my time off that I have available and logs it locally so I have my local storage of that. And I run this one command, it logs into the website using my credentials that I have stored clearly on my machine and it pulls down that information because it's either basic HTML or maybe even better it would be JSON but I think in this case I'm just scraping the HTML from the website and the fact that it was written in HTML makes it so easy for me to grab information, modify the information, submit information. I don't even need to go to the webpage, I can do a lot of this stuff straight from the shell and if I do go to the webpage I have again my own little JavaScripts that run when certain pages load that might modify the way the page looks or autofill stuff. We've had a lot of reporting systems over the years where you need to fill in these boxes of information but then further along in the form they're asking for the same information you gotta fill out the same thing multiple times. So I've written scripts that once you fill in one box it autofills in the others. If it was written in a binary program I'm not gonna backwards engineer this application to do that but with HTML and JavaScript it is super simple to do. So I like HTML, I like JavaScript, I like CSS mainly because it's so easy to modify and I don't have to worry about some company open sourcing it because just loading up on my web browser I have full control of stuff that's loading and running on at least my client's side and packaging up websites as applications can be useful but again I wouldn't trust an APK made by another company that's just their website because I'm like well why are you giving me your website as an APK? Why can't I just go to your website and create a shortcut which is what I would do. So many companies they push, they really really really want you to install their application and that makes me go why? Why do you want me to do this? I don't trust you. Anyway, that's my thought for today. Thanks for watching or listening. Filmsbychrist.com that's Chris Decay and as always I hope that you have a great day.