Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If you're importing a library as source code into a Gradle-based project, then at the moment there's no super-easy way to do it (sorry, it's on the to-do list, see <a href="https://code.google.com/p/android/issues/detail?id=62122" rel="noreferrer">https://code.google.com/p/android/issues/detail?id=62122</a>) so you'll have to author your own build file for the library. Actually, it might be easier to use the New Module wizard to set up the build file and directory structure, then you can trim it down and copy the files over. This set of steps should get you up and running. It seems like a lot of steps but it should hopefully go pretty quick.</p> <ol> <li>From the <b>File</b> menu, choose <b>New Module...</b></li> <li>From the wizard that comes up, choose <b>Android Library</b></li> <li>From the next page of the wizard, give it the module name HoloCircularProgressBar, and uncheck the options for <b>Create custom launcher icon</b> and <b>Create activity</b>.</li> <li>Click Finish on the wizard.</li> </ol> <p>It should add the new module to your project, so you'll end up with something like this:</p> <p><img src="https://i.stack.imgur.com/PmBPS.png" alt="Project view after adding new empty library"></p> <ol start="5"> <li>Delete everything inside the src/main folder.</li> <li>Now copy <code>AndroidManfiest.xml</code>, <code>ic_launcher-web.png</code>, <code>res</code>, and <code>src</code> from the HoloCircularProgressBar source into the <code>src/main</code> folder.</li> <li>Rename the <code>src</code> folder that you just copied into <code>src/main</code> to <code>java</code>.</li> <li>The New Module wizard left some things in the <code>build.gradle</code> file in your <code>HoloCircularProgresBar</code> module/directory (make sure you're editing that one, not the one for your main app module) we don't need. Remove the <code>dependencies</code> block and the <code>release</code> block.</li> </ol> <p>At this point you should hopefully be able to build successfully. Now if you want to actually use the module:</p> <ol start="9"> <li>Go to <b>File</b> > <b>Project Structure...</b> > <b>Modules</b> > <i>Your main module</i> > <b>Dependencies</b>. </li> <li>Click on the + button to add a dependency, choose <b>Module dependency</b>, and select <code>HoloCircularProgressBar</code> from the list.</li> </ol> <p>Now <code>import</code> statements and usages of the library should work, and you should be good to go.</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. VO
      singulars
      1. This table or related slice is empty.
    2. 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