You certainly don't have to use Github to do this. Github is primarily a source control versioning system.
In fact you don't necessarily have to create a module, because Java has a standard mechanism for using common library code. It's called the JAR file. If your library just involves Java code, then a standard JAR would do the job.
But it's great that you now have a procedure to do this.
And on a side note, if you want to use a source control system, there are options for that. You don't have to use the public Github repository. You can use a completely local code repository if you wish. You don't have to push your code to a remote repository.
As I was reading the cited websites, the option of using a JAR became clear and I may go that way. I've used them - and even created them - before in Eclipse. But the additional things you can store in an AAR are intriguing so I tried following the instructions on those pages to create an AAR. Unfortunately, I had only limited success. I didn't find enough detail in the first one so I tried the second one. I was able to create a common code module for one project and even managed to "see" the code in the main project. But when I tried to do the exact same thing in a second project, it wouldn't work. Then I did some more searching and found the third answer to this question, which seems very promising:
https://stackoverflow.com/questions...android-studio-and-an-application-project-tha. Unfortunately, I'm not finding it clear enough that I can follow it.
I like its approach of having all the common code in a project of its own but then usable by any other project that needs the code. I also like the ability of having XML files like layouts in there. It would let me make activities with screens that could be used in multiple projects for things like, say, error handling or logins. I'm not sure how to get a more complete explanation of that third answer though. Any ideas? Or is it so clear to you that you can explain it to me in a bit more detail?
As for GitHub, I have a superficial familiarity with it from having done its beginner's tutorial. I was also working through a Udacity course on Git (as opposed to GitHub) but ran into problems with bugs in the course so I've put that aside for now. However, I did get as far as setting up my own Git repository on my laptop and will be quite happy to use it for my code once I get back to learning Git properly. (Any suggestions for a better course than the Udacity one?) And ultimately, when I get this app working 100% to my satisfaction, I want to put it on GitHub and write a tutorial or blog or make videos to explain all the key parts. One of my biggest frustrations with Android has been the inability to find really good examples to imitate, examples that do real things rather than trivial placeholder things. I get why the videos simplify things; if they didn't, they'd be hours long rather than minutes long and no one would finish them. But somewhere along the line, people need non-trivial programs to learn from and I may just take that on with at least one serious program that uses RecyclerView, AsyncTasks to read and write from a MySQL databases, preferences, and proper error handling.
But I'm not ready to publish that example to GitHub yet; it needs to work to my satisfaction before I do that. Having the ability to put some utilities and convenience methods in a common code module would help me organize my code better. Two videos I saw both talked about putting that common code out on GitHub and left me with the impression that this was the *only* way to have common code in Android. That astounded me and made me ask whether it was the only way. Luckily, the impression they gave was clearly wrong
Now if only I could get this module to be visible from any project that needs it, I'd have one major item on my TODO list settled....