Tuesday, October 7, 2014

Android Tutorial Chapter 4

I decided to use the android tutorial you found and I just skipped the first 3 chapters which talked about set up. Also, I have gone over some of this material but I'll just repeat it anyway. This chapter went over the four main components of making an android app which include an activity, a service, broadcast receivers, and content providers.
  • An activity is basically a screen of the app so an app for text messaging may have a UI for contacts and a UI for the actually text
    • Activities are implemented like this where "MainActivity" is the name of the class     
      public class MainActivity extends 
      Activity {}  
  • A service is when a long process is running in the background such as playing music while running a different app or grabbing data without preventing interaction with the app
    • Services are implemented like this where "MyService" is the name of the class   
      public class MyService extends Service {}   
  • I'm not actually sure what a broadcast receiver is but from what it looks like it allows apps to be notified if anything was downloaded to the device and allows the app to use it. So I'm guessing that means that whenever I download an app and it asks for permissions that may apply to broadcast receivers because it wants to access the data on my phone.
    • Broadcast receivers are implemented the same way with the name after the class and each message is classified as an intent object which I think I will get into more later      
      public class MyService extends Service { }
  •  I think content providers are the subclasses that actually supply the data for the broadcast receivers 
    • Content providers are implemented the same ways and require APIs to enable the transaction of data (I'm guessing they will explain that in more detail later as well)      
      public class MyContentProvider extends ContentProvider {} 

1 comment:

  1. Please make "the android tutorial" a link to the resource, so that I can follow along with your blog post. Fix this first thing tomorrow and I'll go back over your post again, looking at the tutorial as I read your post.

    ReplyDelete