<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>android studio shared preferences - hknsoft</title>
	<atom:link href="https://hknsoft.com/etiket/android-studio-shared-preferences/feed/" rel="self" type="application/rss+xml" />
	<link></link>
	<description>Android, Yazılım, Script</description>
	<lastBuildDate>Sat, 13 Mar 2021 11:16:55 +0000</lastBuildDate>
	<language>tr</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://hknsoft.com/wp-content/uploads/2020/05/cropped-icon-hknsoft-150x150.png</url>
	<title>android studio shared preferences - hknsoft</title>
	<link></link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Android Studio SharedPreferences Kullanımı</title>
		<link>https://hknsoft.com/android-studio-sharedpreferences-kullanimi/</link>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Sat, 13 Mar 2021 11:13:23 +0000</pubDate>
				<category><![CDATA[Android Studio]]></category>
		<category><![CDATA[android shared preferences]]></category>
		<category><![CDATA[android shared preferences kullanimi]]></category>
		<category><![CDATA[android studio]]></category>
		<category><![CDATA[android studio shared preferences]]></category>
		<category><![CDATA[android studio sharedpreferences kullanimi]]></category>
		<category><![CDATA[android veri çekme]]></category>
		<category><![CDATA[android veri kaydetme]]></category>
		<category><![CDATA[sharedpreferences kullanimi]]></category>
		<guid isPermaLink="false">https://hknsoft.com/?p=1057</guid>

					<description><![CDATA[<p>Uygulamanızda uygulama kapatılsa bile bazı verileri saklamak isteyebilirsiniz. Küçük verileri saklamak için SharedPreferences kullanmak mantıklı olacaktır. SharedPreferences ile int, float, string, boolean, long tipinde veriler <a class="mh-excerpt-more" href="https://hknsoft.com/android-studio-sharedpreferences-kullanimi/" title="Android Studio SharedPreferences Kullanımı">[...]</a></p>
<p>The post <a href="https://hknsoft.com/android-studio-sharedpreferences-kullanimi/">Android Studio SharedPreferences Kullanımı</a> appeared first on <a href="https://hknsoft.com">hknsoft</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="has-black-color has-text-color">Uygulamanızda uygulama kapatılsa bile bazı <strong>verileri saklamak</strong> isteyebilirsiniz. Küçük verileri saklamak için <a href="https://hknsoft.com/android-studio-sharedpreferences-kullanimi/"><strong>SharedPreferences</strong></a> kullanmak mantıklı olacaktır. SharedPreferences ile <strong>int, float, string, boolean, long</strong> tipinde veriler tutabilirsiniz.</p>



<h2 class="wp-block-heading"><strong>SharedPreferences Veri Kaydetmek</strong></h2>



<p><strong>putInt, putString vb.</strong> sonra gelen <strong>&#8220;&#8230;&#8221; içerisine key yazılır.</strong> Yani bu key (ad) ile kaydediyoruz. Daha sonra ise bu <strong>key</strong> ile çağıracağız. Tutmak istediğimiz veriyi ise aşağıda gördüğünüz gibi <strong>(50, String Veri, isChecked bunlar tutulan verilerdir)</strong> virgülden sonraki yere yazıyoruz.</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag">SharedPreferences sharedPref = this.getPreferences(Context.MODE_PRIVATE);
SharedPreferences.Editor editor = sharedPref.edit(); 
editor.putInt("int", 50); //int
editor.putString("string", "String Veri"); //string
editor.putBoolean("bool", isChecked); //boolean
editor.commit();</pre></div>



<h2 class="wp-block-heading"><strong>SharedPreferences Veri Çekmek</strong></h2>



<p>Verileri çekmek için de aşağıdaki kodu kullanmalısınız. Kaydettiğiniz verileri <strong>keyleri</strong> yazarak çekebilirsiniz (örn: int, string, bool). Virgülden sonraki kısım <strong>default value</strong> olarak adlandirilir. Eğer bu <strong>keye bir veri kaydedilmemiş</strong> ise default value gösterilir.</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag">SharedPreferences sharedPref = getSharedPreferences("sharedPref", Context.MODE_PRIVATE);
int intValue = sharedPref.getInt("int", 0);
String stringValue = sharedPref.getString("string", "Bos");
Boolean booleanValue = sharedPref.getBoolean("bool", false);</pre></div>



<p class="has-black-color has-text-color"><strong>SharedPreferences</strong> ile yukarida anlatıldığı gibi <strong>farklı activity&#8217;lerden</strong> veri kaydedip/çekebilirsiniz. Android&#8217;de <strong>en kolay yöntem budur.</strong> Eğer daha büyük veriler saklamak istiyorsanız <a href="https://ayselaydin.medium.com/android-sqlite-kullan%C4%B1m%C4%B1-1477a89fc0ad" target="_blank" rel="noreferrer noopener nofollow" class="broken_link"><strong>SQLite</strong></a> konusunu araştırabilirsiniz.</p>
<p>The post <a href="https://hknsoft.com/android-studio-sharedpreferences-kullanimi/">Android Studio SharedPreferences Kullanımı</a> appeared first on <a href="https://hknsoft.com">hknsoft</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
