AVD startup question summary [Android entry 7]

Source: Internet
Author: User

1. Many developers found that in addition to the unstable communication with ddms, the android simulator often has some other problems, such as the failure to start or the failure to properly store user data after each startup, as a result, it can only run normally when the second simulator appears. Android Development Network reminds you that the solution is also very simple. In eclipse, choose menu-window => prefences => Android => lanunch, in default emulator options, enter the parameter-wipe-data and click OK. However, remember to remove this parameter after the simulator starts. Otherwise, the simulator clears the data every time it starts.

2. the android simulator in eclipse has been started for a period of time and the problem of ddms false death adroid 19:11:07 read 52 comments 0 font size: large and small subscriptions.

After AVD is started in eclipse, the android project run may fail from time to time, and the console will print an error similar to the following:

Automatic Target mode: preferred AVD '1. 6_sd_128 'is not available. Launching new emulator.
[00:05:21-cookroid] launching a new emulator with virtual device '1. 6_sd_128'
[00:05:22-emulator] emulator: error: the user data image is used by another emulator. Aborting

Switch to the ddms view at this time and you will find that all messages in logcat are lost, there is no content in file explorer, and there is no device in the devices window on the left.

In the past, I used to restart AVD. However, we all know how annoying and time-consuming to start AVD...

Someone on the Internet said that the corresponding AVD directory *. the lock file is deleted, so that the project can be run, but eclipse will start another AVD (the original name is 5554, it may start another 5556 ). In this case, what is the difference between restarting AVD by yourself ....

The solution is finally found today (no need to restart AVD ~~) :

(1) Add $ android_sdk_home/tools to the path in the environment variable. (If you do not want to add a directory, you can also switch between directories)

(2) Open the terminal and enter ADB. You can see that there are many options.

(3) First ADB kill-server, then ADB start-server. OK ~ Everything is done! If you are not at ease, ADB get-state. If it is a device, it is OK.

(4) I tried to return to the ddms of eclipse. Did I find file explorer, logcat, and devices are all back ~~? If logcat is still blank, try to click a few clicks under the devices, and a lot of previously missed clicks will be displayed.

3. matrix. setscale (-1, 1 );

4. Many users who have not purchased a real machine do not know how to switch the android simulator to the horizontal screen display. The regular display is HVGA-P (port), that is, the resolution is 320x133 if you use landscape screen (land ). If the simulator has not been started, you can set it in the Eclipse project run as => open run dialog box. If the android simulator has been started, you can use the shortcut key F12 or Ctrl + F11 to switch. Of course, you can use the command line to launch the simulator by using the receivemulator.exe-skin HVGA-L.

It should be noted that android123 reminds everyone that switching land or port allows the interface to adapt to the form through the resource file, but the program may overload oncreate, the method to avoid it can be avoided through androidmanifest. redefines the direction in the XML file, and controls it according to the onconfigurationchanged (configuration newconfig) method of the activity rewrite. related information can be obtained in the android SDK.

Related Article

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.