[android-developers] Crashed service restarted by system doesn't call onStart
I have noticed that if my background service crashes the system will automatically restart the service after 5 seconds. This is great, but I have noticed that only the onCreate method gets called and not the onStart method. Does this mean the service is properly restarted or do I need to do something special in the onCreate method to make sure it is? I did have my initialisation logic in the onCreate method and my starting service logic in the onStart method but it looks like it will all have to be in the onCreate method. Many thanks, Charles --~--~-~--~~~---~--~~ 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: Caching a content provider
I have submitted a RFE to cache the content provider. If you are keen to see this implemented add your vote. http://code.google.com/p/android/issues/detail?id=1907 Charles On Feb 2, 5:07 pm, Charles Harley charles.har...@googlemail.com wrote: Unfortunately I have to use thecontentprovider, I have already optimized it a little using bulkInsert but I hadn't thought of deleting several entries at once. If there definitely isn't a way tocachethecontentprovider then I'll submit it as a feature request. Charles On Feb 2, 4:58 pm, Peli peli0...@googlemail.com wrote: Good question. Indeed the URI has to be resolved with each query, update, delete. If the ContentProvider supports it, you may try whether you are not faster 1) by deleting several entries at once: using delete on the whole table, with appropriate selection clause 2) by inserting several entries at once using bulkInsert (if the contentprovider supports this):http://code.google.com/android/reference/android/content/ContentProvi...[]%29 Finally, if you have so many changes to do, do they really have to go into a ContentProvider? Maybe you are better off with a private database: If you don't need to share data amongst multiple applications you can use a database directly via SQLiteDatabase. http://code.google.com/android/reference/android/content/ContentProvi... Peli On Feb 2, 5:42 pm, Charles Harley charles.har...@googlemail.com wrote: I am performing hundreds of calls to a singlecontentprovider to perform various insertions, updates and deletions. After profiling my application, I have noticed that the ContentResolver class takes approx. 30ms to retrieve the correspondingcontentprovider object for each call. Is there anyway to retrieve a reference to thecontent provider rather then going through the ContentResolver every time? Many thanks, Charles --~--~-~--~~~---~--~~ 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] Caching a content provider
I am performing hundreds of calls to a single content provider to perform various insertions, updates and deletions. After profiling my application, I have noticed that the ContentResolver class takes approx. 30ms to retrieve the corresponding content provider object for each call. Is there anyway to retrieve a reference to the content provider rather then going through the ContentResolver every time? Many thanks, Charles --~--~-~--~~~---~--~~ 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: Caching a content provider
Unfortunately I have to use the content provider, I have already optimized it a little using bulkInsert but I hadn't thought of deleting several entries at once. If there definitely isn't a way to cache the content provider then I'll submit it as a feature request. Charles On Feb 2, 4:58 pm, Peli peli0...@googlemail.com wrote: Good question. Indeed the URI has to be resolved with each query, update, delete. If the ContentProvider supports it, you may try whether you are not faster 1) by deleting several entries at once: using delete on the whole table, with appropriate selection clause 2) by inserting several entries at once using bulkInsert (if the content provider supports this):http://code.google.com/android/reference/android/content/ContentProvi...[]%29 Finally, if you have so many changes to do, do they really have to go into a ContentProvider? Maybe you are better off with a private database: If you don't need to share data amongst multiple applications you can use a database directly via SQLiteDatabase. http://code.google.com/android/reference/android/content/ContentProvi... Peli On Feb 2, 5:42 pm, Charles Harley charles.har...@googlemail.com wrote: I am performing hundreds of calls to a single content provider to perform various insertions, updates and deletions. After profiling my application, I have noticed that the ContentResolver class takes approx. 30ms to retrieve the corresponding content provider object for each call. Is there anyway to retrieve a reference to the content provider rather then going through the ContentResolver every time? Many thanks, Charles --~--~-~--~~~---~--~~ 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] Validate preferences and save multiple changes at the end of a group of edits
I am very impressed with the shared preferences framework within Android and the ability to specify preferences in an XML file. However, I would like to perform validation on preferences, particularly on preferences within a child preference screen. Is this possible and if so is there a standard way of displaying an error message to the user? I am also hoping to group any changes made within the child preference screen and save them all at once. Is this possible? The reason for doing it this way is that the preferences are all related and when they are changed this sets into motion a series of events within my application. If each change the user makes is saved straight away then the events will be triggered multiple times because I am using a preferences listener to pick up the changes. Many thanks, Charles --~--~-~--~~~---~--~~ 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] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---