{\rtf1\ansi\ansicpg936\cocoartf1187\cocoasubrtf340 {\fonttbl\f0\fnil\fcharset0 Tahoma;\f1\fnil\fcharset134 STHeitiSC-Light;\f2\fnil\fcharset0 Monaco; } {\colortbl;\red255\green255\blue255;\red38\green38\blue38;\red127\green0\blue85;\red64\green0\blue200; \red42\green0\blue255;} \margl1440\margr1440\vieww10800\viewh8400\viewkind0 \deftab720 \pard\pardeftab720 \f0\fs24 \cf2 Android \f1 \'ca\'d6\'bb\'fa\'cd\'a8\'b9\'fd \f0 Java Servlet \f1 \'cd\'f8\'d2\'b3\'b7\'fe\'ce\'f1\'c6\'f7\'b7\'c3\'ce\'ca \f0 MySQL \f1 \'ca\'fd\'be\'dd\'bf\'e2\'b5\'c4\'ca\'be\'c0\'fd\'b3\'cc\'d0\'f2\'a1\'a3\ \'b0\'fc\'c0\'a8\'c1\'bd\'b2\'bf\'b7\'d6\'a3\'ba\ \f0 \ 1. Android \f1 \'b6\'cb\'b9\'a6\'c4\'dc\'a3\'ba\ 1\'a3\'a9\'cf\'ec\'d3\'a6\'d3\'c3\'bb\'a7\'ca\'e4\'c8\'eb\'a3\'ac\'bd\'ab\'ca\'e4\'c8\'eb\'d0\'c5\'cf\'a2\'b4\'f2\'b0\'fc\'b3\'c9 \f0 Json \f1 \'b8\'f1\'ca\'bd\'a3\'ac\'b7\'a2\'cb\'cd \f0 HttpRequest \f1 \'b5\'bd \f0 web \f1 \'b7\'fe\'ce\'f1\'c6\'f7\'a3\'ac\'b8\'f9\'be\'dd\'b7\'fe\'ce\'f1\'c6\'f7\'b7\'b5\'bb\'d8\'b5\'c4\'bd\'e1\'b9\'fb\'a3\'ac\'cf\'d4\'ca\'be\'b2\'e9\'d1\'af\'d0\'c5\'cf\'a2\'a1\'a3 \f0 \ 2 \f1 \'a3\'a9\'d3\'c9\'d3\'c3\'bb\'a7\'ca\'e4\'c8\'eb\'d2\'aa\'c9\'cf\'b4\'ab\'b5\'bd\'ca\'fd\'be\'dd\'bf\'e2\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\'fbroot, \'c3\'dc\'c2\'ebroot\'a3\'ac\'c6\'e4\'d6\'d0\'ca\'fd\'be\'dd\'cf\'ee\'b8\'f1\'ca\'bd\'ce\'aa\'a3\'ba \ \pard\pardeftab720 \f2\fs22 \cf0 \ \pard\pardeftab720 \cf3 create\cf0 \cf3 table\cf0 users(\ id \cf4 int\cf0 \cf3 primary\cf0 \cf3 key\cf0 AUTO_INCREMENT,\ userName \cf3 varchar\cf0 (20),\ userAge tinyint,\ userSex \cf3 varchar\cf0 (4)\ );\ \ \pard\pardeftab720 \f0\fs24 \cf2 2). \f1 \'d4\'cb\'d0\'d0\'c7\'b0\'d0\'e8\'d2\'aa\'d4\'da \f0 client \f1 \'b3\'cc\'d0\'f2\'d6\'d0\'d0\'de\'b8\'c4web\'b7\'fe\'ce\'f1\'c6\'f7\'b5\'d8\'d6\'b7\'a3\'ba\ \'c0\'fd\'c8\'e7\'a3\'ba\'c8\'e7\'b9\'fb \f2\fs22 \cf5 101.6.99.79 \f1 \'ca\'c7web\'b7\'fe\'ce\'f1\'c6\'f7\'b5\'c4\'b5\'d8\'d6\'b7\'a3\'ac\'d0\'e8\'d0\'de\'b8\'c499\'ba\'cd145\'d0\'d0\'ce\'aa\'a3\'ba \f0\fs24 \cf2 \ \pard\pardeftab720 \f2\fs22 \cf5 "http://101.6.99.79:8080/ServerJsonDemo/servlet/JsonServlet"\cf0 ; \f0\fs24 \cf2 \ }