Downloads, Shown in notification bar? - android

As far as I know we can create notifications in Android using Notification Manager + remote Views.
I am Creating a notification for downloading Mp3 files. And I want an animations beside It. So far I have learned from forums that it is not possible.
However I saw A video for an android App which downloads and displays animation beside it while downloading it. Link: http://www.youtube.com/watch?v=yNcs-sS2nFU&feature=related
Moreover its the same animation used by the browser. How can they do it?
If any one suggests using level drawable for me, Please also suggest still I have to send a whole remote View to the notification manager with the same Notification ID. It will override it. That gives a animation like thing if I do it again and again. Is there no way to update remoteviews without sending the changed remoteviews to Notification manager.
WHY, I dont want the above mentioned animation effect?
Because It hangs the android. If the updates are sent more faster then 2000ms.
This question is also asked elsewhere at stackoverflow but never been answered.

The answer to all our problems,
http://developer.android.com/reference/android/app/DownloadManager.html
There is a built in download manager in android.

My guess is that particular animation you are seeing (the downward moving arrow) is provided by the system. I don't think you will be able to place your own custom animation in a standard notification.

Related

Recieving Notifications

So I have this idea of an app that would get all youtube's notifications for the day and puts them all in one page and give you some functionality over them like adding to watch later and maybe not interested and some others all in one click, in addition to that i would be able to make better notification tiles you know the default one isn't that good and i've seen better, I thought about it for a while and I think i am going to go about it this way:
1- stop youtube itself from sending the notifications.
2- making the app get this day's uploads and listing them.
3- making the app send the noti... in a better looking tile.
4- adding the "Other functionalities".
But..., i've looked around for notification support on the youtube api page and found nothing useful.
Is there any api or anything that would help me in this, i am using android studio BTW.

Android identifying what is on the upper part of the android notification bar

Currently I want to make an app but I don't know what this is called , I mean the android term for it, it's definately not a spinner, but more into the notifications.
I want to make an app that I can interact with just like the music bar here that can play music, stop next song , etc.
Can someone help me or tell me what that method is and where can I get some tutorials for it?
It doesn't seem to be an ongoing notification. (It's not being under the Ongoing tag being the clue, otherwise I could be sure that this was the case)
http://developer.android.com/reference/android/app/Notification.Builder.html#setOngoing%28boolean%29
It is probably a custom remote view
http://developer.android.com/reference/android/widget/RemoteViews.html
A quick google search will give you examples.

Notifications in Notification Center disappearing after opening one of them

I have a server that sends users many push notifications at any single time. Let's say 5 notifications are send to the phone. If I open one of them, all other notifications disappears.
How do I make the only one that is clicked, disappear. I look through the tutorials and done everything correctly. Is it something to do with the badge number or do I need to assign a special ID to every notification?
I can't find any solution on the web and I am surprise no one else faces this issue.
Ps. I am using Ionic Framework to build my app
" I am surprise no one else faces this issue."
Many many people have faced this same issue, its a mystery why Apple don't add more functionality in this area after so many years, but the situation is that you can't programatically delete just a single notification. You either delete all of them or none of them.

How to show a popup window on another actvity

I would like to display a message to the user for some asynchronous event. For example for an alarm expiration. I would like to display a popup or dialog that is displayed over any activity is the foreground at the moment (and this can be some other application activity) leaving the current activity in the backgound.
Is there a way to do so in Android?
First off, you will be told that this is a bad thing to do, that it is against the Android way of doing things. Users do not like this. And that the Notification area is much better way to do this.
That said... there are ways to accomplish this...
A Toast will display no matter which activity is on the screen. So you could set up a background thread (or better a Service) that will display your information in a Toast. This might be good enough for you.
You may find it useful looking at some Toast source code here.
Also here is a nice page on how to create a custom Toast layout by replacing the default View with one of your own. (I have not done this, but it looks quite interesting):
Custom Toast Alert on androidexample.com
The alternative is much more difficult, and is to display a System Overlay window. Unfortunately you have to do quite a lot of work to get these set up properly.
Here are a few related questions that I used to get it working:
Creating a system overlay window (always on top)
System overlay android 4.0
How to create a system overlay in Android which allows interaction with the windows below it?
Each of these has links to many others - there are loads of System Overlay questions on here.
But things to remember:
In the old days, you could put a system overlay on top, and send
touches through to the activity below. This is no longer possible,
and so a lot of the answers are now out of date.
You may need to
play around with the flags in the provided examples to get exactly
the effect you are aiming for. Not all the examples use the same
flags, so there are some subtle differences in how each solution
works.
Then again, I also believe that the Notification area is a much better UI pattern to use, so I do recommend you try that first. It is easier to do, and most of us expect that type of behaviour rather than a pop-up.
The problem with a pop-up, is that it might interrupt a movie I'm watching. Or a game I'm playing.
Yes, i had created two dialog for income event for background and foreground

Android: Looking for an easy way to play notification sounds in a loop manually

I am fiddling around with a dialog that pops up and displays an alarm information. (I know, it has been documented that in Android it's "better" style to use notifications instead, but just like the alarm clock I want it to display a dialog on top of whatever you do to really get the users immediate attention - as the user expects this behavior I don't think it's bad style!)
Now - the only easy way I found is using the RingtoneManager.getRingtone() function to get a Ringtone object for the type "alarm".
Well, I can play that sound now using Ringtone.play() - but it plays the sound only once and I cannot figure out how to let it play endlessly until the user reacts, e.g. by touching the dialog anywhere or dismissing it using Cancel button provided.
Does anyone know how this can be accomplished easily?
Thanks!
Take a look at AlarmClock from Android's git repository. It might be helpful to check out the source code on how to play sounds for an expected duration.

Categories

Resources