Posts

Showing posts from January, 2021

Errors Log: Android Studio Error I encountered & solved

 Android Studio problem [SOLVED]: [1] Error Inflate XML in activity Solution 1: 1. Remove <fragment tag from activity xml 2. Rather, replace it with a <FrameLayout 3. In activity class, simply setContentView(R.layout.fragment_register); //here, set the layout as the fragment id Solution 2 (turns out my error is actually this) 1. Check the fragment class 2. My error was I did not inflate the fragment class  ------------ *note: any button or function should be made inside onViewCreated [2] Error public void onComplete(@NonNull Task<AuthResult> task) { not succesful Solution: 1. Add "uses INTERNET" in androidmanifest.xml 2. Make sure all variables in class User are accesible (make them public) [3] Attempt to invoke virtual method 'void androidx.navigation.NavController.navigate(int)' on a null object reference Solution: 1. Change navigate method  from: navController.navigate(R.id.action_registerFragment2_to_logIn); to: Navigation.findNavController(v).navigate

Two ways to host a website on remote server (for static and dynamic website)

How to host a website on a remote server? First of all, remote server refers to server that can be accessed by a group of team which requires an URL. For example:  https://syahirahnsmn.github.io/  (this is static web page hosted on github) There are many ways to do so & there are many web hosting provider as well. One of the ways is by using github which need some simple steps: *note: this is only for static website (doesnt require database) (1) Host on github (url: username.github.io) Another way I found is by hosting the website on Heroku by connecting the Heroku profile to github. The steps are as below: *note: this is suitable for dynamic website that requires database connection [reference: https://www.youtube.com/watch?v=I4Ra-80O3R4 ] (1) Set up a Heroku account and connect to a github repository (2) Git commit project from any IDE (I am using VS Code) from github desktop -> push to github (3) Deploy the github repo manually on Heroku *note: usually the main page should b