2

i tried to use the androidSVG (https://bigbadaboom.github.io/androidsvg/ ), Glide (https://github.com/bumptech/glide/tree/v3.6.0/samples/svg/src/main/java/com/bumptech/svgsample/app) libraries for displaying the flag of countries from this api : https://restcountries.eu/rest/v2/allfields=name;capital;population;flag;region but it didn't work !

StringRequest stringRequest = new StringRequest("https://restcountries.eu/data/ata.svg",new Response.Listener<String>() {
            @Override
            public void onResponse(String response) {
                try {
                    SVG svg = SVG.getFromString(response);

                    ImageView ig_countries_ = (ImageView) findViewById(R.id.ig1);
                    Glide.with(getApplicationContext()).load(svg).into(ig_countries_);

                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        },new Response.ErrorListener() {
            @Override
            public void onErrorResponse(VolleyError error) {
            }
        });
        RequestQueue queue = Volley.newRequestQueue(this);
        stringRequest.setShouldCache(true);
        queue.add(stringRequest);
Ege Kuzubasioglu
  • 5,991
  • 12
  • 49
  • 85
Hamza Slama
  • 116
  • 8
  • 1
    Can you please post the code? – 10101010 Jan 16 '18 at 15:29
  • i work with volley library for parsing data (for all the string attribute i can parse it properly , but i can't parse the svg image ). – Hamza Slama Jan 16 '18 at 15:48
  • https://stackoverflow.com/a/35508121/6683139 – Ege Kuzubasioglu Jan 16 '18 at 15:56
  • it look like it doesnt know the ".using (Glide.buildStreamModelLoader .. the classes : SvgDrawableTranscoder , FileToStreamDecoder , SvgDecoder , SvgSoftwareLayerSetter and the " .diskCacheStrategy(DiskCacheStrategy.SOURCE) " . https://imgur.com/PnkShsU – Hamza Slama Jan 16 '18 at 16:09

0 Answers0