Android 2.2 compatibility porting

Source: Internet
Author: User

1.
Most users may find that the path of/sdcard/has changed to/mnt/sdcard /.
Android. OS. environment. getexternalstoragedirectory (). getabsolutepath ()
To obtain the sdcard path.

 

2.
App2sd, which can be enabled by the switch in settings. The packagemanager class has some new labels. For compatibility, we use reflection to dynamically call and compare
Reliable. The method for determining the API level is build. version. SDK. Note that this is string type and the return value is a number directly. For example, the return value of 8 is Android.
2.2.

 

3. GPS switch. We need to switch GPS for many lbs applications.
1.5 start with the GPS switch method has a new way, and considering the Android. provider. settings. Secure package introduced by the security system
You can use setlocationproviderenabled (contentresolver Cr, string provider,
Boolean enabled), android123 prompts that this method is not public until the API level is 8, by compiling android
Framework or reflection requires an OEM signature for some machine calls to work properly.

 

4. The name of fill_parent is changed to match_parent. However, this does not seem to have a past image. We hope you will pay attention to the porting section of the android Development Network.

 

Http://tonyyu.iteye.com/blog/753466

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.