by Rc3375 » Mon, 21 Sep 2009 01:30:46 GMT

Sponsored Links
 hi everyone--
got questions about android.....
the MAIN.XML screen has the following items in this order:
1.  TextView01
2.  EditText (called gF)
3.  EditText (called fF)
4.  EditText (called sF)
5.  EditText (called ttlF)
6.  EditText (called nF)
and at the bottom of the screen, a botton called cB(that performs the

i need to be able to READ and check if the user has entered a valid
input into the first  field(gF).  such as a double value/float value
within a given range( greater than 1.01 and less than 99.98). this
should not be an integer.  if that number is not within that range,
change the TextView01(string) informing the user what that range
should be(i.e "Please enter a value between 1.00 and 99.99").  pause
xx seconds, and restore the original text to TextView01.

if  gF is within the allowed range, button cB would/should be ENABLED,
the user presses it,   the fields(EditText(3 thru 6) would be
calculated and filled in with whatever those values come out to be.

i have not been able to figure out how to READ what the user entered
into field(gF), how to PLACE/ASSIGN those values to fields 3-6(once
the calculations are done), how to get the calculation portion to fire
up, validate a range, OR change a TextView01(string).

i am at a COMPLETE loss.  can/would anyone be able to help me?  thank
all of you for your kind attention.  rc3375.



by wahib haq » Mon, 21 Sep 2009 03:32:04 GMT

 Hi !! Reading and writing to a EditText widget is simple. For reading
text use gF.gettext() and if you want to convert to string then use
gF.gettext().tostring(). Else for writing to a edittext use
sF.settext() function.
I am also a newbie so not clear how to automatically call the validate
function when you move from gF to next textbox but up to my knowledge
you need to code the validation criteria in  the lostfocus() function
of gF edittext. Once done its simple. If validation fails than display
error using 'AlertDialog' object and set up a message you want to
display. Search for it or else i'll send you a example code.

correct me if you find anything wrong :)



Sponsored Links

Other Threads

1. Load xml from a url instead of R?

Not an expert but my understanding is that the XML files are used for design
of the UI and are built into the app when you compile it.

If you did want to do this however, you would probably have to grab the XML
data from the server and then parse it yourself and build the UI based on
the data using Android API calls.

Sounds like a lot of work but if you wrote it generically you could use it
all over the place without changes.




2. Google Analytics : 403 Forbidden => Has anyone downloaded the jar ?

Hi there !

According to this page :

=> We should be able to integrate our Android apps with Google
Analytics. I know Flurry does this, but I like the idea of having all
my stats in the same place.

However, when I go try to reach
, I get a 403 Forbidden.

So... no way to download / test it.

Has anyone any info concerning this ? Was it one day open, and then
closed ? Or if anyone has downloaded it previously, could you be kind
enough to set up a mirror ;-) ?

I didn't even know that Google Code projects could have restricted
access... Open Source, huh ?



3. Please help me to choose Android Phones (For Android development)

4. Camera and Surface problems with 1.6

5. Extremely slow Android SDK download (5 kB/sec)

6. How to display Options Menu Vertically

7. Dialog management by Activities