Repository navigation
Edit XML Files
Most of Blueprint's setup happens in XML files, like strings.xml or dashboard_setup.xml. If you've never edited one, this page explains everything you need. It takes a few minutes, and it saves you from the most common build errors. 🧩
Here's a small example:
<resources>
<!-- Your app's name -->
<string name="app_name">My App</string>
<bool name="animations_enabled_by_default">true</bool>
</resources>Each setting is one element, with three parts:
<string name="app_name">My App</string>| Part | In the example | Can you change it? |
|---|---|---|
| The opening tag, with the setting's type and name | <string name="app_name"> |
No. Blueprint finds the setting by this name |
| The value | My App |
Yes. This is the only part you change |
| The closing tag | </string> |
No. It must match the opening tag |
So, to change your app's name, only replace My App and leave everything around it exactly as it is:
<string name="app_name">Wallpapers by Jane</string>Everything goes inside <resources> and </resources>, the first and last lines of the file. Don't delete them.
The type at the start of the tag tells you what kind of value it expects:
| Type | What to write | Example |
|---|---|---|
string |
Any text | <string name="email">jane@example.com</string> |
bool |
Only true or false
|
<bool name="show_overview">true</bool> |
integer |
A whole number | <integer name="default_theme">2</integer> |
color |
A hex color code | <color name="accent">#3881fa</color> |
Some settings are empty by default. That means "not set":
<string name="toolbar_logo"></string>To set it, write the value between the two tags, with no spaces around it:
<string name="toolbar_logo">my_logo</string>A string-array is a list. Each value goes in its own <item>:
<string-array name="donation_items">
<item>small_donation</item>
<item>large_donation</item>
</string-array>To add a value, copy a whole <item>...</item> line and change what's inside. To remove one, delete its whole line.
Some elements keep their value inside the tag, and end with /> instead of a closing tag. You change the text inside the quotes:
<version title="v1.0.0" />
<item text="First release" />Anything between <!-- and --> is a comment. The app ignores it. Comments explain what each setting does, so they're worth reading.
<!-- Do you want animations to be enabled for all your users? -->
<bool name="animations_enabled_by_default">true</bool>Comments can also turn off a piece of code. Some pages ask you to "remove the comment marks" to turn something on. That means deleting the <!-- before the code and the --> after it, and nothing else:
<!--
<uses-permission android:name="com.android.vending.BILLING" />
-->becomes:
<uses-permission android:name="com.android.vending.BILLING" />Always delete both marks. If you delete only one, the rest of the file breaks.
A few characters have a special meaning in XML, so they need to be written differently inside a value:
| Character | Write it as | Example |
|---|---|---|
& |
& |
Black & White shows as "Black & White" |
< |
< |
5 < 10 |
' (apostrophe) |
\' |
Jane\'s Wallpapers |
" (double quote) |
\" |
The \"best\" icons |
The & matters most in links. For example, a Google Drive link has an & in it, so in an XML file you write it like this:
<string name="json_url">https://drive.google.com/uc?export=download&id=FILE_ID</string>This only applies to XML files. In the wallpapers JSON file, write & as it is.
- Red underlines mean something is wrong on that line. Hover over it to see what.
- Code → Reformat Code fixes the indentation of the whole file, which makes a missing or extra tag easier to spot.
- When the build fails, the error message names the file and the line. Click it to jump there.
The exact error message depends on your version of Android Studio, but it always names the file and the line. Go to that line and look for one of these.
-
The error mentions a tag, like "mismatched tag" or "must be terminated"
A closing tag is missing, misspelled or doesn't match its opening tag. Check that every
<string ...>has a</string>after it, and the same for every other type. -
The error mentions an apostrophe
A text has an
'in it. Write it as\', likeJane\'s Wallpapers. -
The error says "not well-formed", or mentions
&or an entityA value, usually a link, has an
&in it. Write it as&. -
The error mentions "prolog" or "trailing section"
There's text before
<resources>or after</resources>, usually a leftover from a paste. Delete it. -
No error, but a setting has no effect
Check that you didn't change the
name, thatboolvalues are exactlytrueorfalse, and that the setting isn't inside a comment.
Note
Would you like to help improve this wiki?
It is advised that you contribute to jahirfiquitiva/dashboards-wikis, which is the repository that holds the contents of this wiki. Please open an issue or a pull request in that repo instead.
Wiki by Jahir Fiquitiva, with contributions from Patryk Goworowski, Lumiq Creative and Jackson Hayes. Special thanks to Sanchith Hegde.
Licensed under the Creative Commons Attribution-ShareAlike 4.0 International License.