TinyDB Android Shared Preferences Turbo Turkce

Overview

TinyDB--Android-Shared-Preferences-Turbo-Turkce

Bu sınıf, bir satır kod ile SharedPreferences çağrılarını ve daha fazlasını gerçekleştirmenizi sağlar. Örnek olarak: bir listeyi kaydetme , bir sayısal veriyi kaydetme veya bir resmi kaydetme ... Hepsini bu sınıf ile yapabilirsiniz!

Örnek kullanım:

TinyDB tinydb = new TinyDB(context);

//Veri tabanına veri göndermek
tinydb.putInt("clickCount", 2);
tinydb.putFloat("xPoint", 3.6f);
tinydb.putLong("userCount", 39832L);

tinydb.putString("userName", "John");
tinydb.putBoolean("isUserMale", true); 

tinydb.putList("MyUsers", mUsersArray);
tinydb.putImagePNG("DropBox/WorkImages", "MeAtlunch.png", lunchBitmap);

//Veri tabanından veri çekmek
int dataint = tinyDB.getInt("clickCount");
String datastring = tinyDB.getString("userName");
//Bunlara ek olarak ilgili 'get' yöntemlerinin tümü aynı mantıktadır

Bunlar ne kadar kolay kullanabileceğinize ait birkaç örnekti. Bu sınıfın içinde kullanabileceğiniz daha nice metot var.

Ayrıca nesne (Object) kaydı için de bu metodu kullanabilirsiniz:

tinydb.putObject(key, object);
tinydb.putListObject(key, objectsArray);

Nesne kayıt örneği:

usersWhoWon = new ArrayList(); ArrayList winnersObjects = new ArrayList(); for(Person p : usersWhoWon){ winnersObjects.add((Object)p); // ham(raw) nesne aktarımı(casting) } tinydb.putListObject("allWinners", winnersObjects);">
Person person = new Person("john", 24);
tinydb.putObject("user1", person); //nesneyi kaydetme
tinydb.getObject("user1", Person.class); // nesneyi hafızadan geri çekme

ArrayList<Person> usersWhoWon = new ArrayList<Person>();
ArrayList<Object> winnersObjects = new ArrayList<Object>();

for(Person p : usersWhoWon){
    winnersObjects.add((Object)p); // ham(raw) nesne aktarımı(casting)
}

tinydb.putListObject("allWinners", winnersObjects);

Kotlin kullanım örneği:

// TinyDB nesnesi oluşturma
var tinyDB : TinyDB = TinyDB(applicationContext)


// veriyi kaydetme
tinyDB.putString("nameKey", "John")

var winnerPerson : Person = Person()
tinyDB.putObject("winnerKey", winnerPerson);

// veriyi çekme
var personName : String  = tinyDB.getString("nameKey")
var winnerPerson : Person = tinyDB.getObject("winnerKey", Person::class.java)

Nesne kaydetme metodunu kullanmadan önce:

  1. Gson'u projenizdeki Gradle bölümüne aktarmalısınız:
dependencies {
  implementation 'com.google.code.gson:gson:2.8.8'
}
  1. TinyDB.java adlı sınıfınızdaki nesneleri kaydetme metotlarınında bulunan yorum satırı işaretlerini kaldırmalısınız, yorumlar şu satırlardadır : Line31, Line330, Line345, Line486

Kurulum

TinyDB.java dosyasını projenize Java Sınıfı olarak eklemeniz yeterlidir.

Uygulama geliştirmeyi öğrenmek mi istiyorsunuz?

Youtube kanalından kolayca öğrenebilirsiniz.

Note

This project is the developed and translated version of TinyDB--Android-Shared-Preferences-Turbo.

You might also like...
This is a demo android app representing implementation of SE principles in android app development

Articles Demo This repository contains a sample Android App that shows most popular articles data from NY Times API. This is a sample app that shows h

Android-Boilerplate - Base project for android development with new technology

Android-Boilerplate Base project for android development with new technology, in

Gits-android-extensions - A collection of Kotlin extensions to simplify Android development

gits-android-extensions A collection of Kotlin extensions to simplify Android de

Android Clean Architecture in Rorty is a sample project that presents modern, approach to Android application development using Kotlin and latest tech-stack.
Android Clean Architecture in Rorty is a sample project that presents modern, approach to Android application development using Kotlin and latest tech-stack.

Android Clean Architecture in Rorty is a sample project that presents modern, approach to Android application development using Kotlin and latest tech-stack.

Pleasant Android application development
Pleasant Android application development

⚠️ Anko is deprecated. Please see this page for more information. Anko is a Kotlin library which makes Android application development faster and easi

YouTube Player library for Android and Chromecast, stable and customizable.
YouTube Player library for Android and Chromecast, stable and customizable.

android-youtube-player android-youtube-player is a stable and customizable open source YouTube player for Android. It provides a simple View that can

A highly customizable calendar library for Android, powered by RecyclerView.
A highly customizable calendar library for Android, powered by RecyclerView.

CalendarView A highly customizable calendar library for Android, powered by RecyclerView. With this library, your calendar will look however you want

View
View "injection" library for Android.

Kotter Knife Deprecated: This was a terrible idea because it allocates an object for every view reference. Do not use, and do not use anything like it

Android library that creates app shortcuts from annotations
Android library that creates app shortcuts from annotations

Shortbread Android library that generates app shortcuts for activities and methods annotated with @Shortcut. No need to touch the manifest, create XML

Owner
Mehmet Abak
Mehmet Abak
Astha Nayak 4 Oct 10, 2022
Kotlin-dsl-sample - Preferences project on android

kotlin-dsl-example Sample preferences project on android. How to use val

null 1 Dec 30, 2021
Android Ptrace Inject for all ABIs and all APIs. Help you inject Shared Library on Android.

Android Ptrace Inject 中文可以参考我的注释内容进行理解 我写的注释相对来说比较全面了 How to build Make sure you have CMake and Ninja in your PATH Edit CMakeLists.txt. Set ANDROID_ND

SsageParuders 65 Dec 19, 2022
🍭 GithubSearchKMM - Github Repos Search - Android - iOS - Kotlin Multiplatform Mobile using Jetpack Compose, SwiftUI, FlowRedux, Coroutines Flow, Dagger Hilt, Koin Dependency Injection, shared KMP ViewModel, Clean Architecture

GithubSearchKMM Github Repos Search - Kotlin Multiplatform Mobile using Jetpack Compose, SwiftUI, FlowRedux, Coroutines Flow, Dagger Hilt, Koin Depend

Petrus Nguyễn Thái Học 50 Jan 7, 2023
D-KMP Architecture official sample: it uses a shared KMP ViewModel and Navigation for Compose and SwiftUI apps.

D-KMP architecture - official sample This is the official sample of the D-KMP architecture, presenting a simple master/detail app, for Android, iOS an

null 594 Jan 3, 2023
Clean MVVM with eliminating the usage of context from view models by introducing hilt for DI and sealed classes for displaying Errors in views using shared flows (one time event), and Stateflow for data

Clean ViewModel with Sealed Classes Following are the purposes of this repo Showing how you can remove the need of context in ViewModels. I. By using

Kashif Mehmood 22 Oct 26, 2022
Shared ViewModel in Kotlin Multiplatform

multiplatform-viewmodel ?? Create shared ViewModel's for shared business logic using our ViewModel base class. Features Uses Jetpack ViewModel on Andr

Double Symmetry 16 Nov 8, 2022
Android MVVM framework write in kotlin, develop Android has never been so fun.

KBinding 中文版 Android MVVM framework write in kotlin, base on anko, simple but powerful. It depends on my another project AutoAdapter(A library for sim

Benny 413 Dec 5, 2022
Klimatic is an android app built using Kotlin. It try to showcase all the latest technologies used in android.

Klimatic Klimatic is an android app built using Kotlin. It try to showcase all the latest technologies used in android. Built using Android Architectu

Shivam Satija 34 Oct 11, 2022
Oratio Library for Android Studio helps you simplify your Android TTS codes

Oratio Oratio is a library for Android Studio. This library is useful to a number of developers who are currently making apps using android TTS(Text-T

Jacob Lim 1 Oct 28, 2021