Android screen Adaptation
May 16, 2014
Android
As is known to all, the Android model has a variety of sizes, so screen adaptation becomes an important part of Android development.
separated values. In general, the 240x320 screen is low-density 120dpi, that is, the ldpi;320x480 screen is medium density 160dpi, that is, the mdpi;480x800 screen is high-density 240dpi, that is, the hdpi;720x1280 screen is ultra-high-density 320dpi, That is, the xhdpi;1080x1920
(FragmentFirst)". you need to modify the import "import android. support. v4.app. fragment; "pay attention to support. v4.app/view must be consistent.5. implement slide screen conversion icon
In this case, you need to add a custom variable when setting the sliding switch icon at the bottom:
// Private ImageView image
(fragmentSecond); listData. add (fragmentThird); // ViewPager is equivalent to a component container implementing page switching fpAdapter = new FragmentPagerAdapter (getsuppfrfragmentmanager () {@ Overridepublic int getCount () {return listData. size () ;}@ Overridepublic Fragment getItem (int arg0) {return listData. get (arg0) ;}}; // set the adapter viewPager1.setAdapter (fpAdapter );}}
In this case, you can achieve the touch screen switching
http://www.stormzhang.com/android/2014/05/16/android-screen-adaptation/(xhdpi becomes preferred)As is known to all, the Android model has a variety of sizes, so screen adaptation becomes an important part of Android development.
automatically go to the appropriate folder to find resources, this situation is in high-density, and low-density mobile phones, such as a 240x320 pixel cell phone,If you set android:anydensity= "false", the Android system will convert 320 (low density) to 320x480 (medium density), so the app will load the resources in the mdpi file on the small-density phone.3.2 Whether to support large screenAndroid:large
the configuration file AndroidMainfest. xml
Modify the configuration file in Android/app/mainfests/AndroidMainfest. xml as follows:
1
(2) implemented through java code:
1 import android. content. pm. activityInfo; 2 import android. OS. bundle; 3 import android. support.
The launch of Android 4.4 , power-saving technology, Google also said that the improvement! Let's get to know what's going on with Android 4.4 Power-saving technology !Test conclusion:1) The most power-saving of the off-screen standby:A) any app including background service should minimize the number of wake-up CPU, su
point for one resolution). the status bar and title bar height are 38px or 25dip.The screen width is 800px or 800dip, and the working area height is 442px or 455dip;Screen width: Px or dip, working area Height: Px or 775dip.In the Android Application Package apk, the system will reference the corresponding resource file according to the specific situation of eac
In the previous chapter, we did not remove the title bar and status bar. If the title bar and status bar are not displayed in the game, it is very easy to remove them, add the following two sentences to the onCreate method of mainActivity:RequestWindowFeature (Window. FEATURE_NO_TITLE); // set no titleGetWindow (). setFlags (WindowManager. LayoutParams. FLAG_FULLSCREEN, WindowManager. LayoutParams. FLAG_FULLSCREEN); // set full screenHurry up and try it. To write a program, you just need to try
, the layout displayed on the portrait screen is changed to the landscape screen because of the width and height. All the changes will affect the layout (unless you create two sets of scenes and then add a judge how to display them on the Landscape screen, how to display the image on the portrait screen), of course, th
Android Phone Support screen rotation function, mobile phone screen rotation directly triggered our app view changes, we choose how to handle the mobile phone flip and when our mobile phone screen has been rotated, we choose which strategy to process the view directly affect
? What can I do now? What can I do next? try to get the application to answer these questions immediately. If you can tell users in the first few seconds that this is the right product for them, they are bound to dig deeper. 2. Convenient Input Method Think about How you use your mobile device: The developer's mobile phone is quietly lying on a flat table and connected to a PC with a large keyboard may also turn on the backlight completely. Now, think about how other people use their smartphone
An example of this article describes the method of Android programming to achieve screen adaptive direction size and resolution. Share to everyone for your reference, specific as follows:
Android screen Adaptive direction size and resolution, including screen interface layo
customize views. We generally like and use the keyboard trigger events and screen trigger events in this view (GameView), but for example: onKeyDown (int keyCode, keyEvent). Generally, when we press the keyboard, the keyboard trigger event in the activity is directly triggered. How can we make it directly trigger the keyboard trigger event (GameView?
Method 1:Example 1:Copy codeThe Code is as follows: View CodePackage net. loonggg. project;Import
Create a virtual machineAfter installing Eclipse+adt and setting up the Android SDK path, click the button in the diagram or select the appropriate option in the menu to open the AVD Manager (Android virtual Device Manager).
Click the New button
Fill in the name, memory card size, select the screen size, click Create AVD.
Startup of virtual mach
I read a book today and saw this effect. I used the onTouchEvent (MotionEvent event) method before, but I didn't think it was so helpful. So I wrote it myself and it felt good, if the game is used in the future, click the screen to slide on the screen, and the picture will slide! Good results! Haha, I 'd like to share with you some inspiration. If you have any questions, please leave a message for source co
As is known to all, the Android model has a variety of sizes, so screen adaptation becomes an important part of Android development. Android Screen Adapter Maybe some developers will encounter this problem, today to share the next screen
Create an Android project.Start the Eclipse program, select File->new->android Application Project menu item, open the New Reference window to create a new project.Enter Geoquiz at the app name (application name) (project name is automatically updated to Geoquiz). Package name Enter Com.bignerdranch.android.geoquiz. As shown in the following:Figure 1-3 Creating a
Android phone app icon size specifications and naming specifications are as follows infographic.The Android Icon Specification infographic contains the Android launcher icon, the Android bottom menu icon, the Android Pop-up dialog
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.