How to Make Android Apps 21

Get the Code Here :

Accessing the Content Provider with a Content Resolver starts at 19:27

Welcome to my Android Content Provider tutorial. I’ve received many questions about this topic. I have received many questions specifically about how to access a Content Provider from another application. So here I’ll make to apps. One will function as the Content Provider and the other will access data using a Content Resolver.

I haven’t found a tutorial online that explains how easy it is to use Content Resolvers in this way, so I hope this video is very useful.






41 responses to “How to Make Android Apps 21”

  1. ChaseOfSpades Avatar

    Hey Derek,

    How are you adding key value pairs to the "values" hashmap in

    The only values.put commands i see in the source code is for a ContentValues object.

  2. buckithed Avatar

    wow, this is so much code to memorize, and you make it seem so easy! I am always amazed by how well versed you are in every language. I cant imagine the amount of time it would take to learn everything that you have made a tutorial about.

  3. Charalabos Theodorou Avatar

    amazing work in one of androids hardest to understand topics thank you very much

  4. Amit Kakade Avatar

    is it work on different phones?
    i.e, resolver on one phone and provider on another phone

  5. Elif Tultay Avatar

    Hello Mr. Banas. I' am trying to get data from the api, connect it with listView adapter in the main activity and I want to use Cursor Adapter but I couldn't understand how to connect list view adapter and cursor adapter. Could you help me? Thanks, Regards.

  6. Rajat Bhagat Avatar

    Hey Derek, Huge fan of your videos. I just tried your tutorial, however it seems to be giving me the Unknown URI error. I do not the what the issue is. I tried using your code, but that too returns the same error. If you could help me out with this, it'd be a big help


    why we used hash map ……what is its use?

    also tell me the purpose of static block????????????????????????


    thanks man that was awesome

  9. George Wilde Avatar

    That is my SQL RDBMS
    I am going to create content provider for it.

  10. Eric Ho Avatar

    excellent! if each account can give 100 thumbs-ups, I would give you 200.

  11. Ap0c4 Avatar

    Hi Mr.Banas. I've never wrote a comment under your videos because your examples and your way of explaining things are amazingly crystal clear and I could never say enough "thank you" for doing this (plus I don't want to waste your precious time 🙂 ).
    However I'm struggling so hard with the "HashMap" you used and googling it isn't helping so much. If you have some time, I'd like you to help me with that.
    Suppose I would have to map multiple columns and not only "name". How could i do that? Like, I've 4 columns: id, name, surname, age.
    I did : "private static HashMap< String, List<Person> > values;" but the compiler complains me with "queryBuilder.setProjectionMap(values);" because it isn't expecting a List in the HashMap.
    (I'd like to build an ArrayList with a bunch of Person in it, all having the 4 columns that I previously mentioned and then passing it to the database). Again, thanks for your time and patience. Sorry if my English isn't perfect but I'm Italian and I'm trying my best :). Cheers.

  12. reda mohsen Avatar

    hello i know am super late here but i just found the channel and its very nicely presented and clear videos as well , i just want to ask one this which is how to modify the content provider here to make it send suggestions to searchview widget on text change?

  13. Lekha Surya Avatar

    is it necessary to use content provider before using content resolver

  14. Theodosios Avatar

    Excellent tutorial! I am going to use ContentProviders in my app. I would like to ask you,if you could put a tutorial in TDD. For example how to test Views like RecyclerView,EditText,ImageView etc with robolectric as well as SQLite and Volley library. Especially the last one is quite hard. TDD is a topic that all Mobile Dev companies ask from candidates. In fact a company gave me a test.I did most of the parts,but not the TDD and failed. :(.

  15. Ajay Deepak Avatar

    Hey derek, thanks for all your tutorials i've been following deeply and it has helped me a lot. I tried app21 Contentprovider & ContentResolver video and but im getting an error for the URL as Unknown URL my URL goes likes this "content://" im actually dont understand about the virtual directory "cpcontacts" ….

  16. Boniface Yogendran Avatar

    Thanks for taking the time to go through this. I started android programming like 2 days ago. No previous experience!

  17. Umang Pandya Avatar

    sound is killing my ears…

  18. Divyesh Jindal Avatar

    hello Derek, your tutorials are awesome but i request you to please add description of the tutorial in the name of the tutorial so that we can directly see what tutorial i want to see. Also it would be boosting the views as usually we just type our problem and look for video for that but in your videos we can not see what the tutorial is for until i open each and every tutorial.
    Thank you.
    hope you make the changes

  19. Fatih Özcan Avatar

    Hi Derek, thanks for all these tutorial videos. I'd like to ask what is the purpose of Hashmap<String, String> values. I know it's for matching column names inside database. How does it pass anything to database without initializing and putting any values to it? Thanks in advance, keep up the good work. Have nice day.

  20. Deva Adithya Avatar

    thanks for your very great tutorial, but it's too fast when you explain it

  21. tecnocratay Avatar

    great vids!! u rocks! cheers from brazil!

  22. Arun venkatesh Avatar

    hi derek…i could not see the hash map getting initialized anywhere..could you please hlep me understand what is the need for this hashmap ? how does the code behave when the set to query builder happens without initialization

  23. Bojie Jiang Avatar

    Hi Derek, great toturial ! I tried step by step, but finally provider worked while resolver did not. There is NullPointerException on boolean android.database.Cursor.moveToFirst(). I checked, the cursor form Cursor cursor = mResolver.query(CONTENT_URL, projection, null, null, null); returned null. I also checked contentURL, and compared the code, but no luck. Any suggestions? Thanks a lot !

  24. Richard Andrews Avatar

    Hey Derek…..Can you show how could we use a slider that could show images and slides on its own, like a web page does…???? I really really need it …!!!Pls try to find a way to do so …!!!! 

  25. Shadrack Mentowah Avatar

    How do i create a splash screen. someone please help me.

  26. Hugo Possani Avatar

    Hey Derek! That's the first time I'm commenting on a video, but I'd like to do it to thank you for all the good quality material you make and post here! Congratulations!

  27. BigDk Mcgee Avatar

    Hi Derek can you please get all the link script codes  of everyone of the programming videos you have on Youtube  all in one folders,so we can download the entire codes all at once,thankyou.

  28. mboutman4 Avatar

    Hi Derek, i'd like to thank you for your videos, they help me so much.
    Can you please make videos on how to customize the GUI (button, edittext, textview,listview, etc..) like they did in the linkedapp, means from photoshop to xml.
    Can you also make a video on scrollable splash screens (image and texts) like in linkedin app.

  29. Priyanshu Singh Avatar

    Hi Derek, I have been following your app development tutorials regularly and i must thank you for such well organized and easy to understand videos. Can u please tell me how to show the contacts data in a tabular form?   

  30. Nejim Abdullahabbas Avatar

    My brother Hello possible explanation of the program Android Studio there is a change in the program in 2015 as possible to explain the program site and thank my brother

  31. FMsekvensen Avatar

    What language is this writen in? And how do transfer the app from the computer to the android phone?

  32. biss Avatar

    Hey Derek, this isn't really related to the video but, should I first off learn a bit of java then go to your android videos? Or do you teach us java as you go along?

  33. Angelina Jolie Avatar

    Hi Derek! Do you remember the custom data structure tutorials you`ve done? i`d like to see you creating a custom hashmap and arraylist.
    Thanks In Advance !

  34. Syed Salman Avatar

    Hi +Derek Banas in few days I learnt lots of things in short period of time. I'm a fan of your tutorials..
    I'm a beginner.. Your tutorials helped me alot.. Thanks alot.

    Please also make video tutorials on navigation drawers activity, setting activity, Google play service activity, tabbed activity, Google maps activity etc which are provided by Android studio during new project creation..

  35. jrcu19 Avatar

    I love your videos. They r great tutorials. I was wondering if you could do one on how to migrate projects from Eclipse to Android Studio and Unit Test in Android Studios. I started using Android Studios and now I can't seem to get any Unit Tests to work. Thanks!

  36. Pagiel Sewell Avatar

    Hey Derek I really enjoy your videos and they are really helpful. I'm currently on lesson 14 of your Java tutorials.

    I ultimately want to learn to make Android apps.
    At what point should I switch over from your Java tutorials to your Android app tutorials.

  37. Angelina Jolie Avatar

    Hi Derek ! Is it possible to use only logic and the android api documentation to create something like this or with android we always have to rely on examples in the android api?if so it would be awesome if you did a one-time tutorial using logic and looking up methods and classes in the documentation.Thanks In Advance !

  38. Viktor Çitaku Avatar

    Hi Derek. Thanks for all tutorials. I have a question that isn't about this, but in general. This month I'm gonna start my career as a programmer, I've learned JAVA, C#, (html,css,javascript), MySQL, and some frameworks like Spring. I know you have experience, what is you opinion being a Developer/Programmer? Sorry if the question sounds banal or crazy, and my English, I'm not native speaker.
    I've recomment this, I think now is also on Google+.
    And for end i would say all the videos where, are, and would be inspiration for me, ☺

Leave a Reply

Your email address will not be published. Required fields are marked *