1. Are you ready for the Galaxy S20? Here is everything we know so far!

Import external Java class in Android Studio

Discussion in 'Android Development' started by DonaldDuck313, Aug 9, 2021.

  1. DonaldDuck313

    DonaldDuck313 Lurker
    Thread Starter

    I have an Android project with its root folder at `C:\Users\myname\Documents\MyApplication`. In one of the Java files in my project, I would like to use a Java class located in the file `C:\Libraries\SomeClass.java`. How do I do this?

    I tried going to File > New > Import Module... and selecting `C:\Libraries` as "Source directory", but it says it's not a valid project. But I don't want to import an entire project, I just want to import one file.
     


    #1 DonaldDuck313, Aug 9, 2021
    Last edited: Aug 9, 2021

    1. Download the Forums for Android™ app!


      Download

       
Loading...
Similar Threads - Import external Java
  1. unet
    Replies:
    0
    Views:
    321
  2. Yaron21
    Replies:
    8
    Views:
    505
  3. Motorhomer14
    Replies:
    0
    Views:
    747
  4. mawallace
    Replies:
    1
    Views:
    640
  5. raywood
    Replies:
    1
    Views:
    591
  6. EvolvingBot
    Replies:
    0
    Views:
    420
  7. phage
    Replies:
    0
    Views:
    1,119
  8. ashleedawg
    Replies:
    6
    Views:
    7,139
  9. Drmth
    Replies:
    0
    Views:
    976
  10. Jaapyse
    Replies:
    0
    Views:
    362

Share This Page

Loading...