Two page form question - saving data from first page

by doubleminus » Mon, 15 Jun 2009 04:32:13 GMT


Sponsored Links
 This is a general architectural question.

I want to offer a user a simple two page form. The first page will
have a few Spinners for the user to select options from. The second
page will have a series of EditTexts for the user to fill in. After
the second page, the user clicks a button to generate a text file
based on the values they have input.

My question is: What is the best way to handle preserving the data
from the spinners on the first page of the form, in order to place
them into the text file?

I feel like the "architecture" should be something like this:
1. User selects Spinner values on first page and clicks button to move
to next page of form..
2. Spinner values are placed in database
3. User fills in EditTexts on second page. Clicks button to generate
text file.
4. Database is queried for Spinner values, which are added to newly
created text file, then EditText values are added

Does this strategy make sense? Does anyone have advice on a better way
of handling the gathering of two pages of form input then using it to
create a text file?

The user would need to be able to flip back and forth between the form
pages as needed.

--~--~---------~--~----~------------~-------~--~----~



Two page form question - saving data from first page

by gjs » Mon, 15 Jun 2009 22:22:23 GMT


 Hi there,

You may need to save your data from the spinners earlier using the
various Listeners in order to cater for other events - eg press Home/
Back button, keyboard open/cose, phone rings etc - other than just
when user 'clicks button to move to next page'.

You can also save the data from spinners etc into application
Preference objects, these can also be used to persist (read & write)
data across app invocations.

Regards



--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Two page form question - saving data from first page

by doubleminus » Mon, 15 Jun 2009 22:53:51 GMT


 Ah. So I'll likely be using a listener of some sort or a app
Preference object - and not writing to the database?  Good to know.  I
hadn't thought of the obvious issues you've brought up (user moving
away from application then coming back).  The data does not need to be
preserved beyond the generation of the text file...but definitely does
need to persist until that file is created.




--~--~---------~--~----~------------~-------~--~----~



Two page form question - saving data from first page

by Doug » Wed, 17 Jun 2009 01:36:07 GMT


 Remember that your activity class has methods that are automatically
called when it is dropped and restored. All you need to do is
implement them.

On the original question of being able to pass page 1 data to page
2... just add a click listener to your 'next' button, in there create
the intent to display p2, and add the values you want to pass as
intent extras. Page 2 can then pull the values out of the intent at
its leisure.

Doug





--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. CheckedTextView and filtering of list not working well together

I have a list of checkable items and an EditText which I use to filter this 
list of items. If I check, say, the second item in the list and then filter 
the list by entering some text in the EditText, it will keep the second list 
item checked even though, after filtering, that might be a different item 
than was originally checked. What pattern should I use to be associating the 
checked state with the backing object rather than its index within the list?

Thanks
Lowell

-- 

2. How is your app selling on the Amazon Appstore?

Mine started out very slow, but has picked up some steam lately.  It's
still too few downloads to establish a pattern, but it's something for
nothing, so I can't complain.

How is your experience?

-- 

3. why can't draw text with OpenGL!!!

4. BitmapSize exceeds VM budget out of memory error

5. Missing packages

6. Android: Get Recently used Apps

7. car dock mode