What issues should I pay attention to when sending software to the Android Market?

Source: Internet
Author: User

Introduction: This is a collection of [Android underlying development] Android development issues. It introduces Java-related knowledge, skills, experiences, and some java source code.


1. What issues should I pay attention to when sending software to the Android Market?
Many netizens may have registered their Android Market accounts, but what problems should they consider if they want to release a software program well?
(1) Compatibility
There are a wide range of brand positioning options for Android devices on the market. Here, the tutorial home roughly divides these categories into several categories:
(1). Android 1.5, 1.6, Android 2.0, Android 2.1, 2.2, or versions by operating system.
(2 ). according to the screen resolution, currently, WVGA is the mainstream, that is, 480 × 800 currently accounts for nearly half of the total. Of course, some hvga's 320 × 480 share about 45%, there are relatively few low-end qvga machines, such as Moto me511, HTC tattoo, HTC Aria, and HTC bee, which have a relatively low resolution ratio of 240x320.
(3). Hardware or extended libraries, such as WiFi, GPS, GSM/GPRS modules, and OpenGL 3D hardware accelerators.
In the face of the above three problems, the EOE community can tell you a simple way to deal with them, for example, setting them directly in androidmanifest. XML, so that Google's Android Market can be adaptive. The solutions to the above problems are as follows:
(1 ). re-configure the use-SDK node. For example, you can only use the nodes between Android 2.0 and Android 2.1, But 2.2 cannot use the nodes. You can set the intermediate number to indicate the API level, the maxsdkversion attribute is not supported in earlier sdks, And the ADT may fail to be compiled.
(2 ). for resolution, we can add supports-screens nodes, such as compatible with hvga and WVGA. Here small indicates qvga, normal indicates hvga, and large indicates WVGA or fwvga, the final density also involves LCD screens.
(3 ). extended libraries, for example, the Google Maps package or the OMS Library of China Mobile, may need words. Of course, hardware problems can also be introduced to feature nodes such as <Android: glesversion = "0x00020000">
Android: Name = "android. hardware. camera "Android: required =" true "/> here, we need OpenGL ES 2.0 for our game. If we need 2.1, the value is 0 × 00020001. We need a higher firmware to support it, the system's camera hardware is also required.
The detailed tutorial home is listed here:
Android. Hardware. Camera. Autofocus
Android. Hardware. Camera. Flash
Android. Hardware. sensor. Light // light sensor
Android. Software. live_wallpaper // dynamic wallpaper
Android. Hardware. sensor. proximity distance sensor
Android. Hardware. touchscreen. multitouch // multi-touch
Android. Hardware. Telephony
Android. Hardware. telephony. CDMA
Android. Hardware. telephony. GSM
(2) software privacy issues
Do not declare too many dangerous permission, such as accessing user information, contacts, text messages, call records, and location information. For general program debugging feedback, google has added the automatic feedback and logcat stack print function of its own program to the firmware of Android 2.2. You can view the function in the console background of Android Market.


2. What type of layout is match_parent?
Some netizens said they do not understand the appearance of match_parent in layout. In the past, only fill_parent and wrap_content were used. What type of match_parent is actually? In fact, fill_parent was renamed to match_parent from Android 2.2. From apilevel to 8, we can directly use match_parent to replace fill_parent. Finally, the tutorial reminds everyone that their definition is essentially-1, I just changed an alias. It may be more accurate. For example, the final definition in the SDK is:
Fill_parent-1 The View shoshould be as big as its parent (minus padding). This constant is
Deprecated starting from API Level 8 and is replaced by match_parent.
Match_parent-1 The View shoshould be as big as its parent (minus padding). Introduced in API Level 8.
Wrap_content-2 The View shoshould be only big enough to enclose its content (plus padding ).


3. Android line breaks into boxes
We all know that android is based on the Linux kernel, and \ n is used when handling line breaks, while the Windows Server Processes line breaks as \ r \ n, for Android, the \ r or carriage return character may become a black box or square, we can replace \ r \ n with \ n on the textview, editview, and other text display controls of Android.


4. Differences between gone, visible, and invisible in view status
Many netizens may find that the setvisibility Method for displaying the View class settings has three situations: gone, visible, and invisible. What are the differences between them? Here is a simple example. Many users may find that some Android apps contain AdMob or AdSense ad strips. If this view is set to gone, it disappears and the ad bar is invisible and occupies no space. Invisible indicates that the advertisement bar is blank, but it is still stuck with its layout height and width. Visible is the standard display status.


5. How to run a single Android instance
We all know that the Android platform does not have a task manager, and the internal app maintainer has an activity historystack to display and destroy windows, startactivity may use the flag_activity_new_task flag to open a new window, for example, launcher. Therefore, it is easy to implement a single task, the first way to correct the following error is directly in androidmanifest. android: launchmode = "singleinstance" is added to the XML application node. In fact, this does not play any role. The history stack maintained in apps acts on the activity, android: launchmode = "singleinstance" must be added to the activity node to ensure a single instance. Of course, it is generally added to the activity in the main program startup window.

6. droid2 cannot identify ADB Problem Solution

Currently, the Motorola droid2 mobile phone cannot recognize ADB. Although device drivers can be installed on Windows XP/7 through the driver installed on the Moto, the Device Manager of ddms cannot be identified in eclipse, this problem has also occurred before, mainly because your current ADT plug-in version is too low. Generally, Google releases a high version of firmware each time, for example, in Android 2.2, the ADT plug-in will be upgraded to support some of its features.


7. Simultaneous use of bug in listview and scrollview
Many users may find that components such as listview and scrollview are embedded together, and some bugs cannot be displayed normally. For example, a typical example is that the listview contained in scrollview can only display about 2 rows, the data in listview must be much larger than two. We recommend that you rewrite the onmeasure method of listview to reset the display height of the control, in onmeasure, we use the setmeasureddimension method to reset the display size of the control. It is also applicable to horizontal scrolling listview mentioned by some netizens. Of course, some netizens may use horizontalscrollview to implement horizontal scrolling listview.


8. How to convert pixel pixels into independent pixels of DIP Devices
Recently, some netizens asked how to convert PX pixels into independent dip device pixels. Due to the large number of Android device resolutions, WVGA is currently the mainstream, and many old devices are hvga or even low-end qvga, for compatibility, dip is nothing more than convenient. It is recommended to use dip because it has nothing to do with resolution and screen density, the ophoneos mobile phone's support for dip is terrible, and the displayed results will be magnified. Meanwhile, the black subject will lead to regular black text that will make the user unable to distinguish. Px = (INT) (Dip * density + 0.5f) // here, the EOE community prompts many users that there is a problem with the method for obtaining density. What they get from resources is statically defined, generally, 1.0 is correct for hvga, and WVGA should be obtained from windowsmanager. WVGA is 1.5.


9. Android btimap solution for processing large images
We all know that the Dalvik Vm of Android provides about 16 MB of memory for an application. Generally, when we process images larger than 8 Mb, an outofmemoryerror error occurs, we can decode an image using bitmapfactory to prevent memory exceptions. the udeintempstorage attribute of options is resolved. The Code is as follows:

Bitmapfactory. Options cwj = new bitmapfactory. Options ();

Cwj. intempstorage = new byte [1024*1024*5]; // 5 MB temporary storage space

Bitmap Bm = bitmapfactory. decodefile (inputstream, cwj); // here, cwj is the options attribute.


10. Chinese characters encountered in parsing XML files in Android
Many Android Developers may complain that the XML parsing library is not perfect. For many domestic servers, it is not a standard UTF-8 encoding. When encountering Chinese characters, the parser may stop or parse garbled characters. Here is the tutorial home to show you the common solutions:
(1) When the android sax library encounters GBK or gb2312 Encoding

Method 1. The explicit encoding that can be displayed is as follows:
Inputsource is = new inputsource (inputstream );
Is. setencoding (UTF-8 ″);


Method 2. Use inputstreamreader for conversion
You can see in the SDK that there is such an instantiation method. Parameter 2 is the character set inputstreamreader (inputstream in, charset)

The specific usage can be

Inputsource is = new inputsource (New inputstreamreader (inputstream, "gb2312 ″));
For details about inputsource, we follow the principle that if there is a forward stream available, the parser will directly read the stream and ignore any text encoding declarations found in the stream. If there is no rst stream but there is word throttling, the parser will use this byte stream to enable the encoding specified in inputsource, or (if no encoding is specified) use an algorithm such as the XML specification to automatically detect character encoding. If there is no upstream stream and no byte stream is available, the parser attempts to open the URI connection to the resource identified by the system identifier.

Activity, positioning, GPS, SDK, ADT
This topic was approved by 76135 at 17:36:48 on

 

Source: http://www.eoeandroid.com/thread-64254-1-1.html

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.