This has nothing to do with kotlin, but
1. No, resource ids (view and otherwise) are generated at build time, not install time.
2. Saving view ids to your database smells bad. The use case for database IDs is typically very different from that of view IDs
, and sharing them sounds like your code is conflating concepts and probably much too tightly coupled.