Google's official documentation mentions:
Escaping apostrophes and quotes
If you have an apostrophe or a quote in your string, you must either escape it or enclose the whole string in the other type of enclosing quotes. For example, here are some stings that do and don't work:
<string name="good_example">"This'll work"</string>
<string name="good_example_2">This\'ll also work</string>
<string name="bad_example">This doesn't work</string>
<string name="bad_example_2">XML encodings don't work</string>
My question is: Would unescaped quotes cause the application to crash or would it just have no effect and the quotes won't appear in the app UI? Would it crash on specific Android versions? I ask this because if I don't escape this symbol, Eclipse SDK gives me compilation errors but I came across a third-party app code which does not escape these characters, it crashes randomly and I'd like to confirm that this is/ is not one of the possible reasons for the crash.
The "third-party app code" might not be up-to-date. The requirement to escape quotes has been introduced at some point in time last year (don't remember exactly when) by an updated aapt.
The backslash is just a hint for aapt, it is not making its way into the apk file. Thus, I would not expect an app to crash for this specific reason.
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