Android imitates Sina Weibo to publish microblog interface design (5)

This tutorial shares the specific code of Android's functions such as publishing microblog and adding expression for your reference. The specific contents are as follows

Publish a new microblog interface: http://open.weibo.com/wiki/2/statuses/update Upload pictures and post a new microblog interface: http://open.weibo.com/wiki/2/statuses/upload

1. Select the corresponding interface according to whether there are pictures. 2. Judge the number of words according to the change of the input box. 3. Create a girlview to display up to 9 sent pictures. Here, due to the request parameters, upload up to one picture. When multiple pictures are selected, upload the last picture. (only one picture can be uploaded to the official demo and multiple demos on the network. If there is an official who can upload multiple pictures, please be sure to contact me!) 4. Implementation of display expression: traverse the text content with regular expression, obtain the content consistent with the expression, and display the expression picture in textview with spannablestring. 5. Implementation of expression panel: create a GridView that displays expressions, group expressions into it, listen to GridView click events, and input the expression display into EditText. For the implementation of specific expression functions, please refer to: https://www.oudahe.com/p/27351/ 5. The number of words, expressions and pictures finally sent depends on the state of each parameter when the button is triggered. 6. Delete the selected picture, get its location, use imageitem. Remove (position) and then remove it from the ArrayList.

The method of publishing microblog is located in tools.java. Since the uploaded data adopts multipart / form data encoding, the third-party httptmime.jar package is introduced here to process the request parameters.

design sketch:

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
分享
二维码
< <上一篇
下一篇>>