1. How Android Studio submits code to GitHub:
http://blog.csdn.net/u011068702/article/details/49273231#userconsent#
2. Eclipse Import Android Project package XML error did not generate R file:
Http://jingyan.baidu.com/article/c910274be7536acd361d2dca.html
3. Resolving WebView and JavaScript call confusion causes the function to fail:
Add "Keep all methods under this class from being confused" in Eclipse's proguard.cfg
public class com.example.web_01.WebHost{ public <methods>;}
4. Eclipse view the. class file Method:
"1" Creates a new file:android-suppory-v4.jar.properties under the Project Libs directory
"2" is added in android-support-v4.jar.properties src = E:\Android sdk\sdk\extras\android\support\v4\src (the src location of the corresponding version in the SDK)
"3" Restart Eclipse
5, Genymotion use problem
"1" Restart ADB method: Enter ADB kill-server and ADB in the D:\android\adt-bundle-windows-x86_64-20140702\sdk\platform-tools directory of CMD Start-server
"2" Eclipse does not recognize genymotion cause: Genymotion API version is lower than API version of project
6. Resolve ADB Server didn ' t ACK:
Open Task Manager, click on the process, the inside of the phone assistant process is finished. The reason is that the phone assistant occupies the ADB 5037 port, can be used under the Platform-tools Netstat-ano | Findstr "5037" view.
7. Resolve unable to resolve target ' ANDROID-17 ' ERROR
Modify Project.Properties: Change Project TARGET.TARGET=ANDROID-17 to project target.target=android-21 and clean
8, v4 package can not find:
When the jar package in the referenced library does not match the jar package for this project, it causes the V4 package to be missing. You can choose to remove one of the two items in the same jar
9, custom application problem:
Custom application must be registered and obtained through the Getapplication () method.
10, SQLite use problems:
Java.lang.IllegalStateException:Couldn ' t read row 0, col-1 from Cursorwindow. Make sure the Cursor was initialized correctly before accessing data from it.
field is inconsistent. To modify the operation of the database, you must first uninstall the original application, and then reinstall. In order to sort the fields, TREEMAP should be used instead of HASHMAP.
11, Layout dynamic Setting Height:
//必须用android.view.ViewGroup.LayoutParams重新设置高度android.view.ViewGroup.LayoutParams pp = view.getLayoutParams();pp.height = 200;view.setLayoutParams(pp);
12. Add judgment mark for Onclicklistener:
Available with View.settag ()
13. Android Sudio Import Eclipse Project:
Http://www.open-open.com/lib/view/open1421580998718.html
14, solve the problem of Android application method can not exceed 65K (excerpt from Android bus Android Developer Portal):
As an Android developer, I believe you should have heard about the limit on the number of Android methods to 65K, and as the application function continues to enrich, one day you will encounter an exception: Conversion to Dalvik format failed:unable Toexecute Dex:method ID not in [0,0XFFFF]:65536 Some students may say that solving this problem is simple, we just need toProject.proterty configuration in a word is OK, dex.force.jumbo=True, yes, by adding this phrase, it is really possible for your app to compile, but in someInstall_failed_dexopt anomaly on the machine of the 2.3 system is easy to appear! For the above two exceptions, let's start by analyzing the reasons:1, Android system, a Dex file storage methodThe ID is usedShort type of data, so the method in your Dex cannot exceed65K2, inBefore the 2.3 system, the virtual machine memory was allocated only5M know the reason, we have to solve the above problems, first of all for65K Problem, we are unable to change the structure of the Android system at the application layer, so we cannot convert the data type fromShort changed intoint or other type, which means that the number of methods in a Dex cannot exceed65K is the gap that we cannot overcome, we can only reduce the number of methods in Dex, the first most likely scenario is to remove some useless jar packages, and set some properties toPublic, so you can removeget/Set method, this method can only solve the problem temporarily, and over time, one day there will still be more methods than65K, after all, an application is generally in addition function, will not reduce function. Let me introduce you to the two main solutions, one is to represent, some functions into plug-ins, dynamic loading, the other is a Facebook-represented subcontracting scheme, the Dex file in an APK is divided into multiple Dex files, and then dynamically load the Dex file. In fact, the core idea of the two programs is the same, the plug-in is the future to develop new features into the APK and Dex dynamic loading, and the subcontracting scheme is to have completed the function of multiple Dex file load dynamically, in fact, I personally feel that the plug-in Scheme score package solution better65K problem, because the plug-in solution is not only able to solve65K problem, but also allows us to reduce the size of the application, and sub-package can only solve65K's problem. About plug-in development, to make dynamic loading, I wrote in a very early article on its basic ideas, interested students can see the android dynamic loading apk (Fragmentor activity implementation) below we focus on the subcontracting mechanism we know that there is a Dex file inside an APK file that is optimized in the Dex file.class file, the so-called subcontracting, is to tell a Dex file into multiple Dex files, here we agree, the first Dex calledMain.dex, the second one is calledSecond.dex, usually at the time of subcontracting, we need to put the classes we need to use to launch the app intoMain.dex, put the classes that you don't need to use immediately intoSecond.dex, for Android system, he will only load by defaultMain.dex's,Second.dex for him may be just a resource file, it is not active to loadSecond.dex, so in the process of application launch, we need toSecond.dex create a class loader so that I use theThe class can be loaded inside the Second.dex class. about how to loadSecond.dex also has a lot of practices, with more than a few of the main:1, the simplest way is to use Dexclassloader to load, and the Dexclassloader's parent loader is set to Pathclassloader2. Use Dexclassloader to load, and set Dexclassloader's parent loader to Pathclassloader's parent loader, set Pahtclassloader's parent loader to Dexclassloader, Taste it carefully.1 andThe difference of 23, willThe path to the Second.dex is placed in the load path of the Pathclassloader for the2 program, in one case is not used, such as whenSecond.dex is loaded via Dexclassloader, butA class was used in Second.dex, whichMain.dex, this time throws an exception that the class cannot find, so this scheme can only haveSecond.dex won't use that.Main.dex class when the above is said to be the theory, let's do some actual combat here I will introduce two scenarios, one is based on Gradle build Android project, one is based on the ant build Android project Scenario one: Build Android project based on Gradle, and realize the sub-environment requirements: Android OidStudio0.9 or more, Gradle plug-in0.14.2 or more1. If your project is in Eclipse, then you need to import the project into Android, you need to upgrade adt22 above2. Open your projectBuild.gradle file, check if the Gradle plugin is0.14. After version 2, because0.14.2 after the Gradle plugin supports subcontracting,3, open the project under a MoudleBuild.gradle file, adding a dependency on Android-support-multidex.jar4. Remove duplicate classes from third-party jar packages5. Set the virtual machine heap memory space size to avoid oom during compilation6, Gradle construction project, it seems that the default is not to join the so library project, so in order to avoid this situation, we need to develop so library directory, for the project from Eclipse, also need to develop SRC and resource file path7. If your project relies on other libraries, add multidexenabled to each library project separatelyTrue and Jnilibs.srcdirs =[' Libs '] two configurations8. If your project does not have a custom application, then you are in Androidmanifest.XML can be used multidexapplication, if your project has a custom application, and is inherited is application, then only need to inherit multidexapplication instead, If your project inherits other application, then you need to rewrite Attachbasecontext after the above configuration, your project should have been successfully subcontracting. If the subcontracting succeeds, then you unzip your apk file and will find that there are two Dex files, through the configuration process described above, we find this scenario we have no control over which classes are inMain.dex, which classes are inSecond.dex, this scheme is used to configure the subcontracting, which can be compatible with api4-api20. Its loadingSecond.dex is used in the above scenario3 Let's take a look at the Ant-based build Android project and implement the subcontracting process in the above scenario, since we can't see the script for the Gradle build project, we can't control which classes are in the first Dex, which classes in the second Dex, in this scenario, we use ant build, Ant is allowing users to define their own build scenarios, such as through a custom build scenario, in which some third-party jar packages in the project can be placed intoSecond.dex, please refer to the Open source project for how this is implemented Https://github.com/mmin18/Dex65536.git because the project loadsThe scheme adopted by Second.dex is the above-mentioned scheme2, for examplesecond.dex depend on 3, that is 4.4, other systems load second.dex Method! After the success of the sub-package, unzip the apk file into the Assert folder, we see the following structure, LIBS.APK is the third-party jar compiled after the Dex file for the second problem mentioned above install_failed_dexopt, the root cause is 2.3 version Dalvik the memory of the virtual machine is only 5m, So whether it's a plug-in scenario or a subcontracting scenario on some phones or the problem, after all, we're only reducing the number of packages per Dex, but the total number of methods is not reduced, so the fundamental way to solve this problem is to modify the virtual machine memory to 8m, this requirement in java layer is not possible, but can be in c layer implementation, concrete implementation process can refer to open source project: Https://github.com/viilaismonster/LinearAllocFix.git. As for the method used in some of the methods, can be found in the Android-support-multidex.jar, here is not all posted out, if there is no clear, welcome message discussion ...!
15. Visit the Development API website:
Use Firefox, set to work offline
16. Binding service-related issues:
To join Android:exported= "true" in the registered service, you will
Generate Java.lang.SecurityException:Not allowed to bind to service Intent
{Act=www.qslx.com.aidl.iremoteservice, this error is not binding the service
17. Swapping XML layout Control order in Eclipse development causes Findviewbyid error:
Just clean up project.
18, Popupwindow Click the external will disappear solution:
setoutsidetouchable (true) ;//just outside can click, not click can disappear Setbackgrounddrawable ( New Bitmapdrawable () ;//Add the following sentence to make the click outside disappear Settouchinterceptor (new ontouchlistener () {@Override public boolean Ontouch (view V, motionevent event) {if (event.getaction () = = Motionevent.action_outside) { Dismiss
19. GetView () Reuse question:
"1" resets the state before selecting the state
"2" Save the state with a list or bean.
20. The ListView click Item does not respond:
Android:descendantfocusability= "Blocksdescendants"
Http://www.cnblogs.com/eyu8874521/archive/2012/10/17/2727882.html
21, the use of network-related issues:
To import
<uses-permission android:name="android.permission.INTERNET"/>
Instead of
<uses-permission android:name="ANDROID.PERMISSION.INTERNET"/>
Be aware that the test phone is also networked
22, the ListView control reuse causes the picture loading position error:
"1" for ImageView binding Settag (), Gettag () in handler to set the picture
"2" uses the member variable to cache the passed variables, avoid using thread to cause timing errors
23, the ListView picture multiple loading problem:
Using lrucache<string,bitmap>
24, the ListView sliding problem:
"1" ListView does not load visible items after sliding stop
"2" listview when sliding, cancels all add-ons
"3" Implementation Abslistview.onscrolllistener
25. The last item of the ListView is blocked by the bottom layout:
Put the ListView on top of the bottom layout
Android:layout_above= "@+id/bottom"
26. Listview.setadapter generates NULL Pointer Exception:
Paste_image.png
// 此处产生Null Pointer Exception闪退,因为mDatas为nullmListView.setAdapter(new ListDirArrayAdapter(context, mDatas));
27, the use of the Java unsigned number:
public static long getUnsignedIntt(long data) { // 0~4294967295 32为无符号数 // (0xFFFFFFFF即DWORD)。 return data & 0x00000000FFFFFFFFL; //L一定不能漏!!!}
28. The string equals return false:
Note case, can output comparison
29. Eclipse Add Engineering Dependency error (workaround with 8):
The jar package is inconsistent, removing one
30, Android Studio Import module generated Gradle error:
"1" Modify Build.gradle file, put compilesdkversion, Buildtoolsversion,
Minsdkversion, targetsdkversion change to the same
"2" modifies the wrapper gradle-wrapper.properties of the Gradle folder,
Modify Gradle-2.4-all.zip
Http://doc.okbase.net/x359981514/archive/112744.html
31. Failed to find target with hash string ' android-22 ':
Modify Build.gradle's compilesdkversion and buildtoolsversion
32. SVN Merge Code conflict:
"1" Early backup code
"2" replaces the SVN project folder directly with the Backup code folder, and then commits
33, Friends of the league or QQ open Platform FAQ:
"1" allies do not support Android Studio Project Direct configuration, need to manually configure
"2" Whether it is Friends League, or QQ open platform, android:label= "@string/app_name" this app_name to register with the application name consistent, such as Qslxdemo
Android Bug Summary