且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

机器人工作室BaseGameUtils

更新时间:2022-12-29 14:53:28


  1. 开启文件>项目结构

  2. 在左上角点击+号

  3. 选择导入Eclipse ADT项目,然后单击下一步

  4. 你的电脑像/ Android的基本采样主/ BasicSamples /库/ BaseGameUtils和
  5. 选择BaseGameUtils路径中的下一个屏幕,你会看到模​​块的名称类似:BaseGameUtils,然后点击确定

  6. 单击旁边你就可以看到BaseGameUtils模块中的模块

  7. 选择在项目结构您的应用程序,去相关性,点击+号并选择模块依赖,然后选择BaseGameUtils

  8. 单击确定和你的gradle这个将与所有访问BaseGameUtils功能/班被重建。

I'm trying to implement Google Play Game Services, and I need to have BaseGameUtils as a library in my project. Following google tutorials I could not find a way to include this in a project that I already have in android studio. Importing manually in Android Studio...

How should I import BaseGameUtils in a project that already exists? What is the best practice?

Should I copy the whole BaseGameUtils in the libs folder in my module? Or should I copy BaseGameUtils in my project folder?

\Project
|--\module
|--|--\libs
|--|--|--android-support-v4.jar
|--|--|--...
|--|--|--\BaseGameUtils
|--|--|--|--...
|--|--\src
|--|--|--...

or

\Project
|--\module
|--|--\libs
|--|--|--android-support-v4.jar
|--|--|--...
|--|--\src
|--|--|--...
|--\libraries
|--|--\BaseGameUtils

Except in the gradle file (in BaseGameUtils) should I mention anywhere else that BaseGameUtils is a library?

  1. Open File > Project Structure
  2. Click on the + sign in the top left corner
  3. Select "Import Eclipse ADT Project" and click next
  4. Select BaseGameUtils path on your computer like "/android-basic-samples-master/BasicSamples/libraries/BaseGameUtils" and in the next screen you will see module name something like ":BaseGameUtils" then click ok
  5. Click next you would be able to see BaseGameUtils module in your modules
  6. Select your app in the project structure, go to dependencies, click on + sign and select "module dependency" and then select "BaseGameUtils"
  7. Click Ok and your gradle will be rebuild with all the access to BaseGameUtils functions/classes.