TOTALLY LOST AND CONFUSED

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
calculations).

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.

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



TOTALLY LOST AND CONFUSED

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 :)

Regards,
wahib




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


Sponsored Links


Other Threads

1. Motion Detection Use

Hi,

I was wondering if anybody knew if it is possible to track the speed
the phone is moving using the motion sensors. I've researched a bit
into how to calculate data from it but I was wondering if it is
possible to check say how fast the person holding the phone is moving,
and if they speed up or slow down?

or can it be used to determine the direction the phone is moving? I no
gps can do this but for the project I have in mind it would need to be
alot more accurate.
--~--~---------~--~----~------------~-------~--~----~

2. How to install plugins into Android's browser

Hi all.

I have the next problem:

I have an NP API plugin for Android's browser, it works properly. I
have to go to the command line and to input some commands of copy
plugin's so file into emulator (with help of adb) for installing it.
However, for end user it is too complicated to input this commands.

How can I prepare installer for my native plugin?
--~--~---------~--~----~------------~-------~--~----~

3. diff label for icon and searchable item text.

4. Fast test for internet connectivity

5. Hola

6. Video problem - How to use a surface for both canvas and mediaplayer

7. can anybody tell pls....