I am far from an expert when it comes to understanding the minutia of code compilation. But I am learning some android development, and I noticed how layouts and other things are essentially parsed out of xml. I was wondering if this parsing happens at compile time or at runtime? If it is at runtime, it seems like there might be some overhead associated with parsing out a very complex layout.
Hope that this question isn't too vague or doesn't make sense.
The parsing of the XML to create the layout happens at compile time. You will notice that if anything in your XML is malformed, the compiler will throw an error.
Certain aspects of the layout such as calculating relative position happen at run time, but there is nothing that can be done to avoid that.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With