How to Make Android Apps 19

[ad_1]
Get the Code Here :

In this part of my Android video tutorial I’ll cover the NotificationManager, TaskStackBuilder, PendingIntent, AlarmManager and more on Intents.

The focus this time is on being able to notify the user of events even if my app isn’t running. The code is set up so that you can easily copy and paste out the capabilities you need directly into your app.


Posted

in

by

Tags:

Comments

38 responses to “How to Make Android Apps 19”

  1. Debjit Mandal Avatar

    Hi, your videos are awesome. I have learned so many things from your channel. Recently I found this video on YouTube. Probably this person is uploading your videos in his/her channel. Maybe you already know about it.
    https://www.youtube.com/watch?v=gm5n_hRIR-c

  2. StefoEntertainment Avatar

    Hello Derek,

    I have a problem with the app. When I enter it and press the button "Show Notification" the app just crashes saying the usual 'appname' has stopped working. Do you have any solutions?

    Thank you for the tutorials the are really helpful.

  3. Life Hacks Avatar

    do you know how to transfer the application into a android device?
    could you please list the steps as well or post a video in that?
    thanks 🙂

  4. Waseem Salie Avatar

    Hi Derek, i got this app to run perfectly, how would I alter the code to trigger this alarm/notification the 5th day of every month?

  5. Life Hacks Avatar

    i am having trouble with that would you mind helping me out?:)

  6. Life Hacks Avatar

    did you publish your app on the play store? If not how did you get the app working on your phone.
    Could you please reply quickly 🙂

  7. Rusmal Firmansyah Avatar

    How to make android application :
    connect android and mysql…
    if in mysql has a new data, in android studio has a notification….

    please help me

  8. kushal bhattacharya Avatar

    Sir, in the last section when you use pending intent on the larm manger , i mean when we are using FLAG UPDATE current on the intent does it mean that it will not create the intent ie the main activity for the first time whenwe click that alarm notification?

  9. Madmonkey Avatar

    in the MainActivity.java ActionBarActivity is now deprecated. You should use AppCompatActivity instead.

  10. AquilesBlade Avatar

    How do i make a multiple alarm(like a alarm clock) using pending intent?

  11. Miranda Lawson Avatar

    My app does nothing after 5 seconds. Am I the only one with this issue?

  12. Miranda Lawson Avatar

    Thank you for the tutorials Derek.
    But when I run the application, I get the following error log:

    07-26 19:44:28.183    3046-3046/com.example.vahid.notifications E/AndroidRuntime﹕ FATAL EXCEPTION: main
        Process: com.example.vahid.notifications, PID: 3046
        java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.vahid.notifications/com.example.vahid.notifications.MainActivity}: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
                at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2298)
                at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2360)
                at android.app.ActivityThread.access$800(ActivityThread.java:144)
                at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)
                at android.os.Handler.dispatchMessage(Handler.java:102)
                at android.os.Looper.loop(Looper.java:135)
                at android.app.ActivityThread.main(ActivityThread.java:5221)
                at java.lang.reflect.Method.invoke(Native Method)
                at java.lang.reflect.Method.invoke(Method.java:372)
                at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
                at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
         Caused by: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
                at android.support.v7.app.AppCompatDelegateImplBase.onCreate(AppCompatDelegateImplBase.java:124)
                at android.support.v7.app.AppCompatDelegateImplV7.onCreate(AppCompatDelegateImplV7.java:146)
                at android.support.v7.app.AppCompatActivity.onCreate(AppCompatActivity.java:59)
                at com.example.vahid.notifications.MainActivity.onCreate(MainActivity.java:35)
                at android.app.Activity.performCreate(Activity.java:5933)
                at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105)
                at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2251)
                at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2360)
                at android.app.ActivityThread.access$800(ActivityThread.java:144)
                at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)
                at android.os.Handler.dispatchMessage(Handler.java:102)
                at android.os.Looper.loop(Looper.java:135)
                at android.app.ActivityThread.main(ActivityThread.java:5221)
                at java.lang.reflect.Method.invoke(Native Method)
                at java.lang.reflect.Method.invoke(Method.java:372)
                at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
                at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)

    I am using API 21 so every time you wrote "extends ActionBarActivity" I wrote "extends AppCompatActivity" because ActionBarActivity is deprecated now. I have absolutely no idea what any of those error statements mean. Can someone help?

  13. toygar05 Avatar

    Alarm button didn't work for me. Adding the following line to manifest file between the end of activity and application tags fixed my problem:

    </activity>
            <receiver  android:process=":remote" android:name=".AlertReceiver"></receiver></application>

  14. Ernani Joppert Avatar

    One question I can't seem to find anywhere is when I set an alarm for a future date, what if the user shuts down their phone or tablet and just open it later in time?

    Will it persist for the next boot?

    What if I do schedule an alarm and then come back and cancel after a reboot? Is that possible?

    Thanks a lot! Your videos are awesome!

  15. Ibrahim Samad Avatar

    In fact if I could write a small program that will loop through all your tutorials and hit the like button, I would have done it…lol..youtube probably might not allow me…bro u re awesome. keep it up!

  16. Stjepan Krpan Avatar

    This is amazing Derek i learned a lot!!! Can i ask you just one thing? How to make AlarmMenager work after device reboot? I have switch buttons for 6:00 AM, 8:00 AM etc. and when i set them they work like charm but when my device reboot nothing is poping out… Thx for help!

  17. Styles P'yall Avatar

    Hey Derek, just curious about how do you know so many programming languages. It's amazing.

  18. Rannie Angelo Pinulan Avatar

    would you have tutorials on how to create calendar view for android? thanks derek 🙂

  19. Jeremy Jackson Avatar

    On the off chance that someone misses this like I did, make sure your app's build.gradle file has something like this:

    dependencies {
        compile fileTree(dir: 'libs', include: ['*.jar'])
        compile "com.android.support:support-v4:21.0.+"
        compile "com.android.support:appcompat-v7:21.0.+"
    }

  20. brent swanson Avatar

    Hey Derek, great tutorial again, I would like apply this to an app idea only thing is, i would prefer that the notification comes in when the person is online. Like a log in feature.. thanks for any advice because i want to incorporate the gps along with notification feature.

  21. FiddiTwo Avatar

    hi derek, im confused with trying to design a simple calendar type app.  I have a Listview with date/times in it, i want it so that it automatically creates a countdown timer when there is 10 seconds until the time – would u use alarmManager for this ? Would u set an alarm for EACH item in the listview or just do one by one as they trigger ? thx as always, just watched this vid for the 2nd time 🙂

  22. niranga sandaruwan Avatar

    greate tutorial can you explain how to trigger an alarm on  day of week as a example monday only,only weekend,only weekdays

  23. Shubham Maurya Avatar

    Hello Derak, Can you do any android application on mongo db.

  24. Xin Lin Avatar

    +Derek Banas 
    halo,did u have tutorial about Music Player with its own database? Thanks

  25. Darek Czajkowski Avatar

    Hey Derek,
    Could you make a tutorial on making Android Apps with a new Material Design, animations etc. step by step?

    Just simple app with an action bar, sliding bar from left (like a menu), pages, transitions etc?

  26. Loana Fezzy Avatar

    Derek I love your video, however I'm confused about how you would implement this into a real app. For example: how would you make it so the user could choose the time of day they want to be notified? Or even if they want to be notified multiple times a day? 

  27. Sam Costley Avatar

    Hey Derek, I love all your videos and they are so helpful!  Anyways, I was wondering if sometime you could make a video covering like industry standards for coding/Java.  Industry standards as in the proper names for variables, documentation, and whatnot.  Thanks!

  28. Skullboneslayer Avatar

    Can someone please help me, Im getting this error 
    Error:XML version "3.5" is not supported, only XML 1.0 is supported.

  29. Bad Advice Avatar

    +Derek Banas Thank you for continuing your tutorials on Android. I am a big fan on how you teach. Keep up the awesome work.

  30. shaskies Avatar

    Hey Derek,
    Awesome tutorials.

    Question:
    1. How many languages do you know?
    2. Did you learn them in school or are you self taught?
    3. How long have you been programming for?
    4. Can you do tutorials on using APIs in your apps like Facebook's & Foursquare's in the future?

    Thank you. 

  31. _ _ Avatar

    Merry Christmas Coach.  Please be my Santa and teach  a ANT in a video course just like C++
    God Bless

  32. Kavit Trivedi Avatar

    Hey, Can u make a tutorial on Push Notification in Android using PHP ?

  33. Abhishek Balani Avatar

    Your new android videos are really good. Its really great that now you are covering other advanced topics. I have saved some of your videos for future reference as well. Keep doing the great job.

    And it's about to be a month since we are waiting for contest results. I hope I am not bugging you.

  34. Luis abcdefg Avatar

    Derek banas sence you have been making apps for some period of time. How hard is it to make apps like temple or detailed apps. Im just learning how to code and i always wonder if its hard to make apps even after you been coding for a while.

  35. Lyn Scott Avatar

    Amazing Derek.. Thanks. Just in time because I need to implement this in one of my apps..

  36. Erin Barker Avatar

    Thank. You.
    No, seriously. You have NO IDEA how much I needed you to make this video.
    I sincerely appreciate it.

  37. Mattreds0x Avatar

    +Derek Banas can you please explain to me why when I need to use the android support/appcompat libraries and when I don't need to? I seem to be confused as to why I wouldn't want to use the latest code and not a support library.

    I understand that the support libraries are basically porting some of the newer features of android back to the older versions, but I don't get when I should use the support library classes and when to use the built in classes.

    Thanks!

  38. Nicolae Iosif Avatar

    Hi Derek.
    When announcing the winner of the contest?
    I'm so excited! 🙂

Leave a Reply

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