Integrating another Android application in my own application

I'm new to Android app development, so sorry for the long explanation. In any case, I have already developed my application (it works successfully). Now I want to integrate an open source application (quiz) into my application. Thus, when the user clicks a button in my application, he then launches the quiz application.

I learned from here (Denis Nikolayenko’s answer) that there is a way to do this by converting the quiz application to a .jar file and adding it to my current project. I've already done it; before adding the .jar file to the Build Path (and it appears in the reference libraries) as indicated here . In addition, the .jar file is also checked on the Order and Export tab.

Now I have a problem integrating the .jar file into one of my buttons (so that the quiz application starts when I click the button, as mentioned earlier). Is there a way to integrate the .jar file into a button (I could not find any sample code anywhere)? Or is it the concept of executing a .jar file incorrectly all together?

If the concept is wrong, how do I integrate the quiz app into my app? I am using Eclipse.

+4
source share
1 answer

I found out from here (Denis Nikolayenko’s answer) that there is a way to do this by converting the quiz application to a .jar file and adding it to my current project.

It will not be enough, in all likelihood. The JAR file contains only code, not Android resources, and the other application probably has some resources.

I've already done it; before adding the .jar file to the Build Path (and it will appear in the reference libraries) as indicated here.

Answers to this question are out of date for more than a year. Just add the JAR to the libs/ project directory and do not change the build path manually.

Is there a way to integrate the .jar file into a button (I could not find any sample code anywhere)? Or is it the concept of executing a .jar file incorrectly all together?

This is "all wrong together."

If the concept is wrong, how do I integrate the quiz app into my app?

Personally, I would recommend not to do this in the first place if you are "new to Android app development." I would recommend you more time getting to know Android.

If you insist on this:

Step # 0: undo everything you have done so far (e.g. by placing a JAR in your project)

Step # 1: Do one of the following:

Step # 2: add the appropriate entries from another project manifest to your own application manifest, such as <activity> and <uses-permission> .

Step # 3: If necessary, for example, using the proposed button click, call startActivity() to start the action from another project, instead of starting one of your own projects.

+8
source

Source: https://habr.com/ru/post/1481580/


All Articles