• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Two questions

ondrovic

Newbie
First if I have this setup and want to only do something if debug is set to true how do I do it?
Code:
<bool name="debug">false</bool>

Second I want to setup a multidimensional array using a spinner that holds details and price per selection

example:
Code:
Name="Name of feature"
Price="Price of feature"
any ideas? Thanks
 
First if I have this setup and want to only do something if debug is set to true how do I do it?
Code:
<bool name="debug">false</bool>

Use the Java XML API in javax.xml.* to read in the file and use a XPath query to find the value of the bool node whose name attribute is debug. This would be an expensive operation, so only do it once and then cache the result.

Second I want to setup a multidimensional array using a spinner that holds details and price per selection

example:
Code:
Name="Name of feature"
Price="Price of feature"

I'll assume you've, at the very least, already gone through the Hello, Spinner tutorial.

You want some kind of SpinnerAdapter. You could implement one yourself directly by subclassing BaseAdapter. Alternatively transform your data so you can use one of the provided subclasses of BaseAdapter, such as ArrayAdapter.

(Ahh, [THREAD=470677]looks like[/THREAD] you'd already figured that out.)
 
Back
Top Bottom