如何在Android Studio中导入java包 [英] How to import a java package in Android Studio

查看:89
本文介绍了如何在Android Studio中导入java包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 android 新手,我想将 jfftpack 导入到我在 android studio 中的项目中,但我不知道如何导入它.

I'm new in android, and I want to import the jfftpack to my project in android studio anda i don't know how to import it.

原来的代码是import ca.uol.aig.realdoublefft,我不知道把java文件放在哪里.我试过把它们放到 libs 文件夹中.

The original code was import ca.uol.aig.realdoublefft and I'don't know where to put the java files. I've tried to put them to a libs folder.

这里是 jfftpack 源代码:

here's the jfftpack source code:

推荐答案

如果它是一个现有的代码库,我建议为它添加一个模块.可能最简单的方法是使用 File 菜单命令添加一个新模块,让它为您创建一个普通的 Java(非 Android)模块,删除它放入模块中的示例类,然后将您的文件复制到其中并调整它.模块向导将负责为您设置目录和构建文件,您可以稍后查看它并了解做了什么.

If it's an existing code library, I'd recommend adding a module for it. Probably the easiest way is to use the File menu command to add a new module, let it create a plain Java (non-Android) module for you, remove the sample class it puts into the module, and then copy your files over into it and tweak it. The module wizard will take care of setting up the directories and build files for you, and you can look at it later and see what did.

这篇关于如何在Android Studio中导入java包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆