Eclipse ADT
Configure AVD
1.layout layout: XML
such as Ck_report.xml <text view ... android:id= "CK" >
<imageview...android:id= "@+id/con1" >
Con1 is a picture, put in the Res/drawable folder
2. In Src, write the Activity.java file to manipulate the pages of the XML layout.
Each Activity.java file is required to register,<activity> and </activity> tags in androidmanifest.xml (System manifest configuration).
C_reportactivity: No login, jump login interface, logged in, get local Uphone (identify the user according to Uphone), Uphon data from the database, and then the data list display, click, call Chosenpdf Open the downloaded picture.
After getting uphone locally, convert to JSON object, Requestjson, then Responsejson=httputil.dopost ("C_reportservlet", Requestjson)
Specifying path parameters
Method of Httpresquest Dopost (String url,string jsonstr)
Return Responsejson to the C_result_reportdto class, and then remove it from the c_result_reportdto and put it in c_reportactivity.
Front Desk Summary:
Androidmanifest.xml: Registered a layout interface, Ck_report.xml. Complete the local acquisition of the Uphone number, submit to the server, the server queries the database and retrieve the database of registered information, such as the date, check items, check the consulting office and so on.
Client file established in SRC
Activity:c_reportActivity.java
Jsondto:c_reportdto.java and C_result_reportdto.java
Service:c_reportservice.java
Util:httputil.java
C_reportactivity to Ck_report.xml operation, take out Uphone, Uphone call Service,service will uphone with c_reportdto packaging, by calling Httputil (URL, Parameters- Uphone after wrapping), returns a JSON-formatted response object that takes the JSON out into the C_result_reportdto.java. C_reportactivity get c_result_repprtdto into the corresponding location of XML.
Server Summary:
Server file Servlet:c_reportservlet.java
Service:c_reportservice.java
Jdbcutil.java
JsonDTO:c_reportdto.java and C_result_reportdto.java
After the client service calls the server Servlet:c_reportservlet.java, the Requestjson parameter is accepted, the method Reportservice is called C_reportservice, the Requestjson is passed in, The service uses the C_reportdto form of request to load JDBC to get
C_result_reportdto (i.e. resjsonstr), return to Servlet,servlet using Response object, Printwrite out=response.getwrite (); Out.write (RESJSONSTR) returns to the client.
Hospital Android Project Summary