I found out that the package name should follow the web domain you own for this application / developer Id.
I published an app starting with com.health... (example) because I didn't know better at those times. In how far will I run into (legal) issues (if any), because I am not the owner of health.com (example).
Should I unpublish and republish with a proper package name?
This naming convention is by no means mandatory. And it also has nothing to do with being able to see who created the library.
The point is that there is a single flat namespace for packages, and that thus every package ever written, including old packages that are no longer maintained, packages that are currently being written, packages that haven't been written yet, packages by developers who are already dead and future packages of developers who aren't even born yet, shares the same namespace. So, every developer has to agree with every other developer, including ones that are already dead and ones who haven't been born yet on what the names of packages are going to be.
Obviously, this level of coordination is impossible. So, the next best thing is to have some sort of registry where every package name must be registered and the maintainer of the registry ensures that package names are globally unique.
However, doing that is quite expensive, so instead they instead chose a naming convention which "outsources" the maintenance of this global registry to someone else: by suggesting that the package name should be derived from an Internet Domain Name you own, the work of making sure that no two people own the same package name is outsourced to the Internet Domain Name System which has been reliably, effectively, and efficiently doing exactly that for decades, on a global scale.
Yes, you should, but not for the reason you are asking about.
In how far will I run into (legal) issues (if any), because I am not the owner of health.com (example).
The issue is that you cannot guarantee that your names are going to be unique. The owners of health.com may decide to create an Android app, and they may have the same class names as you, for example. By using a package name that is guaranteed to be unique, e.g. a domain name you own (and even if it is just io.github.yourusername).
Republish the app with the proper name. There could be legal issues if any of the nodes in the package name are trademarked. Most companies trademark their name, for instance. If they do not prosecute any and all infractions on their trademark, they can lose it (in the US at least).
You irrevocably grant us, and our parent company, affiliates, licensees and assigns, a royalty-free, perpetual, non-exclusive, unrestricted right and license to copy, reproduce, modify, edit, adapt, translate, create derivative works of, publish, post, distribute, publicly perform, sublicense, or otherwise provide to others, your Content in any and all media, formats and channels (now in existence or hereinafter developed) for any purpose, including advertising and commercial purposes.
IANAL, but I don't how two people could say there are no legal issues. Maybe they mean in Indian law. Maybe there is some precedent I don't know about. Or maybe they mean that extradition from India to the US (or New York where Health.com chooses to litigate) is unlikely.
In short, just change it so you don't have to worry.
Not the answer you're looking for? Browse other questions tagged android android-development or ask your own question.
Develop for Desktop and mobile use?
What could be used to get data from server to android as fast as it reaches server?
Should I rename package after Android app name change?
What to keep in mind when releasing an app which uses libraries licensed under the Apache 2.0 License?