如何使用android.os.SystemProperties

来源:互联网 发布:单管放大电路实验数据 编辑:程序博客网 时间:2024/05/16 05:40

 android.os.SystemProperties在SDK的库中是没有的,需要把Android SDK 目录下data下的layoutlib.jar文件加到当前工程的附加库路径中,然后在源程序中就可以Import了。

    但是这样做会出现一个问题,编译的时候会报错:Unable to execute dex: Java heap space 。在网上找了一下,这个链接比较有帮助:http://programfeelings.blogspot.com/2011/03/unable-to-execute-dex-java-heap-space.html

    上面这个链接需要翻墙才能访问,我把内容复制在下面:

    

    最近要用到第三方的庫android-sdk-windows\platforms\android-8\data\layoutlib.jar,但出現Conversion to Dalvik format failed: Unable to execute dex: null這個問題。且出現對話方塊


下面是解法:
Another way to solve the ” Conversion to Dalvik format failed: Unable to execute dex: null” problem is using the user library, the concrete steps are as follows: 
1. Right-click the project in Eclipse and select “Build Path -> Add Libraries…”. 
2. Select User Library from the list and click Next. 
3. Click the “User Libraries…” button. 
4. Click “New…” in the User Libraries dialog. 
5. Give the user library a name and select the System library checkbox and click OK. 
6. Highlight the newly added user library in the list and click the “Add JARs…” button and add the desired jar files. 
7. Click OK on the User Libraries dialog. 
8. Make sure the new user library is checked in the Add Library dialog and … 


http://wyoojune.blog.163.com/blog/static/57093325201231414510575/

原创粉丝点击