Search code examples
javascriptjavabrowsermobile-website

I want to know if I've to rewrite my code for Android


If I make a website with HTML,CSS & JS, I can run this in PC browsers. Would I also be able to run it in Android mobile browsers? Or I have to use different programming language like Java? Also, I want to know is, Android apps like Facebook, Twitter or Instagram, what languages are compulsory to make them?


Solution

  • At the core of every browser, mobile or not, is JavaScript. You can absolutely build a website that runs on them. However, you will have to mind what is actually compatible for those. You can manually check to see if a certain method or object is supported in different browsers by using a tool like https://caniuse.com/ or you could set up an automated solution that would run against your test suite (you could also test with these tools manually, but automation is always preferred) with a tool like https://www.browserstack.com/

    As far as your second question, android apps are all written in Java, not to be confused with JavaScript and have to be compiled to run on android. You'll need a compiler like IntelliJ or Eclipse

    Edit: as someone else pointed out, you can also use a tool that might compile html/javascript into a native app with a tool like React Native or NativeScript