This is the first time I have made my own library for Android apps, and I am struggling with packaging including visibility.
I don't know the standard of that area when I search the internet.
I cut the package as follows (somewhat omitted for explanation), but
I'd like to somehow make sure I can't see anything other than Util.java
.
(I don't want to show library users anything other than `Util.java')
I know it's better to remove the packaging and make it flat. I was wondering if there was a way to adjust visibility while separating packages in an easy-to-understand way.
model
, usecase
, repository
Each class in the package is public
Browse from Util
to the usecase
, model
package, and from the usecase
package to the repository
, model
package.com.hogehoge
|-->model
|-->usecase
|-->repository
|- Util.java
If you want to emphasize that this is not an API that should be used and you don't want to know the contents easily, I think it is common to obfuscate it by using a program.
For example, in the above example, if you multiply the program,
com.hogehoge
|-->a
|-->b
|-->c
|- Util.java
You can convert it to a meaningless string, such as
(such as the class name in each package is a or b).
Therefore, it is difficult to judge by the class name and method name, and I think it will be basically accessible by not publishing documents.
If you don't want to be able to call at all, you will automatically insert a program to rewrite to the same package or package private class when you build it...
Still, if you use the worst reflection, you can access it.
Kotlin has the concept of a module, and I think it was possible to access it in a separate package and not from outside the module if it was in the module.
582 PHP ssh2_scp_send fails to send files as intended
619 Uncaught (inpromise) Error on Electron: An object could not be cloned
578 Understanding How to Configure Google API Key
573 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
613 GDB gets version error when attempting to debug with the Presense SDK (IDE)
© 2024 OneMinuteCode. All rights reserved.