[android-developers] Further Question
I have further questions on this particular problem. Dimitri Plotnikov you wrote: 2) In releases of Android from Eclair through Gingerbread integrated editing of 3rd party contacts is poorly supported. The trick is to insert a data row, Edit in MyApp, which would take the user to your app and your app would then provide an editor activity. Also, there is no provision in the Contacts UI for creating new contacts in 3rd party accounts. We have fixed those issues in Honeycomb. Now you can specify two activities in your metadata xml file: one for creating new contacts and one for editing existing ones and voilà! - you have seamless integration. Of course, it's a bit too soon to rely on Honeycomb as the dominant version of Android ;-) So for now you will need to either go with the described hack or only allow creation/editing of contacts through your app. Could you please give me the exact name of the metadata xml file (authenticator.xml or syncadapter.xml) and the names of the attribute you mentioned? I searched references twice but didn't find the attributes :/ I also have problems with the workaround, because the intent includes no informations about which contact was clicked? Do I need to specify something in my data-row so it is send via extrabundle, or something? Any help is greatly appreciated :) -- 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 android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Grab phonebook-contacts via ContactsContract-API
Very nice! Thanks Pepijn, that's what I was looking for :) Maybe you could explain in a few words, how I'm supposed to manage the http session of this account? I need to store two cookies and the sessionID to maintain my session. Where to store them and how can other applications reuse the session? In the documentation I only see the getAuthToken-Method, but it's only returning a bundle with one single field KEY_AUTHTOKEN?!? On 26 Jan., 22:16, Pepijn Van Eeckhoudt pep...@vaneeckhoudt.net wrote: I think AccountManager#setUserData is what you should use to store additional account data. At least that's what I did in my application and it works as I expected. Pepijn Op 26 Jan 2011 om 21:58 heeft Dmitri Plotnikov dplotni...@google.com het volgende geschreven: I think it is just a string that AccountManager can store for you. How you use it is up to you. I don't know what URL you need to keep per account, but can't you pretend that the URL is an auth token? I am not 100% on this, because I haven't used authtoken this way myself. On Jan 26, 2011 12:43 PM, L0rdAli3n 42.john.doe.1...@googlemail.com wrote: I thought the authentication token is something specific to the session, like a sessionID or something? I'm a little bit confused now. On 26 Jan., 20:41, Dmitri Plotnikov dplotni...@google.com wrote: Take a look at AccountManager docs:http://developer.android.com/intl/en/reference/android/accounts/Accou... AccountManager supports the notion of authentication token, which is what I think you need. Cheers, - Dmitri On Wed, Jan 26, 2011 at 10:26 AM, L0rdAli3n 42.john.doe.1...@googlemail.com wrote: Ok, I'm about to write the SyncAdapter part of my App. Due to the fact that I have a special case, I'm a little bit stuck: Additional to the username/password I need to store a URL on a per account base! How I'm supposed to store this extra information, attached to an account? Thanks for your help an patience Dmitri! On 23 Jan., 19:00, Dmitri Plotnikov dplotni...@google.com wrote: Using ContentObserver for sync adapters does not sound like a good idea. There are several reasons for that: 1. Data change notifications are not delivered to processes that are not running. So if your sync adapter is not running for one reason or another (and the system kills processes when it needs resources), then you won't get a notification. 2. ContactsProvider sends only general whole adapter notifications, meaning that when any data element in the database changes it sends a notification to all observers regardless of what URIs they registered for. For example, somebody's presence in Talk changes - you will get a notification. Most of these notifications will have nothing to do with the changes you need to sync, but there is no way for the adapter to tell. 3. Having the sync adapter running at all times is a major waste of resources. Fortunately, the sync framework is designed to overcome all these issues. SyncManager manages sync adapters, calls them at the best time from the system's perspective, throttles their activities etc. Sync adapters themselves rely on RawContact.DIRTY flag and the ContactsContract.CALLER_IS_SYNCADAPTER parameter to find and process incremental changes. There are examples of how that's done. The most comprehensive example is probably the Exchange (IAS) sync adapter that you can find here: http://android.git.kernel.org/?p=platform/packages/apps/Email.git;a=t... Cheers, On Fri, Jan 21, 2011 at 11:57 PM, himanshu jain himanshu@gmail.com wrote: Hi Dmitri ,@LordAli3n I have couple of questions please spare some time or guide me direction 1) Can we use syncAdapter to get data of a row of raw_contact table if that row has been affected (i.e added/deleted/edited). I know ContentObserver notify whenever raw_content table changes in onChange() method but we dont know which row has been changed ( to put this in another way if we add how would we know and if deleted we still get it through deleted flag in raw_contact table but how about edited one??). 2) when we get notification in ContentObserver can we fire requestSync (Account account, String authority, Bundle extras) to start Sync ?? how we can get data of raw_contact affected by contact application using these to parameters . 3) Is sync started by ContentProvider API ?? whenever change to it happens ??. How?? does it pass any useful uri or data that has been changed in raw_contacts??. 4) How do we come to know if in the process of syncing something went wrong?? does it started again
[android-developers] Re: Grab phonebook-contacts via ContactsContract-API
Ok, I'm about to write the SyncAdapter part of my App. Due to the fact that I have a special case, I'm a little bit stuck: Additional to the username/password I need to store a URL on a per account base! How I'm supposed to store this extra information, attached to an account? Thanks for your help an patience Dmitri! On 23 Jan., 19:00, Dmitri Plotnikov dplotni...@google.com wrote: Using ContentObserver for sync adapters does not sound like a good idea. There are several reasons for that: 1. Data change notifications are not delivered to processes that are not running. So if your sync adapter is not running for one reason or another (and the system kills processes when it needs resources), then you won't get a notification. 2. ContactsProvider sends only general whole adapter notifications, meaning that when any data element in the database changes it sends a notification to all observers regardless of what URIs they registered for. For example, somebody's presence in Talk changes - you will get a notification. Most of these notifications will have nothing to do with the changes you need to sync, but there is no way for the adapter to tell. 3. Having the sync adapter running at all times is a major waste of resources. Fortunately, the sync framework is designed to overcome all these issues. SyncManager manages sync adapters, calls them at the best time from the system's perspective, throttles their activities etc. Sync adapters themselves rely on RawContact.DIRTY flag and the ContactsContract.CALLER_IS_SYNCADAPTER parameter to find and process incremental changes. There are examples of how that's done. The most comprehensive example is probably the Exchange (IAS) sync adapter that you can find here: http://android.git.kernel.org/?p=platform/packages/apps/Email.git;a=t... Cheers, On Fri, Jan 21, 2011 at 11:57 PM, himanshu jain himanshu@gmail.comwrote: Hi Dmitri ,@LordAli3n I have couple of questions please spare some time or guide me direction 1) Can we use syncAdapter to get data of a row of raw_contact table if that row has been affected (i.e added/deleted/edited). I know ContentObserver notify whenever raw_content table changes in onChange() method but we dont know which row has been changed ( to put this in another way if we add how would we know and if deleted we still get it through deleted flag in raw_contact table but how about edited one??). 2) when we get notification in ContentObserver can we fire requestSync (Account account, String authority, Bundle extras) to start Sync ?? how we can get data of raw_contact affected by contact application using these to parameters . 3) Is sync started by ContentProvider API ?? whenever change to it happens ??. How?? does it pass any useful uri or data that has been changed in raw_contacts??. 4) How do we come to know if in the process of syncing something went wrong?? does it started again automatically??. thanks any help appreciated !! On Jan 19, 7:31 am, BoD bodl...@gmail.com wrote: If I may intervene. It seems to me that the OP wants to synchronize contacts using the sync adapters APIs, and therefore wants to have his own account type, and raw contacts in this account. But that means that when the user first starts using this app, this account will be empty, and will synchronize... nothing. Instead, they probably expect to synchronize the contacts already on their phones (in the local account, or, more probably, in the gmail account). -- BoD On Jan 19, 9:02 am, Dmitri Plotnikov dplotni...@google.com wrote: I am sorry. I guess I just don't understand the requirements. I thought you were writing a sync adapter. Sync adapters all deal with their own accounts. Google sync adapter deals with google accounts, exchange adapter with exchange accounts and so on. If you are thinking of writing a sync adapter that would handle data already handled by some other sync adapter, it is probably a bad idea. The framework is not designed to have multiple sync adapters handling the same data: only one syncadapter can take advantage of data versioning. This why I suggested that if you are writing a sync adapter, you should introduce a new account type. This is how they are supposed to work by design. Cheers, Dmitri On Jan 18, 2011 5:43 PM, L0rdAli3n 42.john.doe.1...@googlemail.com wrote: Thanks for your answer Dmitri! Could you explain in few words, how I can use the contacts the user stored on his phone, which in fact all have already an account_type, by introducing my own accout_type? On 14 Jan., 16:26, Dmitri Plotnikov dplotni...@google.com wrote: I don't fully understand your requirements, but it shouldn't matter what _other_ data is in the contacts DB. A sync adapter should only deal with its own data. Why
[android-developers] Re: Grab phonebook-contacts via ContactsContract-API
I thought the authentication token is something specific to the session, like a sessionID or something? I'm a little bit confused now. On 26 Jan., 20:41, Dmitri Plotnikov dplotni...@google.com wrote: Take a look at AccountManager docs:http://developer.android.com/intl/en/reference/android/accounts/Accou... AccountManager supports the notion of authentication token, which is what I think you need. Cheers, - Dmitri On Wed, Jan 26, 2011 at 10:26 AM, L0rdAli3n 42.john.doe.1...@googlemail.com wrote: Ok, I'm about to write the SyncAdapter part of my App. Due to the fact that I have a special case, I'm a little bit stuck: Additional to the username/password I need to store a URL on a per account base! How I'm supposed to store this extra information, attached to an account? Thanks for your help an patience Dmitri! On 23 Jan., 19:00, Dmitri Plotnikov dplotni...@google.com wrote: Using ContentObserver for sync adapters does not sound like a good idea. There are several reasons for that: 1. Data change notifications are not delivered to processes that are not running. So if your sync adapter is not running for one reason or another (and the system kills processes when it needs resources), then you won't get a notification. 2. ContactsProvider sends only general whole adapter notifications, meaning that when any data element in the database changes it sends a notification to all observers regardless of what URIs they registered for. For example, somebody's presence in Talk changes - you will get a notification. Most of these notifications will have nothing to do with the changes you need to sync, but there is no way for the adapter to tell. 3. Having the sync adapter running at all times is a major waste of resources. Fortunately, the sync framework is designed to overcome all these issues. SyncManager manages sync adapters, calls them at the best time from the system's perspective, throttles their activities etc. Sync adapters themselves rely on RawContact.DIRTY flag and the ContactsContract.CALLER_IS_SYNCADAPTER parameter to find and process incremental changes. There are examples of how that's done. The most comprehensive example is probably the Exchange (IAS) sync adapter that you can find here: http://android.git.kernel.org/?p=platform/packages/apps/Email.git;a=t... Cheers, On Fri, Jan 21, 2011 at 11:57 PM, himanshu jain himanshu@gmail.com wrote: Hi Dmitri ,@LordAli3n I have couple of questions please spare some time or guide me direction 1) Can we use syncAdapter to get data of a row of raw_contact table if that row has been affected (i.e added/deleted/edited). I know ContentObserver notify whenever raw_content table changes in onChange() method but we dont know which row has been changed ( to put this in another way if we add how would we know and if deleted we still get it through deleted flag in raw_contact table but how about edited one??). 2) when we get notification in ContentObserver can we fire requestSync (Account account, String authority, Bundle extras) to start Sync ?? how we can get data of raw_contact affected by contact application using these to parameters . 3) Is sync started by ContentProvider API ?? whenever change to it happens ??. How?? does it pass any useful uri or data that has been changed in raw_contacts??. 4) How do we come to know if in the process of syncing something went wrong?? does it started again automatically??. thanks any help appreciated !! On Jan 19, 7:31 am, BoD bodl...@gmail.com wrote: If I may intervene. It seems to me that the OP wants to synchronize contacts using the sync adapters APIs, and therefore wants to have his own account type, and raw contacts in this account. But that means that when the user first starts using this app, this account will be empty, and will synchronize... nothing. Instead, they probably expect to synchronize the contacts already on their phones (in the local account, or, more probably, in the gmail account). -- BoD On Jan 19, 9:02 am, Dmitri Plotnikov dplotni...@google.com wrote: I am sorry. I guess I just don't understand the requirements. I thought you were writing a sync adapter. Sync adapters all deal with their own accounts. Google sync adapter deals with google accounts, exchange adapter with exchange accounts and so on. If you are thinking of writing a sync adapter that would handle data already handled by some other sync adapter, it is probably a bad idea. The framework is not designed to have multiple sync adapters handling the same data: only one syncadapter can take advantage of data versioning. This why I suggested that if you are writing a sync adapter, you should
[android-developers] Re: Grab phonebook-contacts via ContactsContract-API
Thanks for those informationen Dmitri. To make it clear: I just want to sync the contacts a user saved on his local phonebook/adressbook (no gmailcontacts, no facebookcontacts, no twittercontacts) with openXChange. Do I really need a new AccountType then? So a user will have a openXChange-Contacts, beside the phonebook-Contacts? On 19 Jan., 09:02, Dmitri Plotnikov dplotni...@google.com wrote: I am sorry. I guess I just don't understand the requirements. I thought you were writing a sync adapter. Sync adapters all deal with their own accounts. Google sync adapter deals with google accounts, exchange adapter with exchange accounts and so on. If you are thinking of writing a sync adapter that would handle data already handled by some other sync adapter, it is probably a bad idea. The framework is not designed to have multiple sync adapters handling the same data: only one syncadapter can take advantage of data versioning. This why I suggested that if you are writing a sync adapter, you should introduce a new account type. This is how they are supposed to work by design. Cheers, Dmitri On Jan 18, 2011 5:43 PM, L0rdAli3n 42.john.doe.1...@googlemail.com wrote: Thanks for your answer Dmitri! Could you explain in few words, how I can use the contacts the user stored on his phone, which in fact all have already an account_type, by introducing my own accout_type? On 14 Jan., 16:26, Dmitri Plotnikov dplotni...@google.com wrote: I don't fully understand your requirements, but it shouldn't matter what _other_ data is in the contacts DB. A sync adapter should only deal with its own data. Why not introduce a new account type for this purpose? Cheers, Dmitri On Jan 14, 2011 5:16 AM, L0rdAli3n 42.john.doe.1...@googlemail.com wrote: Hey, I'm totally stuck with the ContactsContract-API. Point is that I want only mess around with the Contacts saved in the local phonebook. But it seems that every vendor but its own account_type for those contacts. And its even worse. The AccountManager isn't even aware of all account_types?!? For example on my HTC Desire with HTC Sense, the account_type all local contacts are saved in is: com.htc.android.pcsc. But when I grab a list of all available accounts from the AccountManager: This account is not in the list!? I also tested it on a Samsung Galaxy. Same here: The AccountManager is not aware of the account_type used for local phonebookcontacts. The whole story is that I wan't to write a app to sync my locale phonebook with OpenXchange. I guess I got that whole new ContactsContract-API wrong, but I don't see any other way, then using RawContacts. Due to that I have to care about the account_type, which is in fact a total mess. Hopefully someone can point me in the right direction. Every hint is highly appreciated. -- 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 android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com android-developers%2bunsubscr...@googlegroups.comandroid-developers%252bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- 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 android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- 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 android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Android Contacts
Thanks for the link. Unfortunately I wasn't able to find the query. 3.614 lines of code are really hard to understand. Could you assist me? On 16 Jan., 08:05, Zsolt Vasvari zvasv...@gmail.com wrote: Hi, the source code to the Contacts app is available here: http://android.git.kernel.org/?p=platform/packages/apps/Contacts.git;... As Dmitri mentioned it, if you see the desired list in the Contacts app, dig into the source and find out what query it is issuing the ContactsProvider. And then you can issue the same query and get the same result. On Jan 12, 5:13 am, L0rdAli3n 42.john.doe.1...@googlemail.com wrote: Hi Community, I'm working on an app right now, which should handle the users contacts. But I have a basic problem: When I grab a list of all contacts from the ContactsContract.Contacts.CONTENT_URI I expect to get a list of all aggregated/merged contacts. For example the list should contain a contact John, Doe. Which also has a facebook contact an a twitter contact joined in this one John, Doe. But on the list of contacts grabbed from ContactsContract.Contacts.CONTENT_URI I exptect only John, Doe. My problem is that when I do grab a list of contacts from ContactsContract.Contacts.CONTENT_URI I have a listitem for every single contact, so instead of one single item John, Doe I have three: - John, Doe (gmail) - Doe John (facebook) - Johnny (twitter) Why is that so and is there any way to get the list of aggegrated contacts? -- 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 android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Android Contacts
Thanks for the link. Unfortunately I wasn't able to find the query. 3.614 lines of code are really hard to understand. Could you assist me? On 16 Jan., 08:05, Zsolt Vasvari zvasv...@gmail.com wrote: Hi, the source code to the Contacts app is available here: http://android.git.kernel.org/?p=platform/packages/apps/Contacts.git;... As Dmitri mentioned it, if you see the desired list in the Contacts app, dig into the source and find out what query it is issuing the ContactsProvider. And then you can issue the same query and get the same result. On Jan 12, 5:13 am, L0rdAli3n 42.john.doe.1...@googlemail.com wrote: Hi Community, I'm working on an app right now, which should handle the users contacts. But I have a basic problem: When I grab a list of all contacts from the ContactsContract.Contacts.CONTENT_URI I expect to get a list of all aggregated/merged contacts. For example the list should contain a contact John, Doe. Which also has a facebook contact an a twitter contact joined in this one John, Doe. But on the list of contacts grabbed from ContactsContract.Contacts.CONTENT_URI I exptect only John, Doe. My problem is that when I do grab a list of contacts from ContactsContract.Contacts.CONTENT_URI I have a listitem for every single contact, so instead of one single item John, Doe I have three: - John, Doe (gmail) - Doe John (facebook) - Johnny (twitter) Why is that so and is there any way to get the list of aggegrated contacts? -- 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 android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Grab phonebook-contacts via ContactsContract-API
Thanks for your answer Dmitri! Could you explain in few words, how I can use the contacts the user stored on his phone, which in fact all have already an account_type, by introducing my own accout_type? On 14 Jan., 16:26, Dmitri Plotnikov dplotni...@google.com wrote: I don't fully understand your requirements, but it shouldn't matter what _other_ data is in the contacts DB. A sync adapter should only deal with its own data. Why not introduce a new account type for this purpose? Cheers, Dmitri On Jan 14, 2011 5:16 AM, L0rdAli3n 42.john.doe.1...@googlemail.com wrote: Hey, I'm totally stuck with the ContactsContract-API. Point is that I want only mess around with the Contacts saved in the local phonebook. But it seems that every vendor but its own account_type for those contacts. And its even worse. The AccountManager isn't even aware of all account_types?!? For example on my HTC Desire with HTC Sense, the account_type all local contacts are saved in is: com.htc.android.pcsc. But when I grab a list of all available accounts from the AccountManager: This account is not in the list!? I also tested it on a Samsung Galaxy. Same here: The AccountManager is not aware of the account_type used for local phonebookcontacts. The whole story is that I wan't to write a app to sync my locale phonebook with OpenXchange. I guess I got that whole new ContactsContract-API wrong, but I don't see any other way, then using RawContacts. Due to that I have to care about the account_type, which is in fact a total mess. Hopefully someone can point me in the right direction. Every hint is highly appreciated. -- 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 android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- 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 android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Grab phonebook-contacts via ContactsContract-API
Hey, I'm totally stuck with the ContactsContract-API. Point is that I want only mess around with the Contacts saved in the local phonebook. But it seems that every vendor but its own account_type for those contacts. And its even worse. The AccountManager isn't even aware of all account_types?!? For example on my HTC Desire with HTC Sense, the account_type all local contacts are saved in is: com.htc.android.pcsc. But when I grab a list of all available accounts from the AccountManager: This account is not in the list!? I also tested it on a Samsung Galaxy. Same here: The AccountManager is not aware of the account_type used for local phonebookcontacts. The whole story is that I wan't to write a app to sync my locale phonebook with OpenXchange. I guess I got that whole new ContactsContract-API wrong, but I don't see any other way, then using RawContacts. Due to that I have to care about the account_type, which is in fact a total mess. Hopefully someone can point me in the right direction. Every hint is highly appreciated. -- 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 android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Android Contacts
Hi Community, I'm working on an app right now, which should handle the users contacts. But I have a basic problem: When I grab a list of all contacts from the ContactsContract.Contacts.CONTENT_URI I expect to get a list of all aggregated/merged contacts. For example the list should contain a contact John, Doe. Which also has a facebook contact an a twitter contact joined in this one John, Doe. But on the list of contacts grabbed from ContactsContract.Contacts.CONTENT_URI I exptect only John, Doe. My problem is that when I do grab a list of contacts from ContactsContract.Contacts.CONTENT_URI I have a listitem for every single contact, so instead of one single item John, Doe I have three: - John, Doe (gmail) - Doe John (facebook) - Johnny (twitter) Why is that so and is there any way to get the list of aggegrated contacts? -- 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 android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en