I am looking to make my Android application have several different names. Ideally, the name would be different after every time the application was opened, chosen from a predefined list.
Can this be done by having multiple values under <label> in the Android Manifest?
Another approach I was thinking about is to potentially edit Strings.xml, but as many others have pointed out, this cannot be done at runtime.
Does anyone have any ideas on how to achieve this or is it truly impossible? Thanks for the help.
Related
I'm sorry if this question is a little low-quality, kindly notify me about what to do if it is.
I just want to make a clarification. I am working on an app where users can sign up as three different types of users (student, parent or teacher). I want to know how this is usually done.
My current approach is to separate all of the Java/Kotlin files relating to each of the three user types into three different packages and simply follow the flow (from authentication). I feel that this is a little bogus and inefficient. How can I achieve this same feat with less files and less complexity?
If I'm supposed to include something I did not (snapshop, code snippet, etc), please let me know. Thank you!
If I wanted to translate an entire app (with button names and labels, and long text), is it better to just make a different app? Or is there a translation api I can use?
The reason I ask is that I tried going to the Goolge Play store and searching it in a different language, and it basically didn't understand what I wanted. So is there a different Goolge Play interface for different languages? Or some setting which I need to turn on?
How does this generally work?
Thank you!
use all your strings from a file instead of hard coded way. the name of the file is strings.xml in values folder, and for another language what u need to do is to crate values-ru values-ch etc. folder and put your strings.xml inside the folder. and change the values. this was a fast approach to explain your solution. for expanded, detailed solution is here : http://developer.android.com/guide/topics/resources/localization.html
You don't want to make multiple versions of the application. In general this is accomplished by using a locale-specific dictionary for each translation you want to use, so instead of hard-coding strings in your application you would reference an element in the appropriate reference database instead, which is basically a list of all the strings you use in your application.
Here's some information I found specifically for Android development: http://developer.android.com/guide/topics/resources/localization.html
As for translating, natural language processing isn't far enough along yet to give good translations automatically, especially without context. You can try Google's translate API (https://developers.google.com/translate/) which uses some statistical methods, but even that will likely give you erroneous translations (I'm sure you've probably used Google or another service to translate something and out came something you could be pretty certain wasn't accurate). You might be able to use that as a first step to converting the application to different languages and, if your application is open source (or even if it isn't) ask for user input as to the accuracy of the various translations.
Hopefully that is helpful.
I have an application that was build with all the text in English. I would like to add more support for other languages, but am concerned about my users who don't necessarily care about the application now having support for Spanish or whatever new language I have added needing to update. Also, if I am correcting bad translations on a daily basis this would be really annoying to users.
One idea is to make calls to a web service that provides the content for there specific local, which would allow for easy changing if there are bad translations and what have you. The concern with this is of course the speed.
So is there a right way or a better way to add/change values in the localization without forcing people to update?
I understand your problem. And I have one question. Do you think that it will not be annoying for users if your application requests the external service every time when, for instance, new activity is opened?
To my point of view, you should add support of a language, test the correctness of your translation (for instance, you can ask a user from another country who use your application to check the translation) and only then update your app in the market. If all your string resources are in xml files it is not very difficult to support several languages.
So my proposal for you is at first extract all your string resources into strings.xml file (for default language folder), and then just make several values folders with additional language support.
Adding localization is usually (if you followed the good practices) a matter of upgrading a few XML files. So even if the users upgrade, it won't take long at all and they will probably not notice (if they use autoupdate) from the market.
Check this out for more details.
so I am starting to learn how to develop Android Applications. I have experience with Java and C# from school, and I would say that while I am not a pro, I definitely have a fairly good handle on Object Oriented Programming.
So one thing I don't understand about Android is resources. For example, let's say I have a TextView in my GUI. Why do I have to define a string "Hello," then make the value that string called "Hello" = "hello?" I don't understand why the software development kit doesn't just let users make that string value "hello," and be done with it. What is the purpose of storing numbers and strings and stuff into resources? I know that there must be a solid explanation for this, but I just don't know what.
Also, I am experimenting with an Addition program (where I prompt the user with a randomized math problem, and they can input their answer, and my program will check if it is right or wrong, and restart). So I have a TextView for the problem (i.e., 1 + 1). When I create the TextView, I had to create a problemString in the resources, and then assign the problem TextView to the problemString. However, in my program, when the user has gotten the math problem right or wrong, I write over the problem with a new problem by simply changing the text of the textview. In no way do I interact with the problemString from the resources. And this works. So again, my question is, what is the purpose of having application resources and what role do they play in an application.
Also, how do I access, write over, and do stuff with the application resources.
Sorry that this is a really long question, but I really think Android dev. is really cool, and I am very eager to learn. Any help is APPRECIATED! xD
Thanks!
Imagine your application with a thousand different strings to display to a user. If you need to change 30 of them, do you want to dig through all your code, or one file?
Also localization is another reason for having different sets of string resources, as well as other resources, specific to a locale. Take the above scenario, a thousand different strings, AND three different languages. How would you handle that? Three different version programs? No.
today is not my day i am stuck with this problem
how can i access other application preference screen from my application by specifying in the preference screen layout using intent or something
what is the better or correct way to do so??????
thanks in advance
regards,
kariyachan
As far as I am aware you are not able to access other applications from your own. That would have huge security implications. Why do you need access to another application anyway?
Applications are separated for a reason. If I download two separate apps that do two separate things, I don't want one of them messing with the other in any way (settings, cache, saved files, database, etc).