Football Fans: Download the 2012 Schedule App from Google Play!


Go Back   Android Forums > Android Development > Application Development > Developer 101

Developer 101 101 Tutorials



Reply
 
LinkBack Thread Tools
Old December 25th, 2011, 09:23 PM   #1 (permalink)
Junior Member
 
ondrovic's Avatar
 
Join Date: Dec 2011
Location: Carmel, Indiana
Posts: 42
 
Device(s): Droid Charge
Thanks: 7
Thanked 1 Time in 1 Post
ondrovic@gmail.com
Default Two questions

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

ondrovic is offline  
Reply With Quote
Sponsors
Old December 30th, 2011, 04:54 PM   #2 (permalink)
Premium Member
 
Join Date: Oct 2011
Location: Sydney, Australia
Posts: 193
 
Device(s): Galaxy Nexus GSM
Thanks: 2
Thanked 37 Times in 33 Posts
Default

Quote:
Originally Posted by ondrovic View Post
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.

Quote:
Originally Posted by ondrovic View Post
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, looks like you'd already figured that out.)
jiminaus is offline  
Last edited by jiminaus; December 30th, 2011 at 04:56 PM.
Reply With Quote
The Following User Says Thank You to jiminaus For This Useful Post:
ondrovic (December 30th, 2011)
Reply

Bookmarks


Go Back   Android Forums > Android Development > Application Development > Developer 101 User CP
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -5. The time now is 08:20 PM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Custom vBulletin Skins by: Relivo