Android integrating apk with an application
I am new to android. I am making an application for reading the pdf files. For this i want to integrate some existing open source apk with my application. Please suggest and give me example, how i can bind the apk with my application and how to call the apk from within the application activity. I think there should be something used by intent but not sure. Also if there can be any code to develop our own pdf reader, please share. Thanks.
Answers
As i know, integrating an apk directly from another application is not possible. This can not be achieved unless you know the source code of the apk. If this is the case. Now its like this if you want to invoke Application2 from Application1 then you have to add one more intent filter in the Application2, you have to define an action in Application2 Manifest like
<action android:name="com.app2.intent.action.INVOKE_APP2"/>
and then define intent in your Application1 as
Intent i=new Intent("com.app2.intent.action.INVOKE_APP2"); startActivity(i);
It only possible if you know exactly what kind of intent (Action, data, type) the activities in that apk would be able to react.
You can use either startActivity(intent) or startActivityForResult(intent) once you know what the intent should be like.