android.intent.action.TIME_TICK - Has anyone used it?

by simonc » Wed, 01 Apr 2009 19:41:49 GMT


Sponsored Links
 I'm trying to get an application / reciever / anything that can
perform a task once every minute. I'm trying to use the intent-filter
"android.intent.action.TIME_TICK" which, in theory, sends an Intent
message every minute.

Does anyone have any code that uses the
android.intent.action.TIME_TICK intent? I can't seem to get it to send
the intent to my application and I can't find anything much on the
internet. Has anyone used it successfully?

I have a manifest.xml as below.

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android=" http://schemas.android.com/apk/res/android" ;
      package="xx.xxx.xxxxxxx"
      android:versionCode="2"
      android:versionName="2.0.0">
    <uses-permission
android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
    <uses-permission android:name="android.permission.SET_TIME_ZONE" /
    <application android:icon="@drawable/icon" android:label="@string/
app_name">
        <activity android:name=".xxxApp"
                  android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category
android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <receiver android:name=".xxxRecvr"
            android:process="xxx.xxx">
            <intent-filter>
                <action android:name="android.intent.action.TIME_TICK"/
                <action
android:name="android.intent.action.TIMER_TICK"/>
            </intent-filter>
        </receiver>
    </application>
    </manifest>
--~--~---------~--~----~------------~-------~--~----~



android.intent.action.TIME_TICK - Has anyone used it?

by Mark Murphy » Wed, 01 Apr 2009 19:45:34 GMT


 


That seems harsh for battery life, but maybe there's more to this that
I'm not privy to.


Per the documentation:

"You can not receive this through components declared in manifests, only
by exlicitly [sic] registering for it with Context.registerReceiver()."

In your case, you are trying to receive this through a manifest-declared
receiver, which will not work.

Either switch to a registerReceiver() implementation, or use AlarmManager.

-- 
Mark Murphy (a Commons Guy)
 http://commonsware.com  |  http://twitter.com/commonsguy 

Android App Developer Training:  http://commonsware.com/training.html 

--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Other Threads

1. How to deal with ExpandableList when all the data are coming from datebase?

I want to the effective like ExpandableList1 Activity in apidemo.But
my data is from the database.And th groups's data from the database
and the children's data from the database too.All both are comg from
different tables.
First,i want to konw how to get data from the cursor to String[];
Second,i want to konw how to confirm the data of children[][].

Thank you.
--~--~---------~--~----~------------~-------~--~----~

2. VPN on android ?

Hello all,

can anyone explain in simple words why android fails to support simple vpns
like pptp that are common among every single linux distro on this planet? 
If android really were an open platform I would be able to patch it in myself,
but additionally there is no doc available how to do that on a G1. I really
wonder what makes people believe in android instead of iphone. Both are quite
closed platforms, but on iphone vpns are no problem...
Hello google, have you really thought about it all ? If you want gamers as
customers build a game console. If you want to sell phones you should have
thought about the nature of phone numbers and why they may contain "*" and "#"
and what implications that has on sending text messages.
If you sell a phone with keyboard (G1) you should have thought about customers
in corporate entities (the ones that really need a keyboard) that have to use
vpns for security reasons. If there were no need for working we all would be
pleased {*filter*} pacman on android. But since we have to work we probably should
use another phone (platform).

Regards,
Stephan


--~--~---------~--~----~------------~-------~--~----~

3. Where do you find good Android Software Developers?

4. Is there a way for us to show ProgressBarIndeterminate in Theme.Dialog activity?

5. Radio's Colorthon Tutorial Now Available on YouTube

6. Where do you find good Android Software Developers?

7. How to change default google.com page in android browser