Page 331 -
P. 331

manage your data


           Use a form or dialog to accept input





                                                                              ...or if you are on
               Simply use the standard                                        your phone, a call to
               <FORM> and <INPUT> tags                                        the “dialogGetInput()”
               within your HTML web page to                                   function will do the trick.
               get input from your users...

































           On the Web, your user interacts with your web form and enters data. When
           she presses the submit button, the web browser gathers up all of the form’s
           data and sends it to the web server as part of  the web request.
           On your Android phone, you can use the dialogGetInput() method to
           get input from the user, then mimic the behavior of the web form’s submit       Here’s where the
           button in code.                                                                 data is included
                                                                                          with the web
           In fact, you’ve done this already: check out this line of code from your       request.
           coachapp.py app, which sends the selected athlete name to your web
           server:


              athlete = json.loads(send_to_server(web_server + get_data_cgi, {'which_athlete': which_athlete}))



                                                                                      you are here 4    295
   326   327   328   329   330   331   332   333   334   335   336