How big can strings.xml in resources can be?
I saw this post that says when the strings.xml
is to big the app is crashing. My strings.xml
file is 700 lines right now and it will be a lot bigger in a while.
The answers in the post say that can use a sqlite db to prevent this.
But in my case i have a sqlite that takes the data for the entries from strings.xml
because my app uses locale for different languages.
My question is, how big the strings.xml
can be? And if i have a limitation for the lines what i can do to prevent the crash ?
android android-resources
add a comment |
I saw this post that says when the strings.xml
is to big the app is crashing. My strings.xml
file is 700 lines right now and it will be a lot bigger in a while.
The answers in the post say that can use a sqlite db to prevent this.
But in my case i have a sqlite that takes the data for the entries from strings.xml
because my app uses locale for different languages.
My question is, how big the strings.xml
can be? And if i have a limitation for the lines what i can do to prevent the crash ?
android android-resources
What did your logcat says
– Killer
5 hours ago
as i said there is no a crash right now, but the post that i linked says if the strings.xml is to big the app will be crash. My strings.xml will be to big in a while, my question is how big can strings.xml can be ?
– Thelouras
5 hours ago
1
Why can't you use SQLite directly? Meaning one table for each language? Just choose the language table you need and use the strings stored inside that one.
– Fantômas
1 hour ago
@Fantômas because the app was designed from the beginning like this and we are using locale with strings resources. And it wants a lot of work to transfer all the data from strings.xml in new tables. Maybe it will be done in a future refactoring!
– Thelouras
33 mins ago
add a comment |
I saw this post that says when the strings.xml
is to big the app is crashing. My strings.xml
file is 700 lines right now and it will be a lot bigger in a while.
The answers in the post say that can use a sqlite db to prevent this.
But in my case i have a sqlite that takes the data for the entries from strings.xml
because my app uses locale for different languages.
My question is, how big the strings.xml
can be? And if i have a limitation for the lines what i can do to prevent the crash ?
android android-resources
I saw this post that says when the strings.xml
is to big the app is crashing. My strings.xml
file is 700 lines right now and it will be a lot bigger in a while.
The answers in the post say that can use a sqlite db to prevent this.
But in my case i have a sqlite that takes the data for the entries from strings.xml
because my app uses locale for different languages.
My question is, how big the strings.xml
can be? And if i have a limitation for the lines what i can do to prevent the crash ?
android android-resources
android android-resources
edited 1 hour ago
Fantômas
32.3k156288
32.3k156288
asked 5 hours ago
Thelouras
3181314
3181314
What did your logcat says
– Killer
5 hours ago
as i said there is no a crash right now, but the post that i linked says if the strings.xml is to big the app will be crash. My strings.xml will be to big in a while, my question is how big can strings.xml can be ?
– Thelouras
5 hours ago
1
Why can't you use SQLite directly? Meaning one table for each language? Just choose the language table you need and use the strings stored inside that one.
– Fantômas
1 hour ago
@Fantômas because the app was designed from the beginning like this and we are using locale with strings resources. And it wants a lot of work to transfer all the data from strings.xml in new tables. Maybe it will be done in a future refactoring!
– Thelouras
33 mins ago
add a comment |
What did your logcat says
– Killer
5 hours ago
as i said there is no a crash right now, but the post that i linked says if the strings.xml is to big the app will be crash. My strings.xml will be to big in a while, my question is how big can strings.xml can be ?
– Thelouras
5 hours ago
1
Why can't you use SQLite directly? Meaning one table for each language? Just choose the language table you need and use the strings stored inside that one.
– Fantômas
1 hour ago
@Fantômas because the app was designed from the beginning like this and we are using locale with strings resources. And it wants a lot of work to transfer all the data from strings.xml in new tables. Maybe it will be done in a future refactoring!
– Thelouras
33 mins ago
What did your logcat says
– Killer
5 hours ago
What did your logcat says
– Killer
5 hours ago
as i said there is no a crash right now, but the post that i linked says if the strings.xml is to big the app will be crash. My strings.xml will be to big in a while, my question is how big can strings.xml can be ?
– Thelouras
5 hours ago
as i said there is no a crash right now, but the post that i linked says if the strings.xml is to big the app will be crash. My strings.xml will be to big in a while, my question is how big can strings.xml can be ?
– Thelouras
5 hours ago
1
1
Why can't you use SQLite directly? Meaning one table for each language? Just choose the language table you need and use the strings stored inside that one.
– Fantômas
1 hour ago
Why can't you use SQLite directly? Meaning one table for each language? Just choose the language table you need and use the strings stored inside that one.
– Fantômas
1 hour ago
@Fantômas because the app was designed from the beginning like this and we are using locale with strings resources. And it wants a lot of work to transfer all the data from strings.xml in new tables. Maybe it will be done in a future refactoring!
– Thelouras
33 mins ago
@Fantômas because the app was designed from the beginning like this and we are using locale with strings resources. And it wants a lot of work to transfer all the data from strings.xml in new tables. Maybe it will be done in a future refactoring!
– Thelouras
33 mins ago
add a comment |
2 Answers
2
active
oldest
votes
There is no limitation of the strings.xml. Its more a problem of loading a string array. The getResources().getStringArray function is not meant to load arrays with more elements than 512 (more about this here Should I be using something other than getResource().getStringArray() to populate a large array?) But as long as you are not using big arrays you should be fine.
add a comment |
The Resources.get***
methods doesn't have any explicit limitation, so it depends on your device's memory size. And as I know the old version of Android has per process memory limitation.
So that is not about how big strings.xml is ? but about the Resources.get*** method ?
– Thelouras
4 hours ago
Beacause my strings.xml file will be 1000+ lines. It is not a problem ?
– Thelouras
4 hours ago
1
Because you read strings.xml with Resources' methods. 1000+ lines in an xml file is not extravagant. You just need to take care of the memory usage.
– shingo
2 hours ago
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53902842%2fhow-big-can-strings-xml-in-resources-can-be%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
There is no limitation of the strings.xml. Its more a problem of loading a string array. The getResources().getStringArray function is not meant to load arrays with more elements than 512 (more about this here Should I be using something other than getResource().getStringArray() to populate a large array?) But as long as you are not using big arrays you should be fine.
add a comment |
There is no limitation of the strings.xml. Its more a problem of loading a string array. The getResources().getStringArray function is not meant to load arrays with more elements than 512 (more about this here Should I be using something other than getResource().getStringArray() to populate a large array?) But as long as you are not using big arrays you should be fine.
add a comment |
There is no limitation of the strings.xml. Its more a problem of loading a string array. The getResources().getStringArray function is not meant to load arrays with more elements than 512 (more about this here Should I be using something other than getResource().getStringArray() to populate a large array?) But as long as you are not using big arrays you should be fine.
There is no limitation of the strings.xml. Its more a problem of loading a string array. The getResources().getStringArray function is not meant to load arrays with more elements than 512 (more about this here Should I be using something other than getResource().getStringArray() to populate a large array?) But as long as you are not using big arrays you should be fine.
answered 4 hours ago
Hansfritzi
425
425
add a comment |
add a comment |
The Resources.get***
methods doesn't have any explicit limitation, so it depends on your device's memory size. And as I know the old version of Android has per process memory limitation.
So that is not about how big strings.xml is ? but about the Resources.get*** method ?
– Thelouras
4 hours ago
Beacause my strings.xml file will be 1000+ lines. It is not a problem ?
– Thelouras
4 hours ago
1
Because you read strings.xml with Resources' methods. 1000+ lines in an xml file is not extravagant. You just need to take care of the memory usage.
– shingo
2 hours ago
add a comment |
The Resources.get***
methods doesn't have any explicit limitation, so it depends on your device's memory size. And as I know the old version of Android has per process memory limitation.
So that is not about how big strings.xml is ? but about the Resources.get*** method ?
– Thelouras
4 hours ago
Beacause my strings.xml file will be 1000+ lines. It is not a problem ?
– Thelouras
4 hours ago
1
Because you read strings.xml with Resources' methods. 1000+ lines in an xml file is not extravagant. You just need to take care of the memory usage.
– shingo
2 hours ago
add a comment |
The Resources.get***
methods doesn't have any explicit limitation, so it depends on your device's memory size. And as I know the old version of Android has per process memory limitation.
The Resources.get***
methods doesn't have any explicit limitation, so it depends on your device's memory size. And as I know the old version of Android has per process memory limitation.
answered 4 hours ago
shingo
1,0111414
1,0111414
So that is not about how big strings.xml is ? but about the Resources.get*** method ?
– Thelouras
4 hours ago
Beacause my strings.xml file will be 1000+ lines. It is not a problem ?
– Thelouras
4 hours ago
1
Because you read strings.xml with Resources' methods. 1000+ lines in an xml file is not extravagant. You just need to take care of the memory usage.
– shingo
2 hours ago
add a comment |
So that is not about how big strings.xml is ? but about the Resources.get*** method ?
– Thelouras
4 hours ago
Beacause my strings.xml file will be 1000+ lines. It is not a problem ?
– Thelouras
4 hours ago
1
Because you read strings.xml with Resources' methods. 1000+ lines in an xml file is not extravagant. You just need to take care of the memory usage.
– shingo
2 hours ago
So that is not about how big strings.xml is ? but about the Resources.get*** method ?
– Thelouras
4 hours ago
So that is not about how big strings.xml is ? but about the Resources.get*** method ?
– Thelouras
4 hours ago
Beacause my strings.xml file will be 1000+ lines. It is not a problem ?
– Thelouras
4 hours ago
Beacause my strings.xml file will be 1000+ lines. It is not a problem ?
– Thelouras
4 hours ago
1
1
Because you read strings.xml with Resources' methods. 1000+ lines in an xml file is not extravagant. You just need to take care of the memory usage.
– shingo
2 hours ago
Because you read strings.xml with Resources' methods. 1000+ lines in an xml file is not extravagant. You just need to take care of the memory usage.
– shingo
2 hours ago
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53902842%2fhow-big-can-strings-xml-in-resources-can-be%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
What did your logcat says
– Killer
5 hours ago
as i said there is no a crash right now, but the post that i linked says if the strings.xml is to big the app will be crash. My strings.xml will be to big in a while, my question is how big can strings.xml can be ?
– Thelouras
5 hours ago
1
Why can't you use SQLite directly? Meaning one table for each language? Just choose the language table you need and use the strings stored inside that one.
– Fantômas
1 hour ago
@Fantômas because the app was designed from the beginning like this and we are using locale with strings resources. And it wants a lot of work to transfer all the data from strings.xml in new tables. Maybe it will be done in a future refactoring!
– Thelouras
33 mins ago