Summary of problems encountered during android development [7] and android Summary

Source: Internet
Author: User

Summary of problems encountered during android development [7] and android Summary
212. Android WebView FAQs and Solutions

Http://blog.csdn.net/t12x3456/article/details/13769731

213. Android check network connectivity on some tablets crash

Java. lang. NullPointerException
At com. xxx. Util. getNetworkState (Util. java: 246)

214. What is the equivalent of Eclipse "M debug Keystore" in Android studio?
http://stackoverflow.com/questions/17189076/what-is-the-equivalent-of-eclipse-custom-debug-keystore-in-android-studio
215. When debugging Android Studio, modify the variable Value in the "Variables" window, select the variable to be modified, right-click it, and select "Set Value ...". The shortcut key F2216. open Baidu positioning, and the initialization in MyApplication is reloaded. If Automatic Logon is enabled at this time, the system will log on again, and the current credential is invalid. 217. android webview and js interaction json objects. It is passed through a string. Then, the json object generated by the string is obtained through jsonobject. 218. Android Studio jni ndk Development

There are three main parts:
1. Javah generates the JNI header file
Enter the/src/mian directory. If you do not enter this directory, the system will prompt when running javah: error: the class file of 'com. lcj. ndk_demo_2.HelloNDK 'cannot be found.
Javah-d jni-classpath .... \ Build \ intermediates \ classes \ debug com. lcj. ndk_demo_2.HelloNDK
Jni is the folder to store the generated header file (usually named jni)
.... \ Build \ intermediates \ classes \ debug is the directory where the class is located (the class files generated by Build-> Make Project are all here, which is a relative path)
Com. lcj. ndk_demo_2.HelloNDK is the file name of the class file (generated based on the previous java file)
Reference http://wenku.baidu.com/view/105474098e9951e79b8927a3.html
2. Write. c and makefile Based on the. h file that is not generated.
3. ndk-build [This androidstudio1.2 has been integrated, and ndk can be compiled directly, so there is one more choice]
Common problems: When running the ndk-build command I get the following error:

Android NDK: cocould not find application project directory! Android NDK: Please define the NDK_PROJECT_PATH variable to point to it solution NDK_PROJECT_PATH is an environment variable so you don't have to include in the Android. mkfile. is nkd-build launched in the project directory? For more info read the docs in docs/HOWTO.html in the NDK folder where I readStarting with NDK r4, you can simply place the file under $ PROJECT/jni/and launch the 'ndk-build' script from your project tree. if you want to use 'ndk-build' but place the file to a different location, use a GNU Make variable override: ndk-build NDK_APPLICATION_MK =/path/to/your/Application. mk
219. Use the lamemp3 library in Android to compress PCM recording data into MP3 format
The most below there is a demo very good by javah modification, you can directly use the Source: http://ikinglai.blog.51cto.com/6220785/1228730
220. Android Studio does not automatically pop up the code prompt Function Solution do not auto popup code completion

After the upgrade, the Code reminder function does not automatically pop up, and the variables are not marked with colors. It's just me, and Google has a variety of keywords, there is no way
Later, I saw a Power Save Mode. I checked it out yesterday when my notebook got hot. Why?
After cancellation, all functions are normal. It seems that these functions are disabled in power-saving mode. The autoComplete implemented by reflection will increase the amount of CPU computing.

File-> Power Save Mode. Cancel Power-saving Mode
Reference: http://blog.csdn.net/ameryzhu/article/details/14105275

221. Baidu map related when the project is started on Genymotion, the program throws an exception 222. Baidu map related. E/baidumapsdk: Authentication Error errorcode:-1 uid:-1 appid-1 msg: AndroidManifest. xml application does not contain the meta-data tag 223. Baidu map-related Baidu map remove zoom button

MapView is placed in ScrollView, black bars appear during scrolling
Http://bbs.lbsyun.baidu.com/forum.php? Mod = viewthread & tid = 1093.
The problem that GLSurfaceView should be placed inside ScrollView. 1.3.5 it is no problem to directly draw with View. Can you provide a MapView Based on View in the next version?

Moderator, I am thinking, when scrolling, it uses bitmap to capture the current map. (call getCurrentMap () and build it on GLSurface. however, the getCurrentMap () operation is asynchronous and uses the View that comes with android. getDrawingCache () fails to be obtained. after the preceding failure, the map can be not operated due to the requirement restriction. After the MapView is loaded, the getCurrentMap () function is put in the ImageView and placed on the MapView, however, the corresponding listening method cannot be found. see Post: http://bbs.lbsyun.baidu.com/viewthread.php? Tid = 1104 & extra = page % 3D1. Switch to 1.3.5 now to do. QQ: 396920165. Can you communicate?

Sliding problem after embedding mapview in scrollview

Place Baidu map mapview in scrollview and slide the black screen

Later I tried to use the function directly. Mapview settings are hidden, and the method is not executed. Whether the mapview is not displayed. Function unavailable?
Overwrite before starting to move
Static. It cannot be dragged but can be clicked

We recommend that you do not use mapview in scroll. Because map is drawn using opengl, this feature has performance problems in scroll, which leads to poor experience. Please consider changing the implementation method.

Baidu map1.3.5
Http://developer.baidu.com/map/reference/index.php? Title = Class: android % E6 % A0 % B8 % E5 % BF % 83% E7 % B1 % BB/MapView

Static [do not zoom in or out] mapview. Invalid click

Http://www.cnblogs.com/trinea/archive/2012/11/14/2770433.html

224. Android custom DataTimePicker (date selector) http://blog.csdn.net/wwj_748/article/details/38778631225.Content-Type: application/x-www-form-urlencoded;

You can use mitmproty for analysis.

Https://www.imququ.com/post/four-ways-to-post-data-in-http.html

Four Common POST data submission methods

Application/x-www-form-urlencoded
Multipart/form-data
Text/xml
Application/json
Text/xml

226. After androidstudio is upgraded, code management tools such as git svn cannot be used.

Vcs-> Enable Version Control Integration select git/subversion

227. After androidstudio is upgraded, the Automatic Code reminder function is missing.

The reason is that the File-> Power Saved Mode is enabled, and you can close it.

228. dshow Audio Acquisition 229. kill-SIGKILL PID

Force stop (often used to kill) a process with the process ID 324:
# Kill-9 324
(2) Remove the deadlock in Linux
In Linux, a program crashes and is in a deadlock state. In this case, you do not need to restart the computer. You only need to stop (or close) the problematic program. When kill is on the X-Window interface, the main program (except the crashed program) is generally started normally. Open a terminal and stop the problematic program there. For example, if the Mozilla browser program is locked, you can use the kill command to stop all programs that contain the Mozolla browser. First, use the ps command to find the PID of the program, and then use the kill command to stop the program:
# Kill-SIGKILL XXX
XXX indicates the process ID of the program with the Mozolla browser.
(3) Use commands to recycle memory
We know that memory is very important to the system. memory recovery can improve system resources. The kill command can be used to stop some programs that are not on the rails in a timely manner or do not have the corresponding programs for a long time. For example, if you use the top command to find a useless (Zombie) process, you can use the following command:
# Kill-9 XXX
XXX is a useless process ID.
Run the following command:
# Free
The available memory capacity is increased.
(4) killall command
In Linux, A killall command is also provided to directly use the process name instead of the process ID number. For example:
# Killall-HUP inetd

230. After android imports the eclipse project, the following problems occur:

1. Error: The project is using an unsupported version of the Android Gradle plug-in (0.12.2). The recommended version is 1.2.3.

Classpath 'com. android. tools. build: gradle: 1.2.3'

In build. gradle, follow the prompts
Dependencies {
Classpath 'com. android. tools. build: gradle: 0.12. +'
}

Change
Dependencies {
Classpath 'com. android. tools. build: gradle: 1.2.3'
}

2. After modification, the following error occurs:

Error: Unable to load class 'org. codehaus. groovy. runtime. typehandling. Invalid typehandling '.
Possible causes for this unexpected error include: You are using JDK version 'java version "1.7.0 _ 71 "'. some versions of JDK 1.7 (e.g. 1.7.0 _ 10) may cause class loading errors in Gradle.
Please update to a newer version (e.g. 1.7.0 _ 67 ).

Clearly used is jdk1.7.0 _ 71 [than 1.7.0 _ 67 is new] But the prompt is wrong, the problem starts not jdk but gradle-wrapper.properties

DistributionUrl = The http://services.gradle.org/distributions/gradle-1.12-all.zip is estimated to use jdk1.7.0.10

Set distributionUrl = http://services.gradle.org/distributions/gradle-1.12-all.zip
Change to distributionUrl = https://services.gradle.org/distributions/gradle-2.2.1-all.zip

OK. After the preceding two steps, import the eclipse project from studio for normal use.

231. android annotation Template

Settings-> Editor-> File and Code Templates-> des

232. common attributes of shape subnodes

Android: startColor start color
Android: endColor end color
Android: angle gradient angle. 0 indicates from top to bottom, 90 indicates from left to right, and the default value is 0, which is an integer multiple of 45;
Android: type gradient style liner linear gradient radial Ring gradient sweep

For example:

<shape xmlns:android="http://schemas.android.com/apk/res/android"    type="rectangle">    <gradient        android:angle="270"        android:endColor="#9f36a0"        android:startColor="#65216a" /></shape>

2.<Corners> rounded corner
Android: the larger the radius value of the radius rounded corner, the more rounded corner.

Android: top-right corner radius of topRightRadius

Android: bottomLeftRadius right bottom corner radius

Android: top left corner radius of topLeftRadius

Android: bottomRightRadius left bottom corner radius
If you set the four corners to 90, the picture will be a circle!
3.<Solid> Fill
Android: color filled color

4.<Stroke> stroke
Android: width stroke width
Android: color stroke color
Android: dashWidth indicates the horizontal line width '-'.
Android: dashGap indicates the distance between '-' and '-'.

Reference http://blog.csdn.net/cs_li1126/article/details/11781577

#233. GestureOverlayView234.Animation lInAnim = AnimationUtils. loadAnimation (mActivity, R. anim. push_left_in );

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.