Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the way Android simulator skin is developed?

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article will explain in detail how the Android simulator skin is formulated. The quality of the article is high, so Xiaobian shares it with you as a reference. I hope you have a certain understanding of relevant knowledge after reading this article.

Android mobile phone operating system can be modified by some related operations in the simulator to meet everyone's needs. Here is a detailed introduction to the specific concepts of Android Simulator. Android simulator skin has a total of four standard formulation methods, corresponding to HVGA (landscape/portrait) and QVGA (landscape/portrait), we only need to use the-skin parameter when starting the simulator to load the corresponding skin.

This not only allows us to modify the appearance of the skin at will, but more importantly, when we develop new products based on Android, we can set the parameters of the simulator according to the new hardware spec, including resolution, key layout, network speed, network delay, etc. Now let's look at ways to customize an Android emulator skin, and I'll use a Landscape skin with WVGA resolution as an example.

First let's look at the Android emulator skin in the SDK location, the default skin in the $ANDROID_HOME/tools/lib/images/skins/directory, we want to install a new skin, but also simply unzip the skin to this directory can be. Considering the large number of keyboard keys, relocating each one is a lot of work, I will modify it based on HVGA skin. The device background and keyboard background of this skin are two pictures respectively. As long as the keyboard background size remains unchanged, the originally defined coordinate position can be used in the new skin without modification.

*** Step, create a new directory named WVGA in the $ANDROID_HOME/tools/lib/images/skins/directory, copy the device.png, keyboard.png and layout files in the HVGA directory, and then copy all the files except the background.png and layout files in the HVGA-L directory. In this way, we have all the resources we need for customization, and we can modify them in the following.

Step 2: Use GIMP (Paint. NET for Windows) to modify device.png, rotate it 90 degrees counterclockwise, and zoom in and cut it appropriately so that the screen area is exactly 800*600. Do not modify keyboard.png.

Step 3, because we have enlarged the background of the device, before adjusting the position of the keys, you can now see the effect in GIMP, and appropriately enlarge home.png, powe.png, arrow_left.png, etc.

Step 4: Start modifying the layout file. layout file structure is easy to understand, first of all, the device part, including the background (background), display area (display), and buttons; followed by keyboard area, containing background images (background) and keyboard buttons; Part 3 is the overall layout of the simulator settings, including window size (width, height), background color (color), screen orientation (event), and the location of the device and keyboard parts it contains; Part 4 allows you to modify the keyboard map, network speed, and network delay of the simulator.

Let's look at the layout file from the beginning. We first modify the width and height of the display to 800 and 480 respectively, and x and y are filled in the upper-left corner coordinates of the display area on the background of the device. In this way, the output resolution and position of the simulator are determined. We temporarily put the buttons part of the device, and the background and buttons of the keyboard area do not need to be modified, so we came to the overall layout (layout) part, according to the data mastered when modifying the background of the device, temporarily set the width and height of the window to 1280*800, the background color remains unchanged, I have not found the exact meaning of the event, but it is certain that it will affect the direction of the screen output content, EV_SW:0:1 is what we can read. Then, set the position of device and keyboard in the whole window. ***, We keep the keyboard layout qwerty2, and the network settings unchanged from their defaults (we'll explain this later).

At this point, use.../ emulator -skin WVGA command to open the simulator, we can see a relatively normal simulator interface, the keyboard can also be used, the position of the display area is basically OK, but the Home, Back and other keys on the device are completely misplaced. Well, let's go back and modify the buttons positioning of the device. At this time, we may need to try while changing, and the position of the display area and the position of the keyboard can also be further adjusted.

At this point, a WVGA Android emulator skin is basically complete, but there are still a few problems left.

1. If it is used on a notebook (1280*800 resolution), the display area of the skin is too large, and the keyboard part may not be fully displayed, which brings inconvenience to use.

Emulator window was out of view and was recently

We can solve this problem by using the-scale option. For our WVGA skin, use./ emulator -skin WVGA -scale 0.9 to start the simulator is no problem

2. How to use WVGA skin in eclipse

Go to Run -> Run Configurations -> Target -> Emulator launch parameters to select the skin we want to use.

At the same time, you can fill in-scale in "Additional Emulator Command Line Options" to zoom the simulator window.

The network speed and network latency we mentioned earlier can also be set here (obviously better than in the Android emulator skin).

About Android simulator skin development method is how to share here, I hope the above content can be of some help to everyone, you can learn more knowledge. If you think the article is good, you can share it so that more people can see it.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report