Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <blockquote> <p>I have learnt from here (answer by Denys Nikolayenko) that there is a way to do it by converting the quiz app into .jar file, and adding it into my current project.</p> </blockquote> <p>That will be insufficient, in all likelihood. A JAR file only contains code, not Android resources, and the other app probably has some resources.</p> <blockquote> <p>I have already done that; to the point of adding the .jar file to Build Path (and it appears in Referenced Libraries) as stated here. </p> </blockquote> <p>The answers on that question have been out of date for over a year. Just add JARs to your project's <code>libs/</code> directory, and do not modify the build path manually.</p> <blockquote> <p>Is there a way to integrate a .jar file in a button (I couldn't find any sample code anywhere)? Or is this concept of executing a .jar file wrong all-together?</p> </blockquote> <p>It is "wrong all-together".</p> <blockquote> <p>If the concept is wrong, how do I integrate the quiz app into my app? </p> </blockquote> <p>Personally, I would recommend against doing it in the first place, if you are "a total newbie to Android app development". I would recommend that you spend more time getting familiar with Android first.</p> <p>If you insist upon doing this:</p> <p>Step #0: Undo everything you did so far (e.g., putting the JAR in your project)</p> <p>Step #1: Do one of the following:</p> <ul> <li><p>Copy all of the Java source code and all of the resources from the other project into your own, or</p></li> <li><p><a href="http://developer.android.com/tools/projects/projects-eclipse.html#SettingUpLibraryProject" rel="noreferrer">Convert the open source project into an Android library project</a>, then <a href="http://developer.android.com/tools/projects/projects-eclipse.html#ReferencingLibraryProject" rel="noreferrer">attach that Android library project to your own app's project</a></p></li> </ul> <p>Step #2: Add relevant entries from the other project's manifest into your own app's manifest, such as <code>&lt;activity&gt;</code> elements and <code>&lt;uses-permission&gt;</code> elements.</p> <p>Step #3: As needed, such as from your proposed button click, call <code>startActivity()</code> to start up an activity from the other project, rather than starting up one of your own projects.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload