[android-developers] Re: localization bloats my app - is there an alternative approach?
On Friday, November 18, 2011 1:43:48 AM UTC, Zsolt Vasvari wrote: In my opinion, people seem to like larger apps -- more like getting more bang for your buck. Also not true if your app has one of the many incompatibilities with InstallToSD. As most of mine do. I still need to work really hard to keep my APKs small, because the user's essentially forced to keep them in device main memory. But an interesting observation! String -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: localization bloats my app - is there an alternative approach?
That's an interesting viewpoint :). But I think it depends on the app; this may apply more to games where users anticipate levels and graphics but probably not so much for a calculator or an alarm clock (as is the case with my app). -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: localization bloats my app - is there an alternative approach?
On Nov 16, 5:58 pm, Mark Murphy mmur...@commonsware.com wrote: So, you added 1.5MB of space with 12 languages. That's around 100KB apiece. Since this stuff should be compressed in the APK, that's probably close to 1MB of strings per language. Hence, the solution would appear to be: make a less wordy app... :-) Seriously, how big are your string.xml files? Each of the files is about 80K. Thanks for the input on compression. I will go with solution 2 then. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: localization bloats my app - is there an alternative approach?
2) Download additional resources - The apk contains only enough translations to instruct users to download full language packages of their choice. - The language packages downloaded onto the SD card (simple xml files) - The app loads the xml file and creates its own table of resource strings which is used instead of R.string. Contra: This adds to the load time of the app if the string.xml is really big. After a thread on this topic last year, I went for (2). You can also download the strings zipped. Of course there are extra complications. For instance, you can't then refer to string IDs in standard XML layouts item like TextView and Button. I guess you could define MyTextView and use your internal lookup in the derived class. And you have to replace e.g. all getString() etc calls in a service/activity with something like MyRes.getString( this ). Or you can go for a mixed approach where only stuff that doesn't appear in layouts is offloaded. Pent -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: localization bloats my app - is there an alternative approach?
Of course there are extra complications. For instance, you can't then refer to string IDs in standard XML layouts item like TextView and Button. I guess you could define MyTextView and use your internal lookup in the derived class. And you have to replace e.g. all getString() etc calls in a service/activity with something like MyRes.getString( this ). Or you can go for a mixed approach where only stuff that doesn't appear in layouts is offloaded. Fortunately, in my case the strings referred to in layouts make up less than 10% of the full resource texts. So I will do a mixed approach like you suggest. Assuming I don't die of boredom splitting the resource files. What a pain... -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: localization bloats my app - is there an alternative approach?
In my opinion, people seem to like larger apps -- more like getting more bang for your buck. If each language only added 80k, I would certainly NOT go with option 2. On Nov 17, 4:30 pm, mot12 martin.hu...@gmail.com wrote: On Nov 16, 5:58 pm, Mark Murphy mmur...@commonsware.com wrote: So, you added 1.5MB of space with 12 languages. That's around 100KB apiece. Since this stuff should be compressed in the APK, that's probably close to 1MB of strings per language. Hence, the solution would appear to be: make a less wordy app... :-) Seriously, how big are your string.xml files? Each of the files is about 80K. Thanks for the input on compression. I will go with solution 2 then. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: localization bloats my app - is there an alternative approach?
Actually in a normal build the resources.arsc file isn't zip compressed with the other files are and it can be quite large. Manually running aapt can compress it (and does by default), but then you get really weird force closes on some froyo devices. I've been meaning to ask about why this is. But my advice is not to split the APK and translations. It will create a lot more work for you and confusion or bugs for users. And phone's storage space is just getting large. On Nov 16, 10:58 am, Mark Murphy mmur...@commonsware.com wrote: On Wed, Nov 16, 2011 at 9:49 AM, mot12 martin.hu...@gmail.com wrote: My app was about 1.5M, after adding 12 languages I am now looking at 3M because of the multiple string.xml files in the resources. So, you added 1.5MB of space with 12 languages. That's around 100KB apiece. Since this stuff should be compressed in the APK, that's probably close to 1MB of strings per language. Hence, the solution would appear to be: make a less wordy app... :-) Seriously, how big are your string.xml files? -- Mark Murphy (a Commons Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy Warescription: Three Android Books, Plus Updates, One Low Price! -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: localization bloats my app - is there an alternative approach?
On Wed, Nov 16, 2011 at 2:18 PM, Kevin TeslaCoil Software ke...@teslacoilsw.com wrote: Actually in a normal build the resources.arsc file isn't zip compressed with the other files are and it can be quite large. Manually running aapt can compress it (and does by default), but then you get really weird force closes on some froyo devices. I've been meaning to ask about why this is. If you can reproduce the problem, it seems like a fine issue for b.android.com, perhaps with a side post to the adt-dev Google Group about why they aren't compressed by default. Regardless, my apologies to the OP for my error. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy _The Busy Coder's Guide to *Advanced* Android Development_ Version 2.1 Available! -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: localization bloats my app - is there an alternative approach?
They aren't compressed so that they can be mmapped when starting the process, instead of having to decompress and copy the entire resource block to RAM. You really do not want that file compressed. One thing to look at is that you are building against a the min SDK version at which the platform switched to UTF-8 for resource strings. On Wed, Nov 16, 2011 at 1:24 PM, Mark Murphy mmur...@commonsware.comwrote: On Wed, Nov 16, 2011 at 2:18 PM, Kevin TeslaCoil Software ke...@teslacoilsw.com wrote: Actually in a normal build the resources.arsc file isn't zip compressed with the other files are and it can be quite large. Manually running aapt can compress it (and does by default), but then you get really weird force closes on some froyo devices. I've been meaning to ask about why this is. If you can reproduce the problem, it seems like a fine issue for b.android.com, perhaps with a side post to the adt-dev Google Group about why they aren't compressed by default. Regardless, my apologies to the OP for my error. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy _The Busy Coder's Guide to *Advanced* Android Development_ Version 2.1 Available! -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: localization bloats my app - is there an alternative approach?
On Wed, Nov 16, 2011 at 4:53 PM, Dianne Hackborn hack...@android.com wrote: They aren't compressed so that they can be mmapped when starting the process, instead of having to decompress and copy the entire resource block to RAM. You really do not want that file compressed. Ah. Makes sense. One thing to look at is that you are building against a the min SDK version at which the platform switched to UTF-8 for resource strings. How would we determine what version this was? Thanks! -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy _The Busy Coder's Guide to *Advanced* Android Development_ Version 2.1 Available! -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: localization bloats my app - is there an alternative approach?
Hence, the solution would appear to be: make a less wordy app... :-) This is also a problem for my app as it has 2000+ translatable strings... Less wordy is not an option. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: localization bloats my app - is there an alternative approach?
One thing to look at is that you are building against a the min SDK version at which the platform switched to UTF-8 for resource strings. How would we determine what version this was? I am also interested in this... -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en