Use Android Studio to develop android applications (Continuous updates) and androidstudio
Use Android Studio to develop android applications
-------------------- For reprinting, please specify the Source: coder-pig
Preface:
At the May 16, 2013 Developer Conference, google released a new integrated development environment: Android Studio
This IDE is used to develop Android applications. If you need to use Java, You need to download the Java IDE!
Google has gradually put its focus on Android Studio, so it is necessary to be familiar with this IDE development environment!
This blog post will be updated occasionally! Write down the problems and some new things! Hope To Help You With coder!
Update log:
2014.7.30:
Added a solution to import project garbled characters and failure to update the gradle file;
Modify the default encoding font, modify the default document specifications and document comments, and customize the shortcut keys!
Software Download:
Official website address: Official Website address
If there is a wooden wall or it cannot be mounted, use the following Baidu cloud link to download it:
32-bit: Click to download a Chinese package: Click to download
64-bit: Click to download
Software Installation
In fact, the installation of software is very simple. There are a lot of silly next steps;
If you are afraid, you can view the following package:
Android studio installation: Package
Basic usage:
Before using the tool, read a large part of this article from Eclpise. If you want to try AS, first compare the names of the two ides:
|
Eclipse |
Android Studio |
Work Zone |
Workspace |
Project |
Project |
Project |
Module |
Reference |
Preference |
Moudule dependence |
Therefore, you cannot create multiple projects in AS, but create multiple modules.
① How to build a project:
Select the first one directly. We developed a mobile device. Here we set the sdk of the lowest version.
Next step: various Activity formats are provided, including slide pages and custom navigation bars. Generally, we select the default Blank.
Next: Set the name of the main Activity and the name of the corresponding layout file:
Finish, wait for gradle to load the project directory, and then enter the development interface provided by the as. It looks very dazzling.
② Introduction to the development interface: 1. project directory:
2. Main Workspace:
3. Introduction to related forms:
1) Hide and display a workspace:
2) Use of the android debugging tool for DDMS: logcat is the running log and Devices is the current device
You can directly look at the following:
You can also click on the menu bar to open a separate DDMS form:
3) Common items in the toolbar:
Run, debug, android device log view, sdk and jdk directory in sequence; granle folder, AVD Manager simulator management; SDK; android DDMS (debugging tool); help
4) Real-time preview of layout files:
When we call the layout file, we only need to right-clickPreviewThis will pop up.
It is applicable to different mobile phones. To a certain extent, it is convenient for us to make apps that adapt to different screens.
Miscellaneous:
1. Change the IDE topic:
Method 1:
Click the icon of the wrench and enter colors.
Change Scheme name to Darcula and it will become black! Change to Defalut to be white! Restart Android Studio after setting!
Method 2:
Enter the app and find Appearance.
② Modify the default encoding Font:
③ Modify the default annotations and document specifications of the file header:
④ Modify the shortcut key
Problem solving: ① solve the garbled problem of the import project:
When we export a package: Some Chinese package names may be garbled:
After setting, you can see the Chinese directory name:
② Gradle cannot be updated. An error is returned when a project is created.
Because tianchao gave google to the wall and android developer's official website to the wall, if gradle is used;
Either not, or the speed is too slow.
A simple solution is provided for this problem:
First, go to this directory:
C: \ Users \ Administrator \. gradle \ wrapper \ dists
First, check the version of gradle to be downloaded:
My version here is 1.12. First download the corresponding version of gradle from Baidu
After the download, enter the directory,
Download the downloaded gradle-1.12-all.zip file to this directory !!!! Do not decompress
Okay. After the installation, restart or open AndroidStudio to create a new project. Wait for a while. The first decompression takes a long time.
PATIENCE:
In addition, the author provides two versions:
Gradle-1.12: Click to download
Gradle-1.10 click to download
In addition, I want to teach you a new skill: Download it directly, paste the following link in the website navigation bar or QQ tornado, and change the version number to the next one:
For example: version 1.9:
Http://services.gradle.org/distributions/gradle-1.9-all.zip
You can download the corresponding version of gradle!
For example, use C # To develop android
It seems that the current framework can be transplanted to Android. Since the framework supports Android, theoretically your program can be run in Android, if you call system files or dynamic libraries, problems may occur. I have never touched on specific projects. you should search for a lot of related information. You can try it easily.
How to Use Android components to develop applications on Android phones
Android phones are a real simulator. To develop android apps, You need to link to eclipse and build a development environment. android has four components: Activity, Service, Broadcast explorer, and Content Provider, if you have not learned it, you cannot develop it.