Make CustomObject implement Parcelable. Declare ICustomObject.aidl. This way, AIDL tool could generate stub implementation for your CustomObject. That's how you can transfetr it via IPC.
On Aug 23, 1:25 pm, Giordano <jorda...@gmail.com> wrote: > Hi everyone :) > > it's the first message I post in this group, even though I lurked and > posted from time to time in #android-dev. > I have a question about IPC. > > At work we are developing 2 applications: > 1 - a service running in background and preparing some data. > 2 - an application that takes the data from the service and uses it > for something. > > The problem is that service 1) should be able to pass an object like > > class CustomObject{ > > private AnotherCustomObject aco = new AnotherCustomObject(); > > public AnotherCustomObject getObject(){ > return aco; > } > > } > > and application 2) should be able to retrieve such object and call the > method getObject() > > How do I achieve this? I was thinking of doing like so: > 1) create an aidl file for AnotherCustomObject and for CustomObject. > Something like ICustomObject and IAnotherCustomObject. > 2) on the service 1) side, make CustomObject implement ICustomObject > and Parcelable and AnotherCustomObject implement IAnotherCustomObject > and Parcelable and write the implementation of the methods. > 3) on the application 2) side, import the aidl files and use the > automatically generated interfaces to manipulate the custom objects. > > Is this the correct way to do this in your opinion? In point 2) should > I extend the stubs instead? > > Thanks in advance for your hints. > > Giordano -- 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