When developing Android apps using Eclipse, developers often use the Shift+ctrl+o shortcut to quickly import all packages and remove packages that have been imported but not yet used. But this shortcut key in Android Studio no one is to have open, and below to share with you in Android Studio using the Shift+ctrl+o sho
external libraries, as shown in: (and the latest version OH)2, Gradle Import Jar Package Features: (and Libs folder import jar package difference)
Gradle Importing jar packages is more convenient, one line of code can be done. Not like the latter, you have to go to the official download.
If the official will update the jar package, we only need to change the version number in Build.gradle, do not have to re-download the official website.
Attention:
This method is only applicable to the package release of small software;
The Package Wizard can pre-check the required runtime support;
Since Visual Studio canceled its own packager since 2012, if you need to package the installation, you need to use a plug-in called InstallShield for Visual Studio to package, but for the release of small software is a fuss.Specific steps:Step 1: Right
option for you to ask for an imported package when you copy the code.
All : When you choose this item, you paste the code, you need to import the package name, will automatically import, do not play the prompt boxask: When you choose this item, you paste the code, there is a need to import the package name, will pop the prompt box, ask you want to importNone: When you choose this, the code you paste, the package name that you need to import, does not play the prompt box, and does not autom
Using third-party jar packages in Android Studio, you can download them directly and add them to your project, or you can manage them using the Gradle configuration. The graphical interface is very simple.Click the middle icon, or select Model, press F4Select the Dependencies tab after opening the Project Structure panelClick on the + sign, select 1 Library dependency, we download Google-provided Gson.jar p
imported package when you copy the code.
All: When you choose this item, you paste the code, there is the need to import the package name, will automatically import, do not play the prompt box ask: Select this when you paste the code, there is a need to import the package name, will play the prompt box, ask you want to import None: Select this item when you paste the code, When you need to import a package name, the prompt box does not bounce and is not imported automatically.
Sho
This is quite different from eclipse, and it is estimated that many people are just beginning to use Android studio to be very distressed about this setting.Directly, open the project structure interface via FILE->PROJCET structure, or you can open it by using the shortcut icon.For example, select Libraries, and then click the + sign to choose Java.After selecting Java, the dialog box pops up, select the Libs folder where your jar package is located,
Transfer from http://blog.csdn.net/lincyang/article/details/44457799As does not have an independent module project, but you can add a module to normal project. The so-called module is a modular unit that we usually refer to, and is often present in the form of a jar package. The following is a demonstration of the modularity of the as in an example of getting cell phone information.First, the new module in the projectFile->new Module, see details.Second, import the code into the moduleCopy the c
Library folder name". For example, I placed the Image-loader Open Source Library folder in the app's sibling directory, and then edited the Setting.gradle and changed the contents to:Include ': App ', ': Image-loader 'Then go back to the Build.gradle file in your app directory and add it under the dependencies {} node:Compile project (': Image-loader ')After that, you'll be able to reference the open source repository in your code (actually called Module).Android
One day I opened Android studio and ran an app that was intact yesterday. Unexpectedly, various jar packages could not be found, but the problem was clearly found, and there was also a Red Cross in the project ~
Try the following method:
1. After the delete packet is dropped, add it again.
If an error is reported
2. Find this method on the Internet and add dependencies to the dependencies node in the build
In Android development, we need to introduce third-party jar packages to efficiently use existing ready-made features. Here's how to introduce a third-party jar package in Android studio.In the menu file = = "Project structure = =" Dependences "green +, select the third-party jar path you want, so that you have the appropriate configuration information in the Build.grade:dependencies {Compile Filetree (dir: ' Libs ', include: [' *.jar '])Compile files
Android Studio loads third-party jar packages, and the following error occurs: androidjar
When a third-party jar package is added through the Maven Central Library, the problem of repeatedly loading the jar package occurs. The solution is to simply remove a third-party jar package and let it load it.I. Error
Error:Execution failed for task ':app:dexDebug'.> com.android.ide.common.internal.LoggedErrorExcept
Solve the Problem of repeated package loading when Android Studio loads third-party jar packages:
When a third-party jar package is added through the Maven Central Library, the problem of repeatedly loading the jar package occurs. The solution is to simply remove a third-party jar package and let it load it.I. Error
Error:Execution failed for task ':app:dexDebug'.> com.android.ide.common.internal.LoggedErr
'] renderscript.srcdirs = [' src '] res.srcdirs = [' res ']}}}dependencies{compile ' com.android.support:appcompat-v7:19.1.0 ' //compile ' com.android.support:support-v4 : 19.1.0 '}The configuration content of Gradle is referred to the last second link.At this point the structure of the project is shown:At this point compile, pass, import success!Third-party class library jar packagesThis is much simpler, just copy the jar package to app/libs and add the jar dependency in the Build.gradle under
Android studio uses gradle to dynamically build apps (different packages, different icons and labels) and androidgradle
Recently, I have a requirement to create two apps with similar functions. Most of the Code is the same, but the interface is different. In the past, I had to maintain two sets of code, which is troublesome. I recently asked for information on the Internet, it is found that two apps can be
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.