Android enables wechat to share web pages with thumbnails

preface

Recently made a web app, which needs wechat sharing.

The requirement is to share web pages with pictures, and the pictures are not local, which is a bit of a pit,

That is to say, the pictures should be obtained in real time from the network and synchronized. If they are asynchronous, they still need to wait (the user experience is not good)

The code is as follows

code analysis

Network images are loaded according to business requirements, and they still need to be loaded synchronously, so I use imageloader.

The loading picture code is as follows:

Loadimagesync is a synchronous loading method and an asynchronous loading method.

Because wechat restricts the size of shared pictures, we also need to create thumbnails, otherwise an error will be reported (checkargs fail, thumbdata is invalid)

The source code of wechat inspection parameters is as follows

The code for creating thumbnails is as follows:

The above is what Xiaobian introduced to you. Android realizes wechat to share web pages with thumbnails. I hope it will help you. If you have any questions, please leave me a message, and Xiaobian will reply to you in time. Thank you very much for your support for the programming tips website!

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