[android-developers] Re: Intent Receiver for android.intent.action.INSERT

2008-03-26 Thread severian

Thanks, hackbod, for your comments.

I see how this API is satisfactory for the stated purpose of notifying
other view elements when they need to re-sync with the
ContentProvider. Of course, that is not the only kind of application
that cares about changes to content, and I personally wish you guys
hadn't given up on the idea of describing the change in the onChange()
method. But I understand that specifying that change is a more
difficult problem than, say, telling you what radio box was selected
in a onCheckedChangeListener().
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Intent Receiver for android.intent.action.INSERT

2008-03-26 Thread hackbod

On Mar 26, 9:30 pm, severian <[EMAIL PROTECTED]> wrote:
> I really hope they fix this API to indicate what has changed, because
> ContentObserver is a nice idea - it allows different frontend and
> backend applications to share a common data pool.

It's a very intentional design.  In fact originally the API did tell
you what changed, but in many cases it is difficult if not near
impossible to provide that information.  The API is primarily designed
for user interface elements like list views, and it turns out that it
is really at least as easy for them to re-query the cursor and
synchronize its new contents with the list, than to try to keep track
of each change that happens and apply that to its representation of
what is in the cursor (and hope that actually stays consistent with
what is in the content provider).

At any rate, it is far far safer to re-synchronize with the current
contents of the content provider, than to try to integrate step-wise
updates and try to actually guarantee that your view of what is in the
provider actually matches its real contents.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Intent Receiver for android.intent.action.INSERT

2008-03-26 Thread Dexter's Brain

I totally agree.To detect even a single change, I will surely have
to rescan everythingThats a lot of work of course

Dexter.

On Mar 27, 9:30 am, severian <[EMAIL PROTECTED]> wrote:
> The problem is that ContentObserver.onChange() doesn't tell you what
> changed. So how do you figure it out? Well, as far as I can tell you
> have to keep your own copy of everything you might care about in the
> database, and then when you get onChange() you read everything from
> the ContentProvider and then compare it to your local copy, looking
> for changes. That is, you have to rescan the database with every
> change, not just between instantiations. But if I'm wrong, please tell
> me!
>
> Since you (DB) are storing a local copy anyway, this might be
> feasible, but for most purposes this is just too onerous to be useful.
>
> I really hope they fix this API to indicate what has changed, because
> ContentObserver is a nice idea - it allows different frontend and
> backend applications to share a common data pool.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Intent Receiver for android.intent.action.INSERT

2008-03-26 Thread severian

The problem is that ContentObserver.onChange() doesn't tell you what
changed. So how do you figure it out? Well, as far as I can tell you
have to keep your own copy of everything you might care about in the
database, and then when you get onChange() you read everything from
the ContentProvider and then compare it to your local copy, looking
for changes. That is, you have to rescan the database with every
change, not just between instantiations. But if I'm wrong, please tell
me!

Since you (DB) are storing a local copy anyway, this might be
feasible, but for most purposes this is just too onerous to be useful.

I really hope they fix this API to indicate what has changed, because
ContentObserver is a nice idea - it allows different frontend and
backend applications to share a common data pool.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Intent Receiver for android.intent.action.INSERT

2008-03-26 Thread Peli

Great that you liked the idea.

In fact, this would be useful for more than one application, so one
small background service could actually keep track of changes for
several applications. In this general sense, it would eventually be
interesting for our project as well (OpenIntents - 
http://code.google.com/p/openintents/
).

Some caveats:
* Whenever your service crashes or is stopped by the system or
whenever the phone is rebooted, you probably can not be sure that no
fields have changed in the mean-time, so then a full scan is necessary
anyway.
* Is it possible to get a hash of the whole database file, like an
md5? Would the system allow this? Then one would only have to rescan
the database if the hash changed while the service was off.

Peli


On Mar 27, 4:16 am, "Dexter's Brain" <[EMAIL PROTECTED]> wrote:
> Ok...this seems to be the only option to me now..I LL DO
> THAT.:-)
>
> On Mar 27, 5:20 am, Peli <[EMAIL PROTECTED]> wrote:
>
>
>
> > > You could use a content observer, but this would require your app
> > > always running to monitor for changes.
>
> > So one could probably write a lightweight background service that uses
> > a content observer to constantly monitor for changes, and notifies the
> > starting app only of those fields that have changed in the meantime.
>
> > Of course this effort would only make sense if the contact list is
> > long, and the app is used frequently...
>
> > Peli
>
> > > I'm not sure of a solution off-hand besides updating your list when
> > > your application starts.  We deliberately decided to not support
> > > having apps launched to be notified when data in a content provider
> > > changes, because that can quickly lead to bogging down the system as
> > > it launches a bunch of apps each time a piece of data changes.
>
> > > On Mar 26, 10:42 am, Peli <[EMAIL PROTECTED]> wrote:
>
> > > > Could a ContentObserver be registered for cases like 
> > > > these?http://code.google.com/android/reference/android/database/ContentObse..)
>
> > > > Peli
>
> > > > On Mar 26, 6:02 pm, "Dexter's Brain" <[EMAIL PROTECTED]> wrote:
>
> > > > > ok...Let me tell you what i wanted to doI have a local file that
> > > > > has information about all the contacts on the phone. And my
> > > > > application uses this local file and not the phone book data
> > > > > directly
>
> > > > > So I wanted that, whenever a new contact is added or an old one is
> > > > > deleted, I should run a program that would update this local file .
> > > > > But this seems to be impossible right now if there's no intent for
> > > > > this. I will have to do a check for changes in the phone book and
> > > > > update my local file, everytime my application startsThats a bit
> > > > > of overhead on my appand will also affect the startup time...
>
> > > > > hackbod wrote:
> > > > > > No, it has nothing to do with writing a contacts provider.  The
> > > > > > provider is the back-end data; an activity is the user interface.  
> > > > > > You
> > > > > > just write a new activity that operates on the existing content
> > > > > > provider.
>
> > > > > > On Mar 26, 3:24 am, Diego Torres Milano <[EMAIL PROTECTED]> wrote:
> > > > > > > If you want to write your own activity implementing those 
> > > > > > > actions, how
> > > > > > > would you do that ?
> > > > > > > Implementing a new whole ContactsProvider ?
> > > > > > > If you only want to replace, say INSERT ?
> > > > > > > How your new ContactsProvider can coexist with the standard one 
> > > > > > > if you
> > > > > > > want to extend its functionality ?
>
> > > > > > > On Mar 26, 7:35 am, hackbod <[EMAIL PROTECTED]> wrote:
>
> > > > > > > > The android.intent.action.INSERT and android.intent.action.VIEW
> > > > > > > > actions are not broadcasts, they are actions for starting 
> > > > > > > > activities
> > > > > > > > to show a UI to insert a new entry, or view an existing entry,
> > > > > > > > respectively.  Thus you don't register for them with a 
> > > > > > > > , you
> > > > > > > > launch them with startActivity().  (You can also write your own
> > > > > > > > activity implementing those actions to replace the standard UI, 
> > > > > > > > but
> > > > > > > > that's probably not what you are wanting.)
>
> > > > > > > > On Mar 25, 8:35 pm, "Dexter's Brain" <[EMAIL PROTECTED]> wrote:
>
> > > > > > > > > Thanks Megha...But, will it be provided in the subsequent 
> > > > > > > > > releases???
>
> > > > > > > > > Can you think of a situation where we would need this???
>
> > > > > > > > > Dexter.
>
> > > > > > > > > On Mar 26, 3:15 am, "Megha Joshi" <[EMAIL PROTECTED]> wrote:
>
> > > > > > > > > > Hi,
>
> > > > > > > > > > I don't think that the intents for contacts added and 
> > > > > > > > > > contacts deleted
> > > > > > > > > > intents are broadcasted.
> > > > > > > > > > So you cannot receive these intents.
>
> > > > > > > > > > Thanks,
> > > > > > > > > > Megha
>
> > > > > > > > > > On Mon, Mar 24, 2008 at 9:49 AM, Dexter's Brain

[android-developers] Re: Intent Receiver for android.intent.action.INSERT

2008-03-26 Thread Dexter's Brain

Ok...this seems to be the only option to me now..I LL DO
THAT.:-)

On Mar 27, 5:20 am, Peli <[EMAIL PROTECTED]> wrote:
> > You could use a content observer, but this would require your app
> > always running to monitor for changes.
>
> So one could probably write a lightweight background service that uses
> a content observer to constantly monitor for changes, and notifies the
> starting app only of those fields that have changed in the meantime.
>
> Of course this effort would only make sense if the contact list is
> long, and the app is used frequently...
>
> Peli
>
>
>
> > I'm not sure of a solution off-hand besides updating your list when
> > your application starts.  We deliberately decided to not support
> > having apps launched to be notified when data in a content provider
> > changes, because that can quickly lead to bogging down the system as
> > it launches a bunch of apps each time a piece of data changes.
>
> > On Mar 26, 10:42 am, Peli <[EMAIL PROTECTED]> wrote:
>
> > > Could a ContentObserver be registered for cases like 
> > > these?http://code.google.com/android/reference/android/database/ContentObse..)
>
> > > Peli
>
> > > On Mar 26, 6:02 pm, "Dexter's Brain" <[EMAIL PROTECTED]> wrote:
>
> > > > ok...Let me tell you what i wanted to doI have a local file that
> > > > has information about all the contacts on the phone. And my
> > > > application uses this local file and not the phone book data
> > > > directly
>
> > > > So I wanted that, whenever a new contact is added or an old one is
> > > > deleted, I should run a program that would update this local file .
> > > > But this seems to be impossible right now if there's no intent for
> > > > this. I will have to do a check for changes in the phone book and
> > > > update my local file, everytime my application startsThats a bit
> > > > of overhead on my appand will also affect the startup time...
>
> > > > hackbod wrote:
> > > > > No, it has nothing to do with writing a contacts provider.  The
> > > > > provider is the back-end data; an activity is the user interface.  You
> > > > > just write a new activity that operates on the existing content
> > > > > provider.
>
> > > > > On Mar 26, 3:24 am, Diego Torres Milano <[EMAIL PROTECTED]> wrote:
> > > > > > If you want to write your own activity implementing those actions, 
> > > > > > how
> > > > > > would you do that ?
> > > > > > Implementing a new whole ContactsProvider ?
> > > > > > If you only want to replace, say INSERT ?
> > > > > > How your new ContactsProvider can coexist with the standard one if 
> > > > > > you
> > > > > > want to extend its functionality ?
>
> > > > > > On Mar 26, 7:35 am, hackbod <[EMAIL PROTECTED]> wrote:
>
> > > > > > > The android.intent.action.INSERT and android.intent.action.VIEW
> > > > > > > actions are not broadcasts, they are actions for starting 
> > > > > > > activities
> > > > > > > to show a UI to insert a new entry, or view an existing entry,
> > > > > > > respectively.  Thus you don't register for them with a 
> > > > > > > , you
> > > > > > > launch them with startActivity().  (You can also write your own
> > > > > > > activity implementing those actions to replace the standard UI, 
> > > > > > > but
> > > > > > > that's probably not what you are wanting.)
>
> > > > > > > On Mar 25, 8:35 pm, "Dexter's Brain" <[EMAIL PROTECTED]> wrote:
>
> > > > > > > > Thanks Megha...But, will it be provided in the subsequent 
> > > > > > > > releases???
>
> > > > > > > > Can you think of a situation where we would need this???
>
> > > > > > > > Dexter.
>
> > > > > > > > On Mar 26, 3:15 am, "Megha Joshi" <[EMAIL PROTECTED]> wrote:
>
> > > > > > > > > Hi,
>
> > > > > > > > > I don't think that the intents for contacts added and 
> > > > > > > > > contacts deleted
> > > > > > > > > intents are broadcasted.
> > > > > > > > > So you cannot receive these intents.
>
> > > > > > > > > Thanks,
> > > > > > > > > Megha
>
> > > > > > > > > On Mon, Mar 24, 2008 at 9:49 AM, Dexter's Brain <[EMAIL 
> > > > > > > > > PROTECTED]>
> > > > > > > > > wrote:
>
> > > > > > > > > > Hello All,
>
> > > > > > > > > > I have an Intent Receiver which I will be triggered when a 
> > > > > > > > > > contact is
> > > > > > > > > > added or deleted.
>
> > > > > > > > > > My reciever properties in the androidmanifest.xml are as 
> > > > > > > > > > follows.
>
> > > > > > > > > >  
> > > > > > > > > >
> > > > > > > > > > > > > > > > > > > ndroid:name="android.intent.action.INSERT"
> > > > > > > > > > />
> > > > > > > > > > > > > > > > > > > android:name="android.intent.action.VIEW"
> > > > > > > > > > />
> > > > > > > > > >
> > > > > > > > > >
>
> > > > > > > > > > And in my Intent Reciever class, I have the following lines 
> > > > > > > > > > of code.
>
> > > > > > > > > > public class ContactAdded {
> > > > > > > > > >public void onReceiveIntent(Context context

[android-developers] Re: Intent Receiver for android.intent.action.INSERT

2008-03-26 Thread Dexter's Brain

What do you mean by sync???

On Mar 27, 12:12 am, jtaylor <[EMAIL PROTECTED]> wrote:
> Possibly using sync as well.
>
> - Juan
>
> On Mar 26, 1:42 pm, Peli <[EMAIL PROTECTED]> wrote:
>
> > Could a ContentObserver be registered for cases like 
> > these?http://code.google.com/android/reference/android/database/ContentObse..)
>
> > Peli
>
> > On Mar 26, 6:02 pm, "Dexter's Brain" <[EMAIL PROTECTED]> wrote:
>
> > > ok...Let me tell you what i wanted to doI have a local file that
> > > has information about all the contacts on the phone. And my
> > > application uses this local file and not the phone book data
> > > directly
>
> > > So I wanted that, whenever a new contact is added or an old one is
> > > deleted, I should run a program that would update this local file .
> > > But this seems to be impossible right now if there's no intent for
> > > this. I will have to do a check for changes in the phone book and
> > > update my local file, everytime my application startsThats a bit
> > > of overhead on my appand will also affect the startup time...
>
> > > hackbod wrote:
> > > > No, it has nothing to do with writing a contacts provider.  The
> > > > provider is the back-end data; an activity is the user interface.  You
> > > > just write a new activity that operates on the existing content
> > > > provider.
>
> > > > On Mar 26, 3:24 am, Diego Torres Milano <[EMAIL PROTECTED]> wrote:
> > > > > If you want to write your own activity implementing those actions, how
> > > > > would you do that ?
> > > > > Implementing a new whole ContactsProvider ?
> > > > > If you only want to replace, say INSERT ?
> > > > > How your new ContactsProvider can coexist with the standard one if you
> > > > > want to extend its functionality ?
>
> > > > > On Mar 26, 7:35 am, hackbod <[EMAIL PROTECTED]> wrote:
>
> > > > > > The android.intent.action.INSERT and android.intent.action.VIEW
> > > > > > actions are not broadcasts, they are actions for starting activities
> > > > > > to show a UI to insert a new entry, or view an existing entry,
> > > > > > respectively.  Thus you don't register for them with a , 
> > > > > > you
> > > > > > launch them with startActivity().  (You can also write your own
> > > > > > activity implementing those actions to replace the standard UI, but
> > > > > > that's probably not what you are wanting.)
>
> > > > > > On Mar 25, 8:35 pm, "Dexter's Brain" <[EMAIL PROTECTED]> wrote:
>
> > > > > > > Thanks Megha...But, will it be provided in the subsequent 
> > > > > > > releases???
>
> > > > > > > Can you think of a situation where we would need this???
>
> > > > > > > Dexter.
>
> > > > > > > On Mar 26, 3:15 am, "Megha Joshi" <[EMAIL PROTECTED]> wrote:
>
> > > > > > > > Hi,
>
> > > > > > > > I don't think that the intents for contacts added and contacts 
> > > > > > > > deleted
> > > > > > > > intents are broadcasted.
> > > > > > > > So you cannot receive these intents.
>
> > > > > > > > Thanks,
> > > > > > > > Megha
>
> > > > > > > > On Mon, Mar 24, 2008 at 9:49 AM, Dexter's Brain <[EMAIL 
> > > > > > > > PROTECTED]>
> > > > > > > > wrote:
>
> > > > > > > > > Hello All,
>
> > > > > > > > > I have an Intent Receiver which I will be triggered when a 
> > > > > > > > > contact is
> > > > > > > > > added or deleted.
>
> > > > > > > > > My reciever properties in the androidmanifest.xml are as 
> > > > > > > > > follows.
>
> > > > > > > > >  
> > > > > > > > >
> > > > > > > > > > > > > > > > > ndroid:name="android.intent.action.INSERT"
> > > > > > > > > />
> > > > > > > > > > > > > > > > > android:name="android.intent.action.VIEW"
> > > > > > > > > />
> > > > > > > > >
> > > > > > > > >
>
> > > > > > > > > And in my Intent Reciever class, I have the following lines 
> > > > > > > > > of code.
>
> > > > > > > > > public class ContactAdded {
> > > > > > > > >public void onReceiveIntent(Context context, Intent 
> > > > > > > > > intent){
> > > > > > > > >try{
> > > > > > > > >Log.i("Received Intent", 
> > > > > > > > > intent.getAction());
> > > > > > > > >}
> > > > > > > > >catch(Exception e){
> > > > > > > > >Log.i("Exception in 
> > > > > > > > > Intent",e.getLocalizedMessage
> > > > > > > > > ());
> > > > > > > > >}
> > > > > > > > >}
> > > > > > > > > }
>
> > > > > > > > > Now, when I try to add or delete a contact, I can see in the 
> > > > > > > > > LogCat
> > > > > > > > > that the required Intent is broadcast, but I don't see my 
> > > > > > > > > message
> > > > > > > > > "Received Intent" in the LogCat which I have coded in my 
> > > > > > > > > reciever
> > > > > > > > > class.
>
> > > > > > > > > Am I doing something wrong???
>
> > > > > > > > > Dexter.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the 

[android-developers] Re: Intent Receiver for android.intent.action.INSERT

2008-03-26 Thread Peli

> You could use a content observer, but this would require your app
> always running to monitor for changes.

So one could probably write a lightweight background service that uses
a content observer to constantly monitor for changes, and notifies the
starting app only of those fields that have changed in the meantime.

Of course this effort would only make sense if the contact list is
long, and the app is used frequently...

Peli

>
> I'm not sure of a solution off-hand besides updating your list when
> your application starts.  We deliberately decided to not support
> having apps launched to be notified when data in a content provider
> changes, because that can quickly lead to bogging down the system as
> it launches a bunch of apps each time a piece of data changes.
>
> On Mar 26, 10:42 am, Peli <[EMAIL PROTECTED]> wrote:
>
>
>
> > Could a ContentObserver be registered for cases like 
> > these?http://code.google.com/android/reference/android/database/ContentObse..)
>
> > Peli
>
> > On Mar 26, 6:02 pm, "Dexter's Brain" <[EMAIL PROTECTED]> wrote:
>
> > > ok...Let me tell you what i wanted to doI have a local file that
> > > has information about all the contacts on the phone. And my
> > > application uses this local file and not the phone book data
> > > directly
>
> > > So I wanted that, whenever a new contact is added or an old one is
> > > deleted, I should run a program that would update this local file .
> > > But this seems to be impossible right now if there's no intent for
> > > this. I will have to do a check for changes in the phone book and
> > > update my local file, everytime my application startsThats a bit
> > > of overhead on my appand will also affect the startup time...
>
> > > hackbod wrote:
> > > > No, it has nothing to do with writing a contacts provider.  The
> > > > provider is the back-end data; an activity is the user interface.  You
> > > > just write a new activity that operates on the existing content
> > > > provider.
>
> > > > On Mar 26, 3:24 am, Diego Torres Milano <[EMAIL PROTECTED]> wrote:
> > > > > If you want to write your own activity implementing those actions, how
> > > > > would you do that ?
> > > > > Implementing a new whole ContactsProvider ?
> > > > > If you only want to replace, say INSERT ?
> > > > > How your new ContactsProvider can coexist with the standard one if you
> > > > > want to extend its functionality ?
>
> > > > > On Mar 26, 7:35 am, hackbod <[EMAIL PROTECTED]> wrote:
>
> > > > > > The android.intent.action.INSERT and android.intent.action.VIEW
> > > > > > actions are not broadcasts, they are actions for starting activities
> > > > > > to show a UI to insert a new entry, or view an existing entry,
> > > > > > respectively.  Thus you don't register for them with a , 
> > > > > > you
> > > > > > launch them with startActivity().  (You can also write your own
> > > > > > activity implementing those actions to replace the standard UI, but
> > > > > > that's probably not what you are wanting.)
>
> > > > > > On Mar 25, 8:35 pm, "Dexter's Brain" <[EMAIL PROTECTED]> wrote:
>
> > > > > > > Thanks Megha...But, will it be provided in the subsequent 
> > > > > > > releases???
>
> > > > > > > Can you think of a situation where we would need this???
>
> > > > > > > Dexter.
>
> > > > > > > On Mar 26, 3:15 am, "Megha Joshi" <[EMAIL PROTECTED]> wrote:
>
> > > > > > > > Hi,
>
> > > > > > > > I don't think that the intents for contacts added and contacts 
> > > > > > > > deleted
> > > > > > > > intents are broadcasted.
> > > > > > > > So you cannot receive these intents.
>
> > > > > > > > Thanks,
> > > > > > > > Megha
>
> > > > > > > > On Mon, Mar 24, 2008 at 9:49 AM, Dexter's Brain <[EMAIL 
> > > > > > > > PROTECTED]>
> > > > > > > > wrote:
>
> > > > > > > > > Hello All,
>
> > > > > > > > > I have an Intent Receiver which I will be triggered when a 
> > > > > > > > > contact is
> > > > > > > > > added or deleted.
>
> > > > > > > > > My reciever properties in the androidmanifest.xml are as 
> > > > > > > > > follows.
>
> > > > > > > > >          
> > > > > > > > >                
> > > > > > > > >                         > > > > > > > > ndroid:name="android.intent.action.INSERT"
> > > > > > > > > />
> > > > > > > > >                         > > > > > > > > android:name="android.intent.action.VIEW"
> > > > > > > > > />
> > > > > > > > >                
> > > > > > > > >        
>
> > > > > > > > > And in my Intent Reciever class, I have the following lines 
> > > > > > > > > of code.
>
> > > > > > > > > public class ContactAdded {
> > > > > > > > >        public void onReceiveIntent(Context context, Intent 
> > > > > > > > > intent){
> > > > > > > > >                try{
> > > > > > > > >                        Log.i("Received Intent", 
> > > > > > > > > intent.getAction());
> > > > > > > > >                }
> > > > > > > > >                catch(Exception e){
> > > > > > > > >                        Log.i("Exception in 
> > > > > > > > > Intent

[android-developers] Re: Intent Receiver for android.intent.action.INSERT

2008-03-26 Thread hackbod

You could use a content observer, but this would require your app
always running to monitor for changes.

I'm not sure of a solution off-hand besides updating your list when
your application starts.  We deliberately decided to not support
having apps launched to be notified when data in a content provider
changes, because that can quickly lead to bogging down the system as
it launches a bunch of apps each time a piece of data changes.

On Mar 26, 10:42 am, Peli <[EMAIL PROTECTED]> wrote:
> Could a ContentObserver be registered for cases like 
> these?http://code.google.com/android/reference/android/database/ContentObse...http://code.google.com/android/reference/android/content/ContentResol...)
>
> Peli
>
> On Mar 26, 6:02 pm, "Dexter's Brain" <[EMAIL PROTECTED]> wrote:
>
> > ok...Let me tell you what i wanted to doI have a local file that
> > has information about all the contacts on the phone. And my
> > application uses this local file and not the phone book data
> > directly
>
> > So I wanted that, whenever a new contact is added or an old one is
> > deleted, I should run a program that would update this local file .
> > But this seems to be impossible right now if there's no intent for
> > this. I will have to do a check for changes in the phone book and
> > update my local file, everytime my application startsThats a bit
> > of overhead on my appand will also affect the startup time...
>
> > hackbod wrote:
> > > No, it has nothing to do with writing a contacts provider.  The
> > > provider is the back-end data; an activity is the user interface.  You
> > > just write a new activity that operates on the existing content
> > > provider.
>
> > > On Mar 26, 3:24 am, Diego Torres Milano <[EMAIL PROTECTED]> wrote:
> > > > If you want to write your own activity implementing those actions, how
> > > > would you do that ?
> > > > Implementing a new whole ContactsProvider ?
> > > > If you only want to replace, say INSERT ?
> > > > How your new ContactsProvider can coexist with the standard one if you
> > > > want to extend its functionality ?
>
> > > > On Mar 26, 7:35 am, hackbod <[EMAIL PROTECTED]> wrote:
>
> > > > > The android.intent.action.INSERT and android.intent.action.VIEW
> > > > > actions are not broadcasts, they are actions for starting activities
> > > > > to show a UI to insert a new entry, or view an existing entry,
> > > > > respectively.  Thus you don't register for them with a , you
> > > > > launch them with startActivity().  (You can also write your own
> > > > > activity implementing those actions to replace the standard UI, but
> > > > > that's probably not what you are wanting.)
>
> > > > > On Mar 25, 8:35 pm, "Dexter's Brain" <[EMAIL PROTECTED]> wrote:
>
> > > > > > Thanks Megha...But, will it be provided in the subsequent 
> > > > > > releases???
>
> > > > > > Can you think of a situation where we would need this???
>
> > > > > > Dexter.
>
> > > > > > On Mar 26, 3:15 am, "Megha Joshi" <[EMAIL PROTECTED]> wrote:
>
> > > > > > > Hi,
>
> > > > > > > I don't think that the intents for contacts added and contacts 
> > > > > > > deleted
> > > > > > > intents are broadcasted.
> > > > > > > So you cannot receive these intents.
>
> > > > > > > Thanks,
> > > > > > > Megha
>
> > > > > > > On Mon, Mar 24, 2008 at 9:49 AM, Dexter's Brain <[EMAIL 
> > > > > > > PROTECTED]>
> > > > > > > wrote:
>
> > > > > > > > Hello All,
>
> > > > > > > > I have an Intent Receiver which I will be triggered when a 
> > > > > > > > contact is
> > > > > > > > added or deleted.
>
> > > > > > > > My reciever properties in the androidmanifest.xml are as 
> > > > > > > > follows.
>
> > > > > > > >  
> > > > > > > >
> > > > > > > > > > > > > > > ndroid:name="android.intent.action.INSERT"
> > > > > > > > />
> > > > > > > > > > > > > > > android:name="android.intent.action.VIEW"
> > > > > > > > />
> > > > > > > >
> > > > > > > >
>
> > > > > > > > And in my Intent Reciever class, I have the following lines of 
> > > > > > > > code.
>
> > > > > > > > public class ContactAdded {
> > > > > > > >public void onReceiveIntent(Context context, Intent 
> > > > > > > > intent){
> > > > > > > >try{
> > > > > > > >Log.i("Received Intent", 
> > > > > > > > intent.getAction());
> > > > > > > >}
> > > > > > > >catch(Exception e){
> > > > > > > >Log.i("Exception in 
> > > > > > > > Intent",e.getLocalizedMessage
> > > > > > > > ());
> > > > > > > >}
> > > > > > > >}
> > > > > > > > }
>
> > > > > > > > Now, when I try to add or delete a contact, I can see in the 
> > > > > > > > LogCat
> > > > > > > > that the required Intent is broadcast, but I don't see my 
> > > > > > > > message
> > > > > > > > "Received Intent" in the LogCat which I have coded in my 
> > > > > > > > reciever
> > > > > > > > class.
>
> > 

[android-developers] Re: Intent Receiver for android.intent.action.INSERT

2008-03-26 Thread jtaylor

Possibly using sync as well.


- Juan

On Mar 26, 1:42 pm, Peli <[EMAIL PROTECTED]> wrote:
> Could a ContentObserver be registered for cases like 
> these?http://code.google.com/android/reference/android/database/ContentObse...http://code.google.com/android/reference/android/content/ContentResol...)
>
> Peli
>
> On Mar 26, 6:02 pm, "Dexter's Brain" <[EMAIL PROTECTED]> wrote:
>
> > ok...Let me tell you what i wanted to doI have a local file that
> > has information about all the contacts on the phone. And my
> > application uses this local file and not the phone book data
> > directly
>
> > So I wanted that, whenever a new contact is added or an old one is
> > deleted, I should run a program that would update this local file .
> > But this seems to be impossible right now if there's no intent for
> > this. I will have to do a check for changes in the phone book and
> > update my local file, everytime my application startsThats a bit
> > of overhead on my appand will also affect the startup time...
>
> > hackbod wrote:
> > > No, it has nothing to do with writing a contacts provider.  The
> > > provider is the back-end data; an activity is the user interface.  You
> > > just write a new activity that operates on the existing content
> > > provider.
>
> > > On Mar 26, 3:24 am, Diego Torres Milano <[EMAIL PROTECTED]> wrote:
> > > > If you want to write your own activity implementing those actions, how
> > > > would you do that ?
> > > > Implementing a new whole ContactsProvider ?
> > > > If you only want to replace, say INSERT ?
> > > > How your new ContactsProvider can coexist with the standard one if you
> > > > want to extend its functionality ?
>
> > > > On Mar 26, 7:35 am, hackbod <[EMAIL PROTECTED]> wrote:
>
> > > > > The android.intent.action.INSERT and android.intent.action.VIEW
> > > > > actions are not broadcasts, they are actions for starting activities
> > > > > to show a UI to insert a new entry, or view an existing entry,
> > > > > respectively.  Thus you don't register for them with a , you
> > > > > launch them with startActivity().  (You can also write your own
> > > > > activity implementing those actions to replace the standard UI, but
> > > > > that's probably not what you are wanting.)
>
> > > > > On Mar 25, 8:35 pm, "Dexter's Brain" <[EMAIL PROTECTED]> wrote:
>
> > > > > > Thanks Megha...But, will it be provided in the subsequent 
> > > > > > releases???
>
> > > > > > Can you think of a situation where we would need this???
>
> > > > > > Dexter.
>
> > > > > > On Mar 26, 3:15 am, "Megha Joshi" <[EMAIL PROTECTED]> wrote:
>
> > > > > > > Hi,
>
> > > > > > > I don't think that the intents for contacts added and contacts 
> > > > > > > deleted
> > > > > > > intents are broadcasted.
> > > > > > > So you cannot receive these intents.
>
> > > > > > > Thanks,
> > > > > > > Megha
>
> > > > > > > On Mon, Mar 24, 2008 at 9:49 AM, Dexter's Brain <[EMAIL 
> > > > > > > PROTECTED]>
> > > > > > > wrote:
>
> > > > > > > > Hello All,
>
> > > > > > > > I have an Intent Receiver which I will be triggered when a 
> > > > > > > > contact is
> > > > > > > > added or deleted.
>
> > > > > > > > My reciever properties in the androidmanifest.xml are as 
> > > > > > > > follows.
>
> > > > > > > >  
> > > > > > > >
> > > > > > > > > > > > > > > ndroid:name="android.intent.action.INSERT"
> > > > > > > > />
> > > > > > > > > > > > > > > android:name="android.intent.action.VIEW"
> > > > > > > > />
> > > > > > > >
> > > > > > > >
>
> > > > > > > > And in my Intent Reciever class, I have the following lines of 
> > > > > > > > code.
>
> > > > > > > > public class ContactAdded {
> > > > > > > >public void onReceiveIntent(Context context, Intent 
> > > > > > > > intent){
> > > > > > > >try{
> > > > > > > >Log.i("Received Intent", 
> > > > > > > > intent.getAction());
> > > > > > > >}
> > > > > > > >catch(Exception e){
> > > > > > > >Log.i("Exception in 
> > > > > > > > Intent",e.getLocalizedMessage
> > > > > > > > ());
> > > > > > > >}
> > > > > > > >}
> > > > > > > > }
>
> > > > > > > > Now, when I try to add or delete a contact, I can see in the 
> > > > > > > > LogCat
> > > > > > > > that the required Intent is broadcast, but I don't see my 
> > > > > > > > message
> > > > > > > > "Received Intent" in the LogCat which I have coded in my 
> > > > > > > > reciever
> > > > > > > > class.
>
> > > > > > > > Am I doing something wrong???
>
> > > > > > > > Dexter.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android

[android-developers] Re: Intent Receiver for android.intent.action.INSERT

2008-03-26 Thread Peli

Could a ContentObserver be registered for cases like these?
http://code.google.com/android/reference/android/database/ContentObserver.html
http://code.google.com/android/reference/android/content/ContentResolver.html#notifyChange(android.net.Uri,%20android.database.ContentObserver)

Peli

On Mar 26, 6:02 pm, "Dexter's Brain" <[EMAIL PROTECTED]> wrote:
> ok...Let me tell you what i wanted to doI have a local file that
> has information about all the contacts on the phone. And my
> application uses this local file and not the phone book data
> directly
>
> So I wanted that, whenever a new contact is added or an old one is
> deleted, I should run a program that would update this local file .
> But this seems to be impossible right now if there's no intent for
> this. I will have to do a check for changes in the phone book and
> update my local file, everytime my application startsThats a bit
> of overhead on my appand will also affect the startup time...
>
> hackbod wrote:
> > No, it has nothing to do with writing a contacts provider.  The
> > provider is the back-end data; an activity is the user interface.  You
> > just write a new activity that operates on the existing content
> > provider.
>
> > On Mar 26, 3:24 am, Diego Torres Milano <[EMAIL PROTECTED]> wrote:
> > > If you want to write your own activity implementing those actions, how
> > > would you do that ?
> > > Implementing a new whole ContactsProvider ?
> > > If you only want to replace, say INSERT ?
> > > How your new ContactsProvider can coexist with the standard one if you
> > > want to extend its functionality ?
>
> > > On Mar 26, 7:35 am, hackbod <[EMAIL PROTECTED]> wrote:
>
> > > > The android.intent.action.INSERT and android.intent.action.VIEW
> > > > actions are not broadcasts, they are actions for starting activities
> > > > to show a UI to insert a new entry, or view an existing entry,
> > > > respectively.  Thus you don't register for them with a , you
> > > > launch them with startActivity().  (You can also write your own
> > > > activity implementing those actions to replace the standard UI, but
> > > > that's probably not what you are wanting.)
>
> > > > On Mar 25, 8:35 pm, "Dexter's Brain" <[EMAIL PROTECTED]> wrote:
>
> > > > > Thanks Megha...But, will it be provided in the subsequent releases???
>
> > > > > Can you think of a situation where we would need this???
>
> > > > > Dexter.
>
> > > > > On Mar 26, 3:15 am, "Megha Joshi" <[EMAIL PROTECTED]> wrote:
>
> > > > > > Hi,
>
> > > > > > I don't think that the intents for contacts added and contacts 
> > > > > > deleted
> > > > > > intents are broadcasted.
> > > > > > So you cannot receive these intents.
>
> > > > > > Thanks,
> > > > > > Megha
>
> > > > > > On Mon, Mar 24, 2008 at 9:49 AM, Dexter's Brain <[EMAIL PROTECTED]>
> > > > > > wrote:
>
> > > > > > > Hello All,
>
> > > > > > > I have an Intent Receiver which I will be triggered when a 
> > > > > > > contact is
> > > > > > > added or deleted.
>
> > > > > > > My reciever properties in the androidmanifest.xml are as follows.
>
> > > > > > >  
> > > > > > >
> > > > > > > > > > > > > ndroid:name="android.intent.action.INSERT"
> > > > > > > />
> > > > > > > > > > > > > android:name="android.intent.action.VIEW"
> > > > > > > />
> > > > > > >
> > > > > > >
>
> > > > > > > And in my Intent Reciever class, I have the following lines of 
> > > > > > > code.
>
> > > > > > > public class ContactAdded {
> > > > > > >public void onReceiveIntent(Context context, Intent 
> > > > > > > intent){
> > > > > > >try{
> > > > > > >Log.i("Received Intent", 
> > > > > > > intent.getAction());
> > > > > > >}
> > > > > > >catch(Exception e){
> > > > > > >Log.i("Exception in 
> > > > > > > Intent",e.getLocalizedMessage
> > > > > > > ());
> > > > > > >}
> > > > > > >}
> > > > > > > }
>
> > > > > > > Now, when I try to add or delete a contact, I can see in the 
> > > > > > > LogCat
> > > > > > > that the required Intent is broadcast, but I don't see my message
> > > > > > > "Received Intent" in the LogCat which I have coded in my reciever
> > > > > > > class.
>
> > > > > > > Am I doing something wrong???
>
> > > > > > > Dexter.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Intent Receiver for android.intent.action.INSERT

2008-03-26 Thread Dexter's Brain

ok...Let me tell you what i wanted to doI have a local file that
has information about all the contacts on the phone. And my
application uses this local file and not the phone book data
directly

So I wanted that, whenever a new contact is added or an old one is
deleted, I should run a program that would update this local file .
But this seems to be impossible right now if there's no intent for
this. I will have to do a check for changes in the phone book and
update my local file, everytime my application startsThats a bit
of overhead on my appand will also affect the startup time...

hackbod wrote:
> No, it has nothing to do with writing a contacts provider.  The
> provider is the back-end data; an activity is the user interface.  You
> just write a new activity that operates on the existing content
> provider.
>
> On Mar 26, 3:24 am, Diego Torres Milano <[EMAIL PROTECTED]> wrote:
> > If you want to write your own activity implementing those actions, how
> > would you do that ?
> > Implementing a new whole ContactsProvider ?
> > If you only want to replace, say INSERT ?
> > How your new ContactsProvider can coexist with the standard one if you
> > want to extend its functionality ?
> >
> > On Mar 26, 7:35 am, hackbod <[EMAIL PROTECTED]> wrote:
> >
> > > The android.intent.action.INSERT and android.intent.action.VIEW
> > > actions are not broadcasts, they are actions for starting activities
> > > to show a UI to insert a new entry, or view an existing entry,
> > > respectively.  Thus you don't register for them with a , you
> > > launch them with startActivity().  (You can also write your own
> > > activity implementing those actions to replace the standard UI, but
> > > that's probably not what you are wanting.)
> >
> > > On Mar 25, 8:35 pm, "Dexter's Brain" <[EMAIL PROTECTED]> wrote:
> >
> > > > Thanks Megha...But, will it be provided in the subsequent releases???
> >
> > > > Can you think of a situation where we would need this???
> >
> > > > Dexter.
> >
> > > > On Mar 26, 3:15 am, "Megha Joshi" <[EMAIL PROTECTED]> wrote:
> >
> > > > > Hi,
> >
> > > > > I don't think that the intents for contacts added and contacts deleted
> > > > > intents are broadcasted.
> > > > > So you cannot receive these intents.
> >
> > > > > Thanks,
> > > > > Megha
> >
> > > > > On Mon, Mar 24, 2008 at 9:49 AM, Dexter's Brain <[EMAIL PROTECTED]>
> > > > > wrote:
> >
> > > > > > Hello All,
> >
> > > > > > I have an Intent Receiver which I will be triggered when a contact 
> > > > > > is
> > > > > > added or deleted.
> >
> > > > > > My reciever properties in the androidmanifest.xml are as follows.
> >
> > > > > >  
> > > > > >
> > > > > > > > > > > ndroid:name="android.intent.action.INSERT"
> > > > > > />
> > > > > > > > > > > android:name="android.intent.action.VIEW"
> > > > > > />
> > > > > >
> > > > > >
> >
> > > > > > And in my Intent Reciever class, I have the following lines of code.
> >
> > > > > > public class ContactAdded {
> > > > > >public void onReceiveIntent(Context context, Intent intent){
> > > > > >try{
> > > > > >Log.i("Received Intent", intent.getAction());
> > > > > >}
> > > > > >catch(Exception e){
> > > > > >Log.i("Exception in 
> > > > > > Intent",e.getLocalizedMessage
> > > > > > ());
> > > > > >}
> > > > > >}
> > > > > > }
> >
> > > > > > Now, when I try to add or delete a contact, I can see in the LogCat
> > > > > > that the required Intent is broadcast, but I don't see my message
> > > > > > "Received Intent" in the LogCat which I have coded in my reciever
> > > > > > class.
> >
> > > > > > Am I doing something wrong???
> >
> > > > > > Dexter.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Intent Receiver for android.intent.action.INSERT

2008-03-26 Thread hackbod

No, it has nothing to do with writing a contacts provider.  The
provider is the back-end data; an activity is the user interface.  You
just write a new activity that operates on the existing content
provider.

On Mar 26, 3:24 am, Diego Torres Milano <[EMAIL PROTECTED]> wrote:
> If you want to write your own activity implementing those actions, how
> would you do that ?
> Implementing a new whole ContactsProvider ?
> If you only want to replace, say INSERT ?
> How your new ContactsProvider can coexist with the standard one if you
> want to extend its functionality ?
>
> On Mar 26, 7:35 am, hackbod <[EMAIL PROTECTED]> wrote:
>
> > The android.intent.action.INSERT and android.intent.action.VIEW
> > actions are not broadcasts, they are actions for starting activities
> > to show a UI to insert a new entry, or view an existing entry,
> > respectively.  Thus you don't register for them with a , you
> > launch them with startActivity().  (You can also write your own
> > activity implementing those actions to replace the standard UI, but
> > that's probably not what you are wanting.)
>
> > On Mar 25, 8:35 pm, "Dexter's Brain" <[EMAIL PROTECTED]> wrote:
>
> > > Thanks Megha...But, will it be provided in the subsequent releases???
>
> > > Can you think of a situation where we would need this???
>
> > > Dexter.
>
> > > On Mar 26, 3:15 am, "Megha Joshi" <[EMAIL PROTECTED]> wrote:
>
> > > > Hi,
>
> > > > I don't think that the intents for contacts added and contacts deleted
> > > > intents are broadcasted.
> > > > So you cannot receive these intents.
>
> > > > Thanks,
> > > > Megha
>
> > > > On Mon, Mar 24, 2008 at 9:49 AM, Dexter's Brain <[EMAIL PROTECTED]>
> > > > wrote:
>
> > > > > Hello All,
>
> > > > > I have an Intent Receiver which I will be triggered when a contact is
> > > > > added or deleted.
>
> > > > > My reciever properties in the androidmanifest.xml are as follows.
>
> > > > >  
> > > > >
> > > > > > > > > ndroid:name="android.intent.action.INSERT"
> > > > > />
> > > > > > > > > android:name="android.intent.action.VIEW"
> > > > > />
> > > > >
> > > > >
>
> > > > > And in my Intent Reciever class, I have the following lines of code.
>
> > > > > public class ContactAdded {
> > > > >public void onReceiveIntent(Context context, Intent intent){
> > > > >try{
> > > > >Log.i("Received Intent", intent.getAction());
> > > > >}
> > > > >catch(Exception e){
> > > > >Log.i("Exception in 
> > > > > Intent",e.getLocalizedMessage
> > > > > ());
> > > > >}
> > > > >}
> > > > > }
>
> > > > > Now, when I try to add or delete a contact, I can see in the LogCat
> > > > > that the required Intent is broadcast, but I don't see my message
> > > > > "Received Intent" in the LogCat which I have coded in my reciever
> > > > > class.
>
> > > > > Am I doing something wrong???
>
> > > > > Dexter.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Intent Receiver for android.intent.action.INSERT

2008-03-26 Thread Diego Torres Milano

If you want to write your own activity implementing those actions, how
would you do that ?
Implementing a new whole ContactsProvider ?
If you only want to replace, say INSERT ?
How your new ContactsProvider can coexist with the standard one if you
want to extend its functionality ?

On Mar 26, 7:35 am, hackbod <[EMAIL PROTECTED]> wrote:
> The android.intent.action.INSERT and android.intent.action.VIEW
> actions are not broadcasts, they are actions for starting activities
> to show a UI to insert a new entry, or view an existing entry,
> respectively.  Thus you don't register for them with a , you
> launch them with startActivity().  (You can also write your own
> activity implementing those actions to replace the standard UI, but
> that's probably not what you are wanting.)
>
> On Mar 25, 8:35 pm, "Dexter's Brain" <[EMAIL PROTECTED]> wrote:
>
> > Thanks Megha...But, will it be provided in the subsequent releases???
>
> > Can you think of a situation where we would need this???
>
> > Dexter.
>
> > On Mar 26, 3:15 am, "Megha Joshi" <[EMAIL PROTECTED]> wrote:
>
> > > Hi,
>
> > > I don't think that the intents for contacts added and contacts deleted
> > > intents are broadcasted.
> > > So you cannot receive these intents.
>
> > > Thanks,
> > > Megha
>
> > > On Mon, Mar 24, 2008 at 9:49 AM, Dexter's Brain <[EMAIL PROTECTED]>
> > > wrote:
>
> > > > Hello All,
>
> > > > I have an Intent Receiver which I will be triggered when a contact is
> > > > added or deleted.
>
> > > > My reciever properties in the androidmanifest.xml are as follows.
>
> > > >  
> > > >
> > > > > > > ndroid:name="android.intent.action.INSERT"
> > > > />
> > > > > > > />
> > > >
> > > >
>
> > > > And in my Intent Reciever class, I have the following lines of code.
>
> > > > public class ContactAdded {
> > > >public void onReceiveIntent(Context context, Intent intent){
> > > >try{
> > > >Log.i("Received Intent", intent.getAction());
> > > >}
> > > >catch(Exception e){
> > > >Log.i("Exception in Intent",e.getLocalizedMessage
> > > > ());
> > > >}
> > > >}
> > > > }
>
> > > > Now, when I try to add or delete a contact, I can see in the LogCat
> > > > that the required Intent is broadcast, but I don't see my message
> > > > "Received Intent" in the LogCat which I have coded in my reciever
> > > > class.
>
> > > > Am I doing something wrong???
>
> > > > Dexter.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Intent Receiver for android.intent.action.INSERT

2008-03-25 Thread Dexter's Brain

Ya, thanks Hackbod.I dont think I can do what i want... :-)

On Mar 26, 11:35 am, hackbod <[EMAIL PROTECTED]> wrote:
> The android.intent.action.INSERT and android.intent.action.VIEW
> actions are not broadcasts, they are actions for starting activities
> to show a UI to insert a new entry, or view an existing entry,
> respectively.  Thus you don't register for them with a , you
> launch them with startActivity().  (You can also write your own
> activity implementing those actions to replace the standard UI, but
> that's probably not what you are wanting.)
>
> On Mar 25, 8:35 pm, "Dexter's Brain" <[EMAIL PROTECTED]> wrote:
>
> > Thanks Megha...But, will it be provided in the subsequent releases???
>
> > Can you think of a situation where we would need this???
>
> > Dexter.
>
> > On Mar 26, 3:15 am, "Megha Joshi" <[EMAIL PROTECTED]> wrote:
>
> > > Hi,
>
> > > I don't think that the intents for contacts added and contacts deleted
> > > intents are broadcasted.
> > > So you cannot receive these intents.
>
> > > Thanks,
> > > Megha
>
> > > On Mon, Mar 24, 2008 at 9:49 AM, Dexter's Brain <[EMAIL PROTECTED]>
> > > wrote:
>
> > > > Hello All,
>
> > > > I have an Intent Receiver which I will be triggered when a contact is
> > > > added or deleted.
>
> > > > My reciever properties in the androidmanifest.xml are as follows.
>
> > > >  
> > > >
> > > > > > > ndroid:name="android.intent.action.INSERT"
> > > > />
> > > > > > > />
> > > >
> > > >
>
> > > > And in my Intent Reciever class, I have the following lines of code.
>
> > > > public class ContactAdded {
> > > >public void onReceiveIntent(Context context, Intent intent){
> > > >try{
> > > >Log.i("Received Intent", intent.getAction());
> > > >}
> > > >catch(Exception e){
> > > >Log.i("Exception in Intent",e.getLocalizedMessage
> > > > ());
> > > >}
> > > >}
> > > > }
>
> > > > Now, when I try to add or delete a contact, I can see in the LogCat
> > > > that the required Intent is broadcast, but I don't see my message
> > > > "Received Intent" in the LogCat which I have coded in my reciever
> > > > class.
>
> > > > Am I doing something wrong???
>
> > > > Dexter.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Intent Receiver for android.intent.action.INSERT

2008-03-25 Thread hackbod

The android.intent.action.INSERT and android.intent.action.VIEW
actions are not broadcasts, they are actions for starting activities
to show a UI to insert a new entry, or view an existing entry,
respectively.  Thus you don't register for them with a , you
launch them with startActivity().  (You can also write your own
activity implementing those actions to replace the standard UI, but
that's probably not what you are wanting.)

On Mar 25, 8:35 pm, "Dexter's Brain" <[EMAIL PROTECTED]> wrote:
> Thanks Megha...But, will it be provided in the subsequent releases???
>
> Can you think of a situation where we would need this???
>
> Dexter.
>
> On Mar 26, 3:15 am, "Megha Joshi" <[EMAIL PROTECTED]> wrote:
>
> > Hi,
>
> > I don't think that the intents for contacts added and contacts deleted
> > intents are broadcasted.
> > So you cannot receive these intents.
>
> > Thanks,
> > Megha
>
> > On Mon, Mar 24, 2008 at 9:49 AM, Dexter's Brain <[EMAIL PROTECTED]>
> > wrote:
>
> > > Hello All,
>
> > > I have an Intent Receiver which I will be triggered when a contact is
> > > added or deleted.
>
> > > My reciever properties in the androidmanifest.xml are as follows.
>
> > >  
> > >
> > > > > />
> > > > > />
> > >
> > >
>
> > > And in my Intent Reciever class, I have the following lines of code.
>
> > > public class ContactAdded {
> > >public void onReceiveIntent(Context context, Intent intent){
> > >try{
> > >Log.i("Received Intent", intent.getAction());
> > >}
> > >catch(Exception e){
> > >Log.i("Exception in Intent",e.getLocalizedMessage
> > > ());
> > >}
> > >}
> > > }
>
> > > Now, when I try to add or delete a contact, I can see in the LogCat
> > > that the required Intent is broadcast, but I don't see my message
> > > "Received Intent" in the LogCat which I have coded in my reciever
> > > class.
>
> > > Am I doing something wrong???
>
> > > Dexter.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Intent Receiver for android.intent.action.INSERT

2008-03-25 Thread Dexter's Brain

Thanks Megha...But, will it be provided in the subsequent releases???

Can you think of a situation where we would need this???

Dexter.

On Mar 26, 3:15 am, "Megha Joshi" <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I don't think that the intents for contacts added and contacts deleted
> intents are broadcasted.
> So you cannot receive these intents.
>
> Thanks,
> Megha
>
> On Mon, Mar 24, 2008 at 9:49 AM, Dexter's Brain <[EMAIL PROTECTED]>
> wrote:
>
>
>
> > Hello All,
>
> > I have an Intent Receiver which I will be triggered when a contact is
> > added or deleted.
>
> > My reciever properties in the androidmanifest.xml are as follows.
>
> >  
> >
> > > />
> > > />
> >
> >
>
> > And in my Intent Reciever class, I have the following lines of code.
>
> > public class ContactAdded {
> >public void onReceiveIntent(Context context, Intent intent){
> >try{
> >Log.i("Received Intent", intent.getAction());
> >}
> >catch(Exception e){
> >Log.i("Exception in Intent",e.getLocalizedMessage
> > ());
> >}
> >}
> > }
>
> > Now, when I try to add or delete a contact, I can see in the LogCat
> > that the required Intent is broadcast, but I don't see my message
> > "Received Intent" in the LogCat which I have coded in my reciever
> > class.
>
> > Am I doing something wrong???
>
> > Dexter.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Intent Receiver for android.intent.action.INSERT

2008-03-25 Thread Megha Joshi
Hi,

I don't think that the intents for contacts added and contacts deleted
intents are broadcasted.
So you cannot receive these intents.

Thanks,
Megha


On Mon, Mar 24, 2008 at 9:49 AM, Dexter's Brain <[EMAIL PROTECTED]>
wrote:

>
> Hello All,
>
> I have an Intent Receiver which I will be triggered when a contact is
> added or deleted.
>
> My reciever properties in the androidmanifest.xml are as follows.
>
>  
>
> />
> />
>
>
>
> And in my Intent Reciever class, I have the following lines of code.
>
> public class ContactAdded {
>public void onReceiveIntent(Context context, Intent intent){
>try{
>Log.i("Received Intent", intent.getAction());
>}
>catch(Exception e){
>Log.i("Exception in Intent",e.getLocalizedMessage
> ());
>}
>}
> }
>
> Now, when I try to add or delete a contact, I can see in the LogCat
> that the required Intent is broadcast, but I don't see my message
> "Received Intent" in the LogCat which I have coded in my reciever
> class.
>
> Am I doing something wrong???
>
> Dexter.
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---