Android uses retrofit2.0 technology to imitate wechat

Recently, the project has been completed and I have leisure time. I have always wanted to make a case similar to wechat in wechat, which can not only take photos, select an image library and upload multiple patterns. At present, many apps have functions similar to wechat circle of friends, and can upload pictures by publishing and talking. The following is the process of realizing this function: you haven't seen the article "Android retro 2.0 framework upload picture solution" (processing of one or more pictures). It's easy to read today. Then in this project, we use a library: photopicker, which encapsulates the function of selecting pictures, whether to select cameras, and the function of viewing pictures after selecting pictures.

1、 First: add the photopicker to the project

(1) First, briefly explain the usage of photopickerintent:

(2) After setting, override the onactivityresult method to process the selected picture and preview the loading adapter

2、 Focus on gridadapter

1. Add a picture in the picture path by default to call the image library imagepaths. Add ("000000");

2. Judge the selected picture according to the path. If more than 6, the default path is removed from the collection.

3、 Upload management class

4、 Project code

5、 Spring MVC receives the action of the file

6、 Struts 2 receive file

Project download address: https://github.com/lidong1665/Android-UploadMultipartImage

design sketch:

@H_ 301_ 82@

@H_ 301_ 82@

@H_ 301_ 82@

The above is the whole content of this article. I hope it will be helpful to your study, and I hope you can support programming tips.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>