<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Salih Yalçın on Medium]]></title>
        <description><![CDATA[Stories by Salih Yalçın on Medium]]></description>
        <link>https://medium.com/@salihyalcin?source=rss-9a86048dece7------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*DS7eM3ewtgDTeNEv244Kbg.png</url>
            <title>Stories by Salih Yalçın on Medium</title>
            <link>https://medium.com/@salihyalcin?source=rss-9a86048dece7------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 21:15:28 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@salihyalcin/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Custom Image Loader using Glide and What I learned.]]></title>
            <link>https://salihyalcin.medium.com/custom-image-loader-using-glide-and-what-i-learned-6a8685d35964?source=rss-9a86048dece7------2</link>
            <guid isPermaLink="false">https://medium.com/p/6a8685d35964</guid>
            <category><![CDATA[loader]]></category>
            <category><![CDATA[image]]></category>
            <category><![CDATA[custom]]></category>
            <category><![CDATA[glide]]></category>
            <category><![CDATA[android]]></category>
            <dc:creator><![CDATA[Salih Yalçın]]></dc:creator>
            <pubDate>Wed, 16 Jun 2021 09:28:06 GMT</pubDate>
            <atom:updated>2021-06-16T09:28:06.969Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wf7Dmi6XRfjifFSy2Dfumg.png" /><figcaption>Photo from: <a href="https://unsplash.com/@jupp?utm_source=unsplash-figma&amp;utm_medium=referral">Jonathan Kemper</a></figcaption></figure><p>This gonna be my very first English post related to Android Development. As a promise to myself, I will keep my medium account occupied with the problems that I spend my days but luckily solved. Because I believe that the more convenient way to learn is through writing. I have benefited from writing throughout my life. So, feel free to send me feedback.</p><p>Let’s get down to the business…</p><p>As a normal scenario, most image services are returning image links as an endpoint and you are good to use them thanks to an image loading library like <strong>Glide</strong> or <strong>Picasso</strong>. But what happens when you only got an image id for an image first? Then You need to get the image as soon as you got the id from the first response. I’ve tried the silly approach which is getting image URLs in the for loop, use them afterward as a suggested simple way. This was not the solution that I wanted and spend my 2 days solving this issue. When I feel lost, I decided to ask the <a href="https://www.gdgistanbul.com/">GDG Istanbul </a>slack group and <a href="https://medium.com/u/9d967fa37eb3">Hadi Tok</a> suggested a perfect way to implement a custom image loader using Glide or Picasso. Then I researched documentation and finally found a solution to my problem. Here is the journey;</p><p>The traditional way to load an image using glide library is depicted below;</p><pre>Glide.with(this).load(&quot;http://goo.gl/gEgYUd&quot;).into(imageView);</pre><p>In our case; we had an image service that is returning image ids and Base64 strings for the belonged image, as below;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/403/1*qafuPvRzP5wPAescN1ud4A.png" /><figcaption>Sample JSON result</figcaption></figure><p>It’s clear from the image that we must make another separate request to get the image’s Base64 String. In order to solve this issue, first I modified the Glide library’s load functionality. Here what I did;</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6809fa064493848f9cc9b71d065fd315/href">https://medium.com/media/6809fa064493848f9cc9b71d065fd315/href</a></iframe><p>In order to use Base64 Strings as an input, we have to extend our ModelLoader class using ByteBuffer. Besides images from a remote server, I’m also loading local images using Glide, and for that reason, I should have to say that if our model is starting with /data or /storage we should use a normal loading approach. That handle method appropriate for controlling input format.</p><p>The second step is creating ImageData Fetcher which is a class that returning our images as a Base64 encoded string according to its <strong>picture_id</strong>, the key point here is we have to define the data source remote. As soon as we got data then we need to use <strong>onDataReady</strong> method;</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c6f8fc736900135845af22c8cc72322c/href">https://medium.com/media/c6f8fc736900135845af22c8cc72322c/href</a></iframe><p>According to Glide library’s <a href="https://bumptech.github.io/glide/tut/custom-modelloader.html">documentation</a>, we may explain the cancel and cleanup model as below;</p><p><strong>cancel</strong></p><blockquote>For networking libraries or long running loads where cancellation is possible, it’s a good idea to implement the cancel() method. Doing so will help speed up other queued loads and will save some amount of CPU, memory, or other resources.</blockquote><blockquote>In our case, <a href="https://developer.android.com/reference/android/util/Base64.html">Base64</a> doesn’t offer a cancellation API, so we can leave it blank:</blockquote><p><strong>cleanup</strong></p><blockquote>cleanup() is an interesting one. If you’re loading an <a href="https://developer.android.com/reference/java/io/InputStream.html">InputStream</a> or opening any kind of I/O resources, you absolutely must close and clean up the InputStream or resource in the cleanup() method.</blockquote><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/eebb984833987f02ef8afe3c1f58151a/href">https://medium.com/media/eebb984833987f02ef8afe3c1f58151a/href</a></iframe><p>The third step is creating App-specific Glide module which is required in order to use our custom loader.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3ea3384f03e984644031404483707c0f/href">https://medium.com/media/3ea3384f03e984644031404483707c0f/href</a></iframe><p>In the code above, you may aware that we have <strong>ImageModelLoaderFactory</strong> class, this class is also required to load our <strong>ImageLoader</strong> class properly.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e6f8b37fb6de59fd8c99ac3795d9471b/href">https://medium.com/media/e6f8b37fb6de59fd8c99ac3795d9471b/href</a></iframe><p>Last but not least; in order to use all this functionality. We have to add Glide’s annotationProcessor as a dependency;</p><p>annotationProcessor &#39;com.github.bumptech.glide:compiler:4.11.0&#39;</p><p>That brings us to the end and we are able to load our images using Glide again. It’s depicted below that we are just giving pictured as a load parameter to Glide and it’ handles loading images background. That’s pretty much for solving this issue.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/462/1*4t0T6su0Ur2wDFbuaATUTQ.png" /></figure><p>What was the key things that I got from this issue;</p><ul><li>Reading documentation is saving a life, sometimes you are debugging more than one day and realize that the issue is not solvable, at the beginning If I had read the documentation carefully, maybe I should come across the solution.</li><li>It’s obvious that you should not act hesitant when asking questions in groups, communities, events…etc. Personally, I am avoiding asking questions in communities but I learned from this issue that every single question is directing you to another harbor.</li><li>Don’t even think complex, try to think simple and not try to solve problems using traditional way for example for loop like me😐</li></ul><p>If you have an amendment or something else feel free to ask me.</p><p>Thanks a lot.</p><h3>References</h3><ul><li><a href="https://github.com/bumptech/glide">https://github.com/bumptech/glid</a>e</li><li><a href="https://bumptech.github.io/glide/tut/custom-modelloader.html">https://bumptech.github.io/glide/tut/custom-modelloader.html</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6a8685d35964" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ArcGIS ile Karelaj Ağı Oluşturma]]></title>
            <link>https://medium.com/gisera/arcgis-ile-karelaj-a%C4%9F%C4%B1-olu%C5%9Fturma-f60f4129552b?source=rss-9a86048dece7------2</link>
            <guid isPermaLink="false">https://medium.com/p/f60f4129552b</guid>
            <category><![CDATA[harita]]></category>
            <category><![CDATA[gis]]></category>
            <category><![CDATA[karelaj]]></category>
            <category><![CDATA[cbs]]></category>
            <category><![CDATA[arcgis]]></category>
            <dc:creator><![CDATA[Salih Yalçın]]></dc:creator>
            <pubDate>Thu, 20 Dec 2018 13:32:00 GMT</pubDate>
            <atom:updated>2018-12-20T13:32:00.520Z</atom:updated>
            <content:encoded><![CDATA[<p>Merhabalar,</p><p>GISEra serisinde yazdığım ilk yazı olduğu için önce kendimi tanıtayım istedim. Harita Mühendisiyim, Android uygulama geliştiriyorum. Coğrafi bilgi teknolojilerine ilgi duyuyorum. Bu seride hem Android hem coğrafi bilgi sistemleri hem de bu teknolojilerin güncel teknolojilerle ilişkilerine dayanan yazılar olacak. Eh bize de elimizden geldiği kadar, dilimizin döndüğü kadar ifade etmek kalıyor :) İlk yazım daha önce yayınlanmış bir yazı olacak. Harita Mühendisleri için önem arz eden bir yazı.</p><p>Yazımıza gelecek olursak;</p><p>Pafta üretimi hiç şüphesiz yaptığımız ürünlerin sunumu, görselliği açısından biz Harita Mühendisleri için önemlidir. Öncelikle karelajı ne için yaparız bunun üzerinde durmak gerekli sanırım. Karelaj, kareleme sistemi olarak bilinir. Bu sistemde belirlediğimiz aralıklardaki değerler bir kareyi oluşturur. Araziye ait verileri sayısal ortama aktardığımızda hangi bölgede, hangi koordinat diliminde çalıştığımıza dair referans bir bilgi vererek çalışmalarımızda bize kolaylık sağlar.<br>Bu yazımda ArcGIS ile paftalama işleminde karelaj nasıl eklenir bunu kısaca anlatacağım.</p><p>Öncelikle oluşturduğumuz haritayı istediğimiz ölçekte ayarladıktan sonra Layout View kısmına geçiyoruz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/487/0*A9LLMG7qKtby-zqQ" /></figure><p>Daha sonra “Data Frame” kısmına sağ tıklayıp, “Properties” kısmından özellikleri açıyoruz.<br>Bu ekranda “Grids” menüsüne geliyoruz. New Grid’i seçtikten sonra 3 numaralı ekran geliyor .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/487/0*UvKOaqVJVGY-pBZh" /></figure><p>Bu ekranda <strong>Measured Grid : divides map into a grid of map units </strong>seçeneğini seçtikten sonra İleri diyoruz.</p><p>Grid’in ekranda karelaj şeklinde görünmesini istediğimiz için <strong>Tick Marks And Labes </strong>seçeneğini seçtikten sonra Style kısmından + işaretini seçiyoruz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/487/0*kOFc_gbFGt6ZkmB4" /></figure><p>Sonraki aşamalarda da karelaj aralığını belirledikten sonra işlemimizi tamamlamış oluyoruz.</p><p>Bir sonraki yazıda görüşmek üzere.</p><p>Not : Yazının orjinalini <a href="https://gislog.wordpress.com/2013/10/09/arcgis-ile-karelaj-agi-uretme/">bu siteden</a> okuyabilirsiniz.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f60f4129552b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/gisera/arcgis-ile-karelaj-a%C4%9F%C4%B1-olu%C5%9Fturma-f60f4129552b">ArcGIS ile Karelaj Ağı Oluşturma</a> was originally published in <a href="https://medium.com/gisera">GISEra</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>