I just obtained a debug Google Maps API key for my new MacBook, and Google spit back a key with double dashes (“–“) in it. I normally put all of our debug keys in comments so that others can store their keys in the source and copy/pasta as necessary. Out of convenience for the team, really.
The compiler throws a fit when you have these double dashes in comments. Is there a way to escape or otherwise encode my key so I can store it in a comment?
Example:
<com.google.android.maps.MapView android:id="@+id/mapview_map" android:layout_width="fill_parent" android:layout_height="fill_parent" android:apiKey="ABCDEFABCDEFABCDEF0123456789--123456789" /> <!-- android:apiKey="FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" /> CERT KEY --> <!-- android:apiKey="AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" /> Sally debug Key --> <!-- android:apiKey="ABCDEFABCDEFABCDEF0123456789--123456789" /> Joe debug key -->
According to the XML standard, no: http://www.w3.org/TR/REC-xml/#sec-comments
I’d recommend just picking another character not in 0-9,A-F that everyone will understand means dash, like an underscore. — inside of an XML comment invalidates the XML, and there’s no way around it.