[android-developers] Re: Getting Object from ContentProvider
Am 12.08.2010 16:17, schrieb Kostya Vasilyev: The serialization can be any kind you want or are able to implement. It can be Java Serialization, sure. But doesn't have to be. I am not at all familiar with Jena, so this is sort of generally speaking ...for relatively simple objects with few references to others, which also belong to one of a few known classes, you could serialize by hand to your own format. Perhaps even a string (you'd then be able to use string methods in ContentValues / Cursor). ...if these objects are large, can belong to a whole lot of different subclasses, and are only useful when connected to a whole bunch of others (forming an in-memory graph), then you might have to rethink your approach, so you don't have to shuffle a lot of data around. Perhaps define a higher-level interface that supports the operations you'd be doing on a Statement / Resource if you had one of them. Implement it using a Binder or Intents, or a ContentProvider (URI matching is very flexible). That'll keep the in-memory object graph inside one process, with others querying just for the needed operations. Thank you, so I think the last approach is the best one for this case. Natanael Just my RUB 0,02. -- Kostya 12.08.2010 17:47, Natanael Arndt пишет: Thank you, it should be Jena-Statements and Resources, which I want to provide. Do the Objects need to implement Serializable for your first way? Natanael Am 12.08.2010 13:42, schrieb Kostya Vasilyev: Natanael, It just really depends on what this data structure is, how big it is, and how it's used. One of the primitive types supposed by Cursor is Blob, so you have: byte[] getBlob(int columnIndex) And a matching method in ContentValues: void put(String key, byte[] value) To convert between your data structure and a byte array you can use Java serialization, or any other format. Another way is to break down your data structure into individual pieces and store and retrieve them individually. Define various ContentProvider URIs to access different parts of the data structure. -- Kostya 12.08.2010 15:12, Natanael Arndt пишет: Hello, I have a custom class, which represents my data-structure. This custom class is in a normal Java-library, which is included in both projects. I have one Project with a ContentProvider which provides this data to Activities of other Projects. And an other Project with an Activity, where I want to handle this data in objects of this custom class. How can I get this data to the Activity? The Cursor [1] only supports primitive Types. [1] http://developer.android.com/reference/android/database/Cursor.html -- 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] Getting Object from ContentProvider
Hello, I have a custom class, which represents my data-structure. This custom class is in a normal Java-library, which is included in both projects. I have one Project with a ContentProvider which provides this data to Activities of other Projects. And an other Project with an Activity, where I want to handle this data in objects of this custom class. How can I get this data to the Activity? The Cursor [1] only supports primitive Types. [1] http://developer.android.com/reference/android/database/Cursor.html -- 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: Getting Object from ContentProvider
Thank you, it should be Jena-Statements and Resources, which I want to provide. Do the Objects need to implement Serializable for your first way? Natanael Am 12.08.2010 13:42, schrieb Kostya Vasilyev: Natanael, It just really depends on what this data structure is, how big it is, and how it's used. One of the primitive types supposed by Cursor is Blob, so you have: byte[] getBlob(int columnIndex) And a matching method in ContentValues: void put(String key, byte[] value) To convert between your data structure and a byte array you can use Java serialization, or any other format. Another way is to break down your data structure into individual pieces and store and retrieve them individually. Define various ContentProvider URIs to access different parts of the data structure. -- Kostya 12.08.2010 15:12, Natanael Arndt пишет: Hello, I have a custom class, which represents my data-structure. This custom class is in a normal Java-library, which is included in both projects. I have one Project with a ContentProvider which provides this data to Activities of other Projects. And an other Project with an Activity, where I want to handle this data in objects of this custom class. How can I get this data to the Activity? The Cursor [1] only supports primitive Types. [1] http://developer.android.com/reference/android/database/Cursor.html -- 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] ContentProvider and query
Hello, is it possible, to query an ContentProvider from within an other ContentProvider? Natanael -- 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] ContentProvider onCreate() onDestroy()
Hello, when writing a ContentProvider I have to implement the onCreate()-method, in which I establish my database connection. But to write the changes I made to the database I have to close the database on some point. Does something like a onDestroy()-method exist for ContentProviders or is there some intent I have to listen to, which is fired before killing my process? Natanael -- 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: ContentProvider onCreate() onDestroy()
Thank you, but when should I or is than the best time to save database changes to the filesystem? Natanael On 30.06.2010 18:36, Dianne Hackborn wrote: Content providers are never destroyed. They exist for the entire lifetime of their process. On Wed, Jun 30, 2010 at 2:19 AM, Natanael Arndt natana...@gmx.de mailto:natana...@gmx.de wrote: Hello, when writing a ContentProvider I have to implement the onCreate()-method, in which I establish my database connection. But to write the changes I made to the database I have to close the database on some point. Does something like a onDestroy()-method exist for ContentProviders or is there some intent I have to listen to, which is fired before killing my process? Natanael -- 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 mailto:android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com mailto:android-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Dianne Hackborn Android framework engineer hack...@android.com mailto:hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. -- 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 -- 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: ContentProvider onCreate() onDestroy()
Thank you I have found the model.commit() method for Jena-Models now. Natanael On 30.06.2010 20:49, Dianne Hackborn wrote: You shouldn't leave open transactions. Generally the expectation is that upon returning from an insert or whatever the corresponding transaction has been committed. On Wed, Jun 30, 2010 at 11:30 AM, Natanael Arndt natana...@gmx.de mailto:natana...@gmx.de wrote: Thank you, but when should I or is than the best time to save database changes to the filesystem? Natanael On 30.06.2010 18:36, Dianne Hackborn wrote: Content providers are never destroyed. They exist for the entire lifetime of their process. On Wed, Jun 30, 2010 at 2:19 AM, Natanael Arndt natana...@gmx.de mailto:natana...@gmx.de mailto:natana...@gmx.de mailto:natana...@gmx.de wrote: Hello, when writing a ContentProvider I have to implement the onCreate()-method, in which I establish my database connection. But to write the changes I made to the database I have to close the database on some point. Does something like a onDestroy()-method exist for ContentProviders or is there some intent I have to listen to, which is fired before killing my process? Natanael -- 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 mailto:android-developers@googlegroups.com mailto:android-developers@googlegroups.com mailto:android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com mailto:android-developers%2bunsubscr...@googlegroups.com mailto:android-developers%2bunsubscr...@googlegroups.com mailto:android-developers%252bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Dianne Hackborn Android framework engineer hack...@android.com mailto:hack...@android.com mailto:hack...@android.com mailto:hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. -- 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 mailto:android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com mailto:android-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 mailto:android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com mailto:android-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Dianne Hackborn Android framework engineer hack...@android.com mailto:hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. -- 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 -- 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] Write an own Contacts Content Provider
Hello, how can I write an own Content Provider, which Provides Contact-information. I've seen this on a Phone with HTC Sense, when you create a new contact, you can decide wether it is a google-contact or a sim-contact. Maybe this is the same as the facebook, last.fm and VZ-Netzwerke-App uses. Because I want to add Contacts, which can be read with the Contacts-App and other apps, but I don't want to mix them up with the other contacts and also don't want to merge them, they should only be stored in my separate Contacts-Database. Do I need the ContactsContract-Class or is there an other way, which maybe also works on Android 1.5. Thank you Natanael -- 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: Does eclair run on ADP2
Am 10.03.10 18:39, schrieb Mike dg: There is not an official developer rom available. And I don't think you can build it yourself without massive modifications yet. (Could be wrong on that account) You should be able to find a handful of unofficial roms based on 2.0/2.1 that will run on an ADP2. http://forum.xda-developers.com/forumdisplay.php?f=493 Thgey are in various states of usability though. Mike dg On Mar 10, 4:03 am, Natanael Arndtnatana...@gmx.de wrote: Hello, I want to buy the ADP2 (HTC Magic) but I wonder if also Android 2.1 is available for it. Because I've heard that eclair doesn't run on HTC Magic as you can get it in the stores. Natanael Thank you, what do you think, how big is the chance, that there will come an official update for the ADP2? Natanael -- 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] What phone to buy for development?
Hello, I want to start developing an application for android and want to buy a phone for this task. But I don't really know, which one would be the best. I've heard of the ADP2 from Google, which is nearly the same as the HTC Magic. But what exactly are the differences? Is it possible to install the images from http://developer.htc.com/google-io-device.html also on the HTC Magic? If I would decide to buy the ADP2 from Google it costs 399$ + 150$ shipment to Germany, is there a dealer in Germany selling the original ADP2 device? Or is there an other Android phone for about 399$ available (in Germany), which is good for development? Thank you Natanael -- 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: What phone to buy for development?
Am 11.03.10 15:24, schrieb Mark Murphy: Natanael Arndt wrote: Hello, I want to start developing an application for android and want to buy a phone for this task. But I don't really know, which one would be the best. I've heard of the ADP2 from Google, which is nearly the same as the HTC Magic. But what exactly are the differences? Is it possible to install the images from http://developer.htc.com/google-io-device.html also on the HTC Magic? If I would decide to buy the ADP2 from Google it costs 399$ + 150$ shipment to Germany, is there a dealer in Germany selling the original ADP2 device? Or is there an other Android phone for about 399$ available (in Germany), which is good for development? Just about any phone is fine for Android application development. You only need ADP1 or ADP2 if you want to replace the firmware (i.e., load your own modified copy of the Android OS). So, I would find one that is available for sale in Germany, either through a carrier (e.g., T-Mobile) or through other channels. Thank you, is it also possible to install an other Android version on a consumer phone, e.g the version from here[1] if I don't want the vodafone branding on the HTC Magic? Natanael [1] http://developer.htc.com/google-io-device.html -- 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: What phone to buy for development?
Am 11.03.10 15:42, schrieb Mark Murphy: Natanael Arndt wrote: is it also possible to install an other Android version on a consumer phone, e.g the version from here[1] if I don't want the vodafone branding on the HTC Magic? Not usually. You can root some phones and install alternative firmware (e.g., OpenEclair.com). And when I have rooted the HTC Magic is it equivalent to the ADP2? Or are there more differences? -- 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] Does eclair run on ADP2
Hello, I want to buy the ADP2 (HTC Magic) but I wonder if also Android 2.1 is available for it. Because I've heard that eclair doesn't run on HTC Magic as you can get it in the stores. Natanael -- 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