Showing posts with label XML. Show all posts
Showing posts with label XML. Show all posts
Android: IntelliJ IDEA/Android Studio Quick Tip
I've started using IntelliJ as my IDE of choice for developing backend APIs and Android applications. One really nice feature, which is also available in Android Studio, is the option to create strings.xml values on the fly. All you need to do is type the name of the desired string resource and then the "bulb" icon will appear asking you if you want to create that resource. Super simple, but extremely convenient for those times when you are editing a lot of xml files in Android.
Rendering XML from a Grails Controller
I have been trying to render a simple XML file from a Grails Controller and I've found tons of blogs that provided the most complicated examples or examples that were too basic. After much tinkering around this is the code that will generate an XML file in the following format based on the items contained in the list.
<resultset>
<result>happy</result>
<result>sad</result>
<result>angry</result>
</resultset>
inside the Controller action...
def finalList = ['happy', 'sad', 'angry']
render(contentType: 'application/xml') {
resultSet(){
finalList.each { item ->
result(item)
}
}
}
Subscribe to:
Posts (Atom)


