[Q] Background Service to check for notifications - Java for Android App Development

Hello,
I want to create an background-service which loads some data from my server and then create a notification.
I already know how to create the notification and how to load data from the server, but how should I make the background-service?
Another thing is, that the service should get called on 5 o'clock in the morning everyday or on boot complete, if the device was switched off at 5 o'clock.

Related

annoying things!!!!

has anyone developed software or knows how to alter the setup on XDAII to avoid the following:-
when a text message arrives it disconnects the POP3 e-mail and has to be manually set back onto the POP3 account before picking up any new mail...... this is annoying!
When a message (e-mail or text) arrives it turns on the screen which is then active, if i have been using the phone and not closed the application fully (just hung up using the silver button) when the phone is in my pocket it starts calling the last number or something like that. I had a 10minute international call like this last week AND IT REALLY PISSED ME OFF!!!!!!!!! :evil:
so please if anyone knows how to fix these annoying little habits - could you let me know.
Thanks
R
Rasputin said:
when a text message arrives it disconnects the POP3 e-mail and has to be manually set back onto the POP3 account before picking up any new mail...... this is annoying!
Click to expand...
Click to collapse
By design, the GSM bearer has higher priority over GPRS "attaching" but not "transmission" ... this means if a phone or SMS comes in the middle of a live GPRS session (data is being sent or received) it will be blocked till the last packet is transmitted ... that's why the caller may got busy tone sometimes and other times not ... depends on the GPRS traffic status ... but since the GPRS is "Always on" in WM2003, the session will be resumed immediately but the application must be designed to keep the last session stack
Rasputin said:
When a message (e-mail or text) arrives it turns on the screen which is then active, if i have been using the phone and not closed the application fully (just hung up using the silver button) when the phone is in my pocket it starts calling the last number or something like that. I had a 10minute international call like this last week AND IT REALLY PISSED ME OFF!!!!!!!!! :evil:
Click to expand...
Click to collapse
you can select to lock all buttons except power when the device is off
start -> settings -> System -> Button Lock
cheers Biso,
but even with the buttons locked, a new message turns them all on again for however long the auto power off period is...... and then that is provided that no buttons are pushed!!
the point i was trying to make about the POP3 stuff is that if you have the device set to check e-mails say every 5 minutes, in order to do this the folder in the inbox has to be set to POP3 (or whatever you have named it)
if the SMS folder is open then it wont check POP3.
So every time you receive a text message the SMS folder is opened and it will prevent the device checking for e-mails until you go into the inbox and select the correct folder - ie. POP3!
I know its true that phone calls will interupt the GPRS connection, and that is not really a problem (apart from signing out of messenger).
Anyway thanks
- I never use MMS but i guess that would probably cause the same problems????

App to set date automaticaly

Hi,
I have a problem with some doctors in my network that forget their ppc for a while, lose power, and then have to use their ppc to input patient data. They usually plug it in, turn it on, and magically see (thanks WM5) their app still there. Problem is that they forget to set back the date and still connect to the main database. And when they try to find the patient data, we have to search painfully to get the data back, as it is usually saved on tape when date is too old, so the data disapear after the next nightly backup.
I'm completly overhelmed. I'm sure it could be easy to program something that get the system date, and save it in on file. That program could be run everyday at 1:00 AM for example.
Then I could run the set program at any time (for example before connecting to the database) and set the date at the latest value.
I tried to check mortrunner, but there is no set time function. Anybody know how this can be done automaticaly? Is it hard to program?
Thanks

Android 1.0 bugs and glitches

Has anybody else found annoying bugs so far? Here's the ones that I've run into:
- Address Book server sync overwrites changes that you've made from the phone (haven't confirmed this one, might be my fault somehow)
- Multimedia volume slider plays your ringtone once you adjust the volume, but plays it at the volume set in the ringtone slider (not the volume that you're actually adjusting)
- Browser bookmarks list has a lot of trouble keeping site icons straight, it just kind of randomly shuffles them around to the wrong site as you load different bookmarks
- AOL Instant Messenger app shows weird behavior, not sure if it's a bug but it is definitely difficult to use in its current state. Locking the phone prevents messages from showing up, then on unlock they stream in all at once, and if you go too long without checking in on it the program will be terminated but your screen name will not be signed out of AOL's server
- There doesn't appear to be any way to set a vibration for notifications like Text Messages or IMs
- Some apps (MySpace Mobile, specifically) do not account for their process being interrupted when the screen rotates and the current action will be cancelled or the program will freeze.
Overall great phone, I'm really extremely impressed with it as a whole so far. I'm amazed at how fast my internet connection is on EDGE, my old Dash was technically on the exact same connection but took 5 or 10 times longer to load a full web page. Even without 3G the web browsing experience is comparable to using my desktop at home.
chefgon said:
- There doesn't appear to be any way to set a vibration for notifications like Text Messages or IMs
Click to expand...
Click to collapse
ya there is. for example, go to the main Messaging page where it shows all of your threads. Click on Menu > Settings > Vibrate (put a check mark)
same thing with IMs or EMail
snofrandy said:
ya there is. for example, go to the main Messaging page where it shows all of your threads. Click on Menu > Settings > Vibrate (put a check mark)
same thing with IMs or EMail
Click to expand...
Click to collapse
Awesome, thank you! Weird that the option isn't available in the same place as setting the vibration function for the phone. Has anybody found solutions to any of these other problems?
Thanks
That fixed it for me. Thanks..its so Funny because Ive been messing around with my phone for 2 days and Just found this answer...Thanks
Android will get it wrong sometimes on sms threads when the sender is not in your contacts.
I noticed yesterday I received an sms from [email protected] and deleted it. Later an sms from +1913XXXXXXX. When I pulled up the my sms folders later, the newer, undeleted sms from the 913 number said it was from @domain.com.
(and the two are in no way related.) I did a reboot and it still displayed the same.
chefgon said:
Has anybody else found annoying bugs so far?
Click to expand...
Click to collapse
When I plug my G1 into my iMac the computer freezes and I need to do a hard restart. Is anyone else having this issue? My updates are current on my iMac and all of my other phones work without any problems.
when i play music and i turn of the screen, there is a jump every 15 seconds
here's an email bug...
Go to craigslist.org. I wanted to ask a seller a question. When I email from there, it gives me 2 options, to use my pop 3 email account or gmail. If I use gmail, it takes off the craigslist.org extension and replaces it with gmail.com. If i choose to send with my pop 3, it just opens a blank email without the email address. I try to copy and paste the address into the sending field, but it won't let me. I use craigslist a lot, so this is a bit of a pain...
Otherwise, lovin the G1
scottslc said:
Go to craigslist.org. I wanted to ask a seller a question. When I email from there, it gives me 2 options, to use my pop 3 email account or gmail. If I use gmail, it takes off the craigslist.org extension and replaces it with gmail.com. If i choose to send with my pop 3, it just opens a blank email without the email address. I try to copy and paste the address into the sending field, but it won't let me. I use craigslist a lot, so this is a bit of a pain...
Otherwise, lovin the G1
Click to expand...
Click to collapse
When it switches you over to gmail. Is the body filled out or the sender in the field?
no, just replaces the extention
Give it a try see what you find. www.craigslist.org
Actually i did try it and it worked for me.
But, i used the mobile version of Craigslist.
Mobile version of Craigs

GChat on desktop with phone nearby

Has anyone cracked the code on when Google chat on the phone ignores desktop chat and when it doesn't? I have seen that sometimes when I chat with my friends on my desktop, sometimes my phone beeps for every line entered by the other party and sometimes it doesn't. I think in a perfect world, the phone should beep for the "first" line of text, and if I answer on the desktop, it should ignore the rest (but still record them for posterity). And if I answer on the phone, perhaps it should just haptic vibrate for each line of text received after the "first". I say "first" in quotes because I imagine that would be difficult to manage pragmatically. When is it the first chat of a new "session", and when is it just a delay in between chat lines of the same session? Maybe a customizable interval, like say five minutes. If no text is received within five minutes then it is a new session, so beep on the first line?
Lat night I was chatting with a friend (I was on the desktop) and every time he sent something, my phone would beep. Not the best solution in my opinion.
From what I can tell, your phone will receive the message when you do not have the gchat window active on your desktop.
If you click in on the area like you were going to type a message and leave your cursor there, when your friends send messages they don't seem to get sent to the phone. On the other hand, even if you have gchat open on your desktop and you say use a different program or are on a different tab in your browser, then your phone will receive the messages.
At least this is my experience. I think this is the correct behavior as you don't need to get messages in two places when you are actively chatting.
From my experience I use Gchat on my pc everyday when i am at work and I have my phone on my desk near by. When a friend of mine messages me it hits both for the first message, but if i answer on my desktop, it does not hit my phone ever until I sign off of gchat on my pc. Even if it is not focused on the gchat window. I am however using Trillian for my gchat, not sure what you all are using.
DLarva said:
From what I can tell, your phone will receive the message when you do not have the gchat window active on your desktop.
If you click in on the area like you were going to type a message and leave your cursor there, when your friends send messages they don't seem to get sent to the phone. On the other hand, even if you have gchat open on your desktop and you say use a different program or are on a different tab in your browser, then your phone will receive the messages.
At least this is my experience. I think this is the correct behavior as you don't need to get messages in two places when you are actively chatting.
Click to expand...
Click to collapse
This is what happens for me as well. Messages go to my phone on the first IM or if I don't have that window active on my desktop.
I am using the built-into-gmail-dot-com google chat. This has definitely happened to me several times before. Last night it happened again. The entire conversation I had with my friend, every time I received a message on my desktop, my phone also beeped. Other times it worked like it was supposed to (beeped the first time and that was it.)
I will see if I can get my wife to help me troubleshoot tonight.
perhaps a topic for a different thread...
I found the chat behavior to be exactly the way DLarva stated:
DLarva said:
From what I can tell, your phone will receive the message when you do not have the gchat window active on your desktop....
Click to expand...
Click to collapse
My question (perhaps a dumb one ) is how/where to turn off the notification that you got a chat all together?
I don't want any notification of a chat receipt while I am on the phone.
Any help?
Maybe:
Try (within setting of google talk) turn off notification bar, no vibrate, and set ringtone to silent.
That might approximate no notification.
etaChase said:
I found the chat behavior to be exactly the way DLarva stated:
My question (perhaps a dumb one ) is how/where to turn off the notification that you got a chat all together?
I don't want any notification of a chat receipt while I am on the phone.
Any help?
Click to expand...
Click to collapse
thanks for that - have tried to "approximate" no notification, and that's all well and good. . . but not the same as turning it off.
I have looked around in my mobile settings in the google account but can't find it (thought it might be similar to turning on/off notification of appointments in the calendar)...
might just be missing it, but this seems like fairly simple feature. I am nearing feeling ready to root my phone and thought maybe this would be a feature that was only available after doing that. It would have been the final encouragement I need to take that (admittedly not very big) plunge!
I have a rooted Nexus One (CM6 with KOR) and that is as close as I can get to turning them off (that I can find anyway).
This was happening to me, too (when I used Gtalk on the PC, the phone sitting on my desk would sound the alert, with every chat message I rec'd) -- so I just manually signed out of Gtalk on the phone, and it stopped happening. I mostly use Gtalk on desktop anyway. (Though when I check "running processes" on the Vibrant, I see Gtalk always seems to be running -- must start up automatically -- even though I'm signed out...)
exactly Pevvy -
but signing out of Gmail kinda defeats the purpose of having the phone constantly synched. Guess the same argument could be made as to why you want chats saved/synched... anyhoo - I just don't want chat on my vibrant, period. I don't want them saved (so transcription is turned off in gChat on the desktop) and I would never chat from the phone. OK, never say never, but I would rather have to enable that, rather than always having it running using resources.
When I root that would a fun thing to explore to see if it can be deactivated through some custom start-up (so it doesn't show as a running service - I see the same thing) and only starts if I manually start it.
That said, if it is server side associated with the google account (its a hosted domain and that may further change things...) it may not be able to adjust even with root. Interest how this shows the blending/blurring between the net and the synch to the phone - and should data and synch be more push or pull.
Oh, I didn't sign out of Gmail on my phone -- just Gtalk (the chat service)... seems it was keeping me signed in automatically before, and I had to go into the app, and manually sign out.

Droid-X and Gingerbread and Sync/Push

i have two droid-x`s pretty much identical setups (both have been rooted and not rooted and both do the same thing)
currently i do not have cellular service on either droid-x
both droid-x`s are currently running 4.5.602 OTA rooted (but i have tested stock and they do same thing)
both phones are setup to use wifi 100% of the time
"settings/wireless & networks/Wi-Fi settings/menu key/advanced/Wi-Fi sleep policy/never" = checked on
"settings/wireless & networks/Mobile networks/System select/Automatic" = checked on
"settings/Battery & data manager/Data Delivery/Background data" = checked on
"settings/Battery & data manager/Data Delivery/Data roaming" = checked off
"settings/Battery & data manager/Data Delivery/Data enabled" = checked off
"settings/Battery & data manager/Data Delivery/Social applications/Sync over Wi-Fi only" = checked on
"settings/Battery & data manager/Data Delivery/Social applications/Data delivery frequency/Automatic (Push)" = checked on
"settings/Battery & data manager/Battery mode/Performance mode" = checked on
on my desktop i login to my hotmail with chrome browser (windows 7 x64) i then send an email to my gmail account
when i do this i have google chrome setup with notifications and it notifies me i got an email
on my phone when screen is black (locked) i sometime get a notification and sometimes i do not
with skype for android
i pick up my home phone and call my skype number
sometimes i will hear it ring and alot of times it goes straight to voice mail
i can confirm with froyo everything worked 100% of the time
you know when your phone hasnt rang all day something is really wrong
same thing for gmail...i get email`s from spam at least 4x a day and i hear it on my google chome browser for my windows 7 pc and about 1/5 the time i will get a notification on my phone....
there is something majorly wrong for sure
i dont know what other apps have push settings.
is there a way to find out what apps are supposed to be syncing?
on my router i checked the logs and the phones are staying connected 100% of the time
not one drop in like 3 days unless i reset the phones or something
there is a sync/push issure for sure with gingerbread
can someone else verify their gmail push by setting their phone to the settings i have above (if applicable) and then logging into another email account and send yourself a gmail email?
check to see if your sync/push is working
i am betting its not working on any apps consistantly
let me know
little more info to add
if i turn my phone to off
i then turn my phone to on and let it boot to the lock screen but i "do not" unlock it and i let it goto sleep and if i wait like an hour and try to send me an email or call my android skype number none of that will make it to my phones`s
if i hit the "back" button to look at the "locked screen"
i can then see my "wifi" and "cellular" are white in the notification area instead of the normal blue.
if i then unlock my phone and let it boot to the desktop the "wifi" and "cellular" will turn blue and then i will recieve my emails and skype notifications
there is definately a bug somewheres....
more info:
after i am at desktop of phone and i let the phone fall asleep and i wait a little over an hour.
i then hit the back button i can see notification icons of the "WIFI" and "CELLULAR" they are still BLUE
i then slide to unlock....it goes to desktop and then after a couple seconds the "WIFI" and "CELLULAR" BLUE icons turn WHITE for about 15 seconds or so and then they go back to BLUE....and then i hear my email notifications and skype missed calls
this GB IS BAD!!!!
something majorly wrong with sync/push/wifi keeping connection but losing data or something
something just is not right
So your issue is that emails and skype isn't notifying you?
Sent from my DROIDX using XDA App

Categories

Resources