Android Sharedpreferences tutorial | how to use shared preferences android studio |sharedpreferences

Поделиться
HTML-код
  • Опубликовано: 12 апр 2020
  • In this tutorial we will learn, How to use Shared Preferences in our android application to store data in the form of key-value pair..
    -what is sharedpreferences in android?
    Ans : Android provides many ways of storing data of an application. One of this way is called Shared Preferences. Shared Preferences allow you to save and retrieve data in the form of key,value pair.
    #AndroidStudioTutorial #Sharedpreferences #Android #AndroidStudio #Codingwithdev
    Follow Facebook Page Link - / coding-with-dev-101018...
    Follow Instagram Link - / codingwithdev
    For Bussiness Inquiries
    -codingwithdev@gmail.com
    -devendrac706@gmail.com
    Subscribe My Channel #codingwitdev for more latest videos..
    / codingwithdev
    Thank You :-)

Комментарии • 44

  • @salaradosnica542
    @salaradosnica542 3 года назад +7

    I tried 4-5 methods of Shared Preferences and lost two days until I find across something like this simple and Great!!!.
    Congratulations

  • @alfonsomoreno6888
    @alfonsomoreno6888 9 месяцев назад +2

    Muchas gracias bro, me sirvio bastante

  • @lucianrekkless418
    @lucianrekkless418 3 года назад +2

    Thanks a lot man! As always very clear and constructed tutorial. Can you also create a video about using a new jetpack dataStore in Java for login session (storing user acount details)?

  • @dunraksmey6083
    @dunraksmey6083 3 года назад

    I Love of your work is done without getting me any doubts.

    • @CodingwithDev
      @CodingwithDev  3 года назад +1

      @Dun Raksmey , Thank You so much for your valuable response :-)

  • @jyotichavan9051
    @jyotichavan9051 4 года назад

    It's helpful tutorial

  • @Siddharth-rs1ge
    @Siddharth-rs1ge 2 года назад +1

    Work is done without any doubts bro. 🙏

  • @arvind_chavan
    @arvind_chavan 4 года назад +3

    These was Great!!! Keep Doing Broo

    • @CodingwithDev
      @CodingwithDev  4 года назад +1

      Thank you so much for ur valuable response

  • @spyro2008
    @spyro2008 Год назад +1

    Thanks a lot!!!

  • @rohitbhardwaj8775
    @rohitbhardwaj8775 Год назад

    Everything is running good. When I launch the app and input name and id. I click on save button. There is no display of my name and email id on Welcome page?

  • @zolajigar5659
    @zolajigar5659 2 года назад +1

    ❤️

  • @woonie3134
    @woonie3134 3 года назад

    Sir how can I change the text field after I saved? Let us say I made typo on my name and want to change .. how I edit

  • @idroid_pe
    @idroid_pe 4 года назад +2

    Excellent but can you make a video about how to pass data from ActivityA to FragmentA?. The fragmentA is in ActivityB. Thanks in advanced.

    • @CodingwithDev
      @CodingwithDev  4 года назад +2

      @IDroid , Thank you so much for ur valuable response , i will try to make this tutorial in future...

  • @DailyEmirs
    @DailyEmirs 2 года назад

    Great Video! I have the issue here when i force stop the app, it does not save the last activity and returned to login. It shown error Reading a NULL string not supported here.

  • @dillirajgautam4348
    @dillirajgautam4348 2 года назад +1

    helpful

  • @code_luke
    @code_luke 3 месяца назад

    Hi friend! I'm beginner. Is a good practice do it? You create 3 static final variables in all Activities(MainActivity & HomeActivity).

  • @rajatsonu01
    @rajatsonu01 2 года назад +1

    Thanks a lot bro.

    • @CodingwithDev
      @CodingwithDev  2 года назад

      @rajat , thank u for the valuable response 😊

  • @elderibanez4649
    @elderibanez4649 8 месяцев назад

    sos un capo

  • @ErWayneCrafter
    @ErWayneCrafter 2 года назад

    Does the texts in the second page does not disappear even though I close the app and reopen it?

  • @differentgaming8378
    @differentgaming8378 2 года назад

    Iam stucked in a problem, I have designed 10 level quiz, it should be like 1st level unlock and reamaining should be locked. And when 1st level completed, the second level should be unlocked. And if I complete 5 levels and exit the apo, and when I open again, I should be in 6th level, please help me.

  • @viraj_hole
    @viraj_hole 2 года назад

    thank you so much sir ❤

  • @susanoo0217
    @susanoo0217 Год назад

    but how to change boolean value from another activity? help please

  • @luis28052
    @luis28052 3 года назад

    The information of the first activity is not deleted, how strange

  • @ManojKumar-tz3sd
    @ManojKumar-tz3sd 3 года назад

    I am not able to get the string value in home layout..can any one help me

  • @redwansharafatkabir9644
    @redwansharafatkabir9644 3 года назад

    Can I pass the data in the same way to another application ?

  • @codethrusharing8955
    @codethrusharing8955 2 года назад

    you stop making videos?

  • @coffeemachines
    @coffeemachines 3 года назад

    very nice tutorial sir worked like charm. but i have problem when i click logout, its sometime take us to login page and sometime exit the application. how to fix this??

    • @CodingwithDev
      @CodingwithDev  3 года назад

      Please cross check ur shared preference name...I think something wrong ...

    • @mawiramike2346
      @mawiramike2346 2 года назад

      share code

  • @locklyn6206
    @locklyn6206 2 года назад

    can i have the code sir?

  • @marciopaulo1708
    @marciopaulo1708 3 года назад

    how do i save an image?

    • @CodingwithDev
      @CodingwithDev  3 года назад +1

      Its not recommended to store image in Share preferences And you should store that image to sdcard.And then store image path (from sdcard) into Share preferences like this..
      SharedPreferences shre = PreferenceManager.getDefaultSharedPreferences(this);
      Editor edit=shre.edit();
      edit.putString("imagepath","/sdcard/imh.jpeg");
      edit.commit();

    • @marciopaulo1708
      @marciopaulo1708 3 года назад +1

      @@CodingwithDev
      OK. I will try here. Thanks!

    • @mawiramike2346
      @mawiramike2346 2 года назад

      best was is to store image link instead of image itself

  • @HENDROGNWN
    @HENDROGNWN 5 месяцев назад

    Source Code please

  • @williamguyon5991
    @williamguyon5991 4 месяца назад

    im gay but it doesnt work