How to invoke a service of one APK in another APK

by Dianne Hackborn » Sat, 07 Feb 2009 04:05:12 GMT


Sponsored Links
 You have to compile the generated AIDL interfaces into each application, and
make sure the service is exported with android:exported="true" if it doesn't
declare any intent filters.

You didn't actually say what exact problem you are hitting, though, so I
can't offer much more help than that.






-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support.  All such questions should be posted on public
forums, where I and others can see and answer them.

--~--~---------~--~----~------------~-------~--~----~



How to invoke a service of one APK in another APK

by Sunil . Maharana » Mon, 09 Feb 2009 13:36:18 GMT


 Hi,

My objective:
I want to develop two .apks as .apk#1 and .apk#2. My .apk#1 has one serice 
as serv#1 and .apk#2 has serive as .serv#2. I wanna to invoke the serv#1 
of .apk#1  in serv#2 of .apk#2.   For time being i have created two .apks 
and thinking how to commucate between them, i mean how i should proceed to 
invoke serv# of .apk#1 in my .apk#2.

Can  someone please help me what all steps i need to follow to achive my 
objective? If someone can share a sample example if you had that would be 
really helpful for me.

I have lots of questions in my mind mentioned below  but not sure whether 
all my understanding are correct or not  as per my objective -- 
- As per my knowledge both .apk#1 and .apk#2 will run in different 
process, so i might require the IPC mechanism.
- I also need to expose the interface using AIDL. Is it require to 
generate and compile the AIDL interface for both the .apk#1 and .apk#2.
- How i can include the .apk#1 in .apk#2,  is it like package .apk#1??

Thanks & Regards,
Sunil




Dianne Hackborn <hack...@android.com> 
Sent by: android-developers@googlegroups.com
02/07/2009 01:35 AM
Please respond to
android-developers@googlegroups.com


To
android-developers@googlegroups.com
cc

Subject
[android-developers] Re: How to invoke a service of one APK in  another 
APK






You have to compile the generated AIDL interfaces into each application, 
and make sure the service is exported with android:exported="true" if it 
doesn't declare any intent filters.

You didn't actually say what exact problem you are hitting, though, so I 
can't offer much more help than that.

On Fri, Feb 6, 2009 at 4:44 AM, Android <sunil.mahar...@lntinfotech.com> 



Hello All....

I have one query regarding how to use the services of different APK in
my APK. Suppose i have created APK1 having services(serv1, serv2) and
APK2. I want to invoke the serv1 in APK2. I have tried by using aidl
files also.

These my question:
- How we can access services of different .apk.
- How to use the aidl file, is the aidl file should be added in
the .apk whose service we want to use.

I have gone through the below links, but couldn't find any concret
idea of how to impliment.
 http://code.google.com/android/reference/aidl.html 
 http://minicompact.com/mobiletalk/?tag=android-service 
 http://minicompact.com/mobiletalk/?p=18 
 http://code.google.com/android/reference/android/os/IBinder.html 

 It would be appreciable If someone answer my question.

-Kumar





-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to 
provide private support.  All such questions should be posted on public 
forums, where I and others can see and answer them.




______________________________________________________________________


______________________________________________________________________
--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


How to invoke a service of one APK in another APK

by Sunil . Maharana » Tue, 10 Feb 2009 21:24:41 GMT


 Hi,

My objective:
I want to develop two .apks as .apk#1 and .apk#2. My .apk#1 has one serice 
as serv#1 and .apk#2 has serive as .serv#2. I wanna to invoke the serv#1 
of .apk#1  in serv#2 of .apk#2.   For time being i have created two .apks 
and thinking how to commucate between them, i mean how i should proceed to 
invoke serv# of .apk#1 in my .apk#2.

Can  someone please help me what all steps i need to follow to achive my 
objective? If someone can share a sample example if you had that would be 
really helpful for me.

I have lots of questions in my mind mentioned below  but not sure whether 
all my understanding are correct or not  as per my objective -- 
- As per my knowledge both .apk#1 and .apk#2 will run in different 
process, so i might require the IPC mechanism.
- I also need to expose the interface using AIDL. Is it require to 
generate and compile the AIDL interface for both the .apk#1 and .apk#2.
- How i can include the .apk#1 in .apk#2,  is it like package .apk#1??

Thanks & Regards,
Sunil




Dianne Hackborn <hack...@android.com> 
Sent by: android-developers@googlegroups.com
02/07/2009 01:35 AM
Please respond to
android-developers@googlegroups.com


To
android-developers@googlegroups.com
cc

Subject
[android-developers] Re: How to invoke a service of one APK in  another 
APK






You have to compile the generated AIDL interfaces into each application, 
and make sure the service is exported with android:exported="true" if it 
doesn't declare any intent filters.

You didn't actually say what exact problem you are hitting, though, so I 
can't offer much more help than that.

On Fri, Feb 6, 2009 at 4:44 AM, Android <sunil.mahar...@lntinfotech.com> 



Hello All....

I have one query regarding how to use the services of different APK in
my APK. Suppose i have created APK1 having services(serv1, serv2) and
APK2. I want to invoke the serv1 in APK2. I have tried by using aidl
files also.

These my question:
- How we can access services of different .apk.
- How to use the aidl file, is the aidl file should be added in
the .apk whose service we want to use.

I have gone through the below links, but couldn't find any concret
idea of how to impliment.
 http://code.google.com/android/reference/aidl.html 
 http://minicompact.com/mobiletalk/?tag=android-service 
 http://minicompact.com/mobiletalk/?p=18 
 http://code.google.com/android/reference/android/os/IBinder.html 

 It would be appreciable If someone answer my question.

-Kumar





-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to 
provide private support.  All such questions should be posted on public 
forums, where I and others can see and answer them.




______________________________________________________________________


______________________________________________________________________
--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. dispatchTouchEvent works differently when finger hold on touch screen in G1 & emulator

Hi, All


I found event handler: dispatchTouchEvent(MotionEvent) works
differently between G1 & emulator when finger is holding on touch
screen.

I have a class inherited from RelativeLayout and override public
boolean dispatchTouchEvent(MotionEvent event) method. After I touch &
hold on the touch screen, in emulator I got MotionEvent.ACTION_DOWN
event only. But in G1, I got MotionEvent.ACTION_DOWN first and then
MotionEvent.ACTION_MOVE continuously, even if I try my best to hold
still my finger tip.

I wonder if this is because there is pressure field in the
MotionEvent. Because the {*filter*} pressure on finger tip changes
continuously with heart beat, so no matter how still my finger is, the
pressure value still changes. But I wonder if all kinds of touch
screen have pressure factor in their touch event? Will all touch
screen driver emit touch event continuously when finger is holding on
the screen?

Please help, Thanks!


--~--~---------~--~----~------------~-------~--~----~

2. Read SMS that are already stored (from the MMS application)

Hi everybody,

I am modifying the MMS application. I want to read all the SMS that
are already received. I cannot find any contentprovider or any ways to
read them. Any suggestions ?

I want to achieve something like :

SmsMessage[] messages = getAllStoredSMS();
for (SmsMessage msg : messages) {
  //SMS analysis
}

:::::
PS: my goal is NOT to read the incoming messages that could be done by
reading this tutorial : http://www.helloandroid.com/node/159?page=0%2C1

Thank you a lot for your help.
Deniz
--~--~---------~--~----~------------~-------~--~----~

3. Setting Single Choice Dialog Checked Item

4. Some stacktraces do not show up in logcat output

5. Webview Question: onCreate always get called when activity comes to foreground

6. How to add a .so library to prelink map?

7. Camera HAL Crashes in android running on beagle