What is the laziest method to get JPEG from url and get it to use in my app? I would like to achieve it without any new libraries to my project.
Sincerely, Peter.
URL webUrl = new URL("https://cdn2.iconfinder.com/data/icons/windows-8-metro-style/512/cool.png");
URLConnection connection = webUrl.openConnection();
Bitmap bitmap = BitmapFactory.decodeStream(connection.getInputStream());
but beware you can't run this code on UI Thread
, it should be done on Thread
or AsyncTask
You can also use ImageLoader
For more details , you can visit this post ImageLoader