Android programming shows detailed examples of pictures on the network

This paper describes the method of Android programming to display pictures on the network. Share with you for your reference, as follows:

To display a picture on the network in Android, first find the picture address according to the URL, then convert the picture into Java InputStream, and then convert the InputStream stream into bitmap, which can be directly displayed in ImageView in Android. This is the idea of displaying pictures on the network, which is very simple to implement. Let's take a look at the implementation process.

First, at Android manifest Add access to the Internet to the program in XML:

Then add an ImageView to the layout file to display the pictures on the network:

Write the pictures obtained from the network in the activity of the main program, convert them into InputStream, and then convert them into bitmap that can be displayed in ImageView.

Then run the program to display the pictures on the network.

Operation effect:

PS: about androidmanifest For details of XML permission control, please refer to our online tools:

Description of Android manifest functions and permissions: http://tools.jb51.net/table/AndroidManifest

More readers interested in Android related content can view the special topics of this site: summary of Android graphics and image processing skills, introduction and advanced tutorial of Android development, summary of Android debugging skills and solutions to common problems, summary of Android multimedia operation skills (audio, video, recording, etc.), summary of Android basic component usage Summary of Android view skills, summary of Android layout skills and summary of Android control usage

I hope this article will help you in Android programming.

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