I'm trying to pass a PublicKey
object from a service to an activity. However, the Aidl
doesn't seem to support the PublicKey
type. Any ideas on how to do this?
Asked
Active
Viewed 180 times
1

Marvin Pinto
- 30,138
- 7
- 37
- 54

user1118463
- 21
- 2
1 Answers
0
If you already have your public key you should put it into the /res/raw/ folder and retrieve it from there. Or store it in filesystem activity.getFilesDir().getAbsolutePath()
would be your path. You can also use - pass Objects over IPC as described here in the article http://developer.android.com/guide/developing/tools/aidl.html
hope this helps.

Sergey Benner
- 4,421
- 2
- 22
- 29
-
@Benner Thank you very much for you answer . in fact , I should have mentioned that the service and the activity does not belong to the same application , so I guess that your first suggestion does not apply in this case . I checked your link to the android developpers forum. I think i have to use the parcel and parcelable . But since i'm a newbie in android , i still don't get how to use them correctly , especially with the java PublicKey object . Thanks again. – user1118463 Jan 17 '12 at 12:25
-
you can save the Object into a byte array and set it to parcel then get it from there. Here're some posts about parcels and byte arrays http://stackoverflow.com/questions/6058003/beautiful-way-to-read-file-into-byte-array-in-java and http://stackoverflow.com/questions/1626667/how-to-use-parcel-in-android – Sergey Benner Jan 17 '12 at 12:34