After seeing the garbled characters, I realized that it might be wrong coding method. In the Settings menu of Android Studio, find the place to edit the code. As follows:
file > Settings > Editor > File Encodings Project Encoding to GBK, and for the sake of uniform specification, I also set the other Encoding items to GBK.
-----------------------------------------------------------------------------------------------
But after the operation, the program in Chinese again garbled situation.
Ask questions in CSDN's Andorid forum and don't get the answers you want. See post: http://bbs.csdn.net/topics/391818489. Finally, find a solution on the Internet, as follows:
Apply plugin: ' Android ' dependencies {compile filetree (dir: ' Libs ', include: ' *.jar ') Compile project (': Appcompat_v7 ')} android {compilesdkversion buildtoolsversion "20.0.0" Android {Compileoptions.enco Ding = "GBK"}/////////added content, can be deployed to the device on the display of Chinese characters garbled problemcompileoptions {sourcecompatibility javaversion.version_1_7 targetcompatibility JavaVersion.V Ersion_1_7} sourcesets {main {manifest.srcfile ' androidmanifest.xml ' JAV A.srcdirs = [' src '] resources.srcdirs = [' src '] aidl.srcdirs = [' src '] renderscript . srcdirs = [' src '] res.srcdirs = [' res '] assets.srcdirs = [' Assets ']}//Mo ve the tests to Tests/java, tests/res, etc ... Instrumenttest.setroot (' tests ')//Move The build types to build-types/<type>//For instance, Build-types/debug/java, Build-types/debug/androidmanifest.xml, ...//This moves T Hem out of them default location under src/<type>/... which would//conflict with src/being used by the main source set. Adding New build types or product flavors should be accompanied//by a similar customization. Debug.setroot (' Build-types/debug ') release.setroot (' Build-types/release ')}}
Comments in code show garbled problem after importing Eclipse code from Android Studio