I want to know if it is possible to write java code in android XML layout or string values files?
I mean something like this:
<string name="hello">Utilities.doSomething("Hello World, ActMain!")</string>
<string name="app_name">insurance</string>
Running code from strings.xml can be possible in the following way(Not tested,but a high level idea of doing it) 1.Get the string from strings.xml using R.string.* where * is the name of your string.
2.Use any of the expressions evaluation library to run it.
Again this a very high level idea.You will have to figure out how to do that your self.
Check the Jel library for it
Or check this list of evaluation libraries
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With