Recently, I am working on pushing data, but I have spent a lot of effort !!!
I am working on Android and have never worked on practical J2EE projects before, so it is really a waste of effort. During the study, I encountered a lot of questions and asked others, but few people can help you, and it is a headache to solve the problem. In this record, let's avoid detours !!!! Adding implementation and Configuration modification takes a week.
1,Understanding about androidpn
(1) first, androidpn is based on XMPP and is currently popular for pushing, because it has the source code of the client and server:
: The entire server, client project, and demo (not all points need to be downloaded, small PS: There is a browse all files link at the bottom of the Download button ), I will provide the 115 Network Disk later.
115> service version 115> Client Version
2,Initial deployment
(1) decompress the server, which has the bin directory and runs run. bat. Access: http: // 127.0.0.1: 7070/index. Do will start.
(2) import the client code to eclipse and modify androidpn. the xmpphost in the properties file is xmpphost = 10.0.2.2 (if you want to access it on the simulator, if you want to access it on the LAN, write the server address ). In fact, this is basically the end.
(3) whether the remaining tests are pushed normally:
Run the client. The server sends a message, and the client can correctly receive the message, proving that the communication is normal. Deployment is complete. If you have completed the above operations, you will use it.
3Download Tomcat server code for deployment
(1) download the androidpn server code of Tomcat. 115> Tomcat server Source Code
(2) There is no error when importing the project into myeclipse. OK. Let's run it. There are a lot of errors in the result. If it is a major start error.
This error message is not imported into a jar package, that is, the servlet-api.jar, here I give it to everyone, we import libs, it is OK, don't forget to build path
115> Servlet-api.jar
Note: My myeclipse version is 6.5. It would be better if there is no import error, haha
(3) The next step is to configure mysql. I have installed and reinstalled everything (no myeclipse environment has been installed before). There are a lot of web sites. You can search for them. Note: be sure to remember your account and password !!!!!!!!
In this case, a JDBC. properites file under the resources directory is opened.
Jdbcurl = JDBC: mysql: // localhost/android? Useunicode = true & characterencoding = UTF-8 & zerodatetimebehavior = converttonull
Here the android is the database name created in MySQL, MySQL instructions on the operation, we look at the http://see.xidian.edu.cn/cpp/u/mysql_ml/
And
Jdbcusername = root
Jdbcpassword =
Here is the username and password of MySQL that you remember above. It will be used for MySQL operations later!
All the major problems are solved, so that you can run them.
(4) When it can run, you can make drastic changes based on your project needs.
Pure original> http://blog.csdn.net/js931178805/article/details/7767859