Setting imageview in android

前端 未结 3 485
孤街浪徒
孤街浪徒 2020-12-22 05:26

I have a JSON URL :: http://54.218.73.244:7006/DescriptionSortedRating/

JSON STRUCT::

\"restaurants\": [
    {
      \"         


        
相关标签:
3条回答
  • 2020-12-22 05:38

    try this

    1. Download AndroidQuery jar from here.

    2. Put this jar to your libs folder and right click on jar and Build Path -> Add to bulid path

    3. How to use see this example

      AQuery androidQuery = new AQuery(this); // make AndroidQuery object 
      
      androidQuery.id(yourImageView).image(imageUrl, isCacheUrlImageOnMemery, isCacheUrlImageOnFile); //  use this way 
      
      isCacheUrlImageOnMemery - if true then given url image cahce on memery so after word android query check is given url image cahce on either memery or file then it take from cahce other wise it try to getting from url 
      
      isCacheUrlImageOnFile - same like isCacheUrlImageOnMemery but first of all android query check on memery then file in case if we have not much of memery then we cahce on file tht y two option are available.
      
    0 讨论(0)
  • 2020-12-22 05:40

    You can set your Image using ImageLoader...

    Create instance of ImageLoader globally like..

      ImageLoader imageLoader;
        @Override
        protected void onCreate(Bundle savedInstanceState) {
               ......
               imageLoader=new  ImageLoader(ClassName.this);
    
    
                ImageView imageView = (ImageView) findViewById(R.id.DISP_IMG);
               ......
                imageLoader.DisplayImage(YourImageURLHere,imageView);
    
    0 讨论(0)
  • 2020-12-22 06:05

    you can use this library to load your image from URL: https://github.com/shaunidiot/AndroidTutorial/tree/master/ionimagetest/bin

    refer to this tutorial video of how to do it: http://www.youtube.com/watch?v=zwR44n54-bk

    This library will do all the asyncTask process to load and view the image and you can also use placeholder image if the image from the URL is deleted or not available

    0 讨论(0)
提交回复
热议问题