简体   繁体   English

将Eclipse Library项目导入AndroidStudio

[英]Importing Eclipse Library Project into AndroidStudio

I have an Eclipse Project that I like to migrate to AndroidStudio, with the following Structure/Content 我有一个Eclipse项目,我喜欢迁移到AndroidStudio,具有以下结构/内容

  • 1 LibraryProject with most of classes for all my Apps. 1个LibraryProject包含我所有应用程序的大多数类。 This Library has 1 Activity ("SharedStarterActivity"), which will be started from all my 3 Apps. 此库有1个活动(“SharedStarterActivity”),它将从我的所有3个应用程序启动。
  • 3 Apps using the mentioned LibraryProject. 使用上述LibraryProject的3个应用程序。 These Apps referencing an Activity of my ProjectLibrary App as the Start Activity in the Apps AndroidManifest.xml. 这些应用程序引用我的ProjectLibrary应用程序的活动作为Apps AndroidManifest.xml中的启动活动。

     <activity android:name=".SharedStarterActivity" android:label="@string/IndividualAppName"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> 

In a first look, it does not make sense, but each app has its individual AppProp.class, which is used by the SharedStarterActivity.class and makes each app individual. 首先看,它没有意义,但每个应用程序都有其独立的AppProp.class,它由SharedStarterActivity.class使用,并使每个应用程序都是个体。

Now my question: How can I migrate this Projects to AndroidStudio ? 现在我的问题是:如何将此项目迁移到AndroidStudio?

I have read the migration guide "from Eclipse to AndroidStudio", but I am stuck now at 我已经阅读 “从Eclipse到AndroidStudio” 的迁移指南 ,但我现在陷入了困境

"Import Eclipse Projects to Android Studio" -> You should decide how you will import your existing Eclipse ADT projects depending on their structure: “将Eclipse项目导入Android Studio” - >您应该根据其结构决定如何导入现有的Eclipse ADT项目:

Before Trial and Erroring, I wanted to ask you experts, how you would import the projects and will the mechanic still work with referencing an Activity from LibraryProject in my Android Project (one of the 3 Apps) ? 在试用和错误之前,我想问你的专家,你将如何导入项目,机械师是否仍然可以在我的Android项目(3个应用程序之一)中引用LibraryProject中的Activity?

see there is more types available in Google to migrate eclips to studio but which method I use please follow the step. 看到谷歌有更多类型可以将eclips迁移到工作室,但我使用哪种方法请按照步骤操作。

1) Open existing project in eclipse remove the library from setting and close eclipse 1)在eclipse中打开现有项目从设置中删除库并关闭eclipse

2) Open AS(Android Studio) import from eclipse option available there, choose the option and open your project in AS. 2)从那里可用的eclipse选项打开AS(Android Studio)导入,选择该选项并在AS中打开你的项目。

3) Some Library are already avail in AS. 3)一些图书馆已经在AS中使用。 Click on your Main module (Main) press F4 open setting and check your lib available in listing or not. 单击主模块(Main)按F4打开设置并检查列表中是否有可用的lib。

4) if Avail then add from there else find the latest version of same library and add as module to your Main project. 4)如果Avail然后从那里添加找到相同库的最新版本并添加为您的Main项目的模块。

5) please properly configure your Gradle ( Main Gradle and app Gradle file) 5)请正确配置Gradle(主Gradle和app Gradle文件)

you may also refer below link to migrate in details 您也可以参考以下链接进行详细迁移

https://developer.android.com/studio/intro/migrate.html https://developer.android.com/studio/intro/migrate.html

or 要么

http://www.developer.com/ws/android/migrating-from-eclipse-to-android-studio.html http://www.developer.com/ws/android/migrating-from-eclipse-to-android-studio.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM