Android系统开发教程之Android开发在虚拟机的优化

Android虚拟机的出现方便开发者使用安卓环境更为方便开发。可以让你在PC端(电脑上)安装运行模拟Android系统。并可以在电脑端进行几乎任何手机上可以进行的操作,甚至还可以像手机一样连接电脑,被手机助手检测到,可以模拟所有官方版本的安卓系统,并且有多款皮肤和屏幕样式可供选择。 Android系统开发教程关于Android在虚拟机和原生库层面进行的优化。

 Android虚拟机概述

 虚拟机中指令的解释时问主要分为3个方面,分别是分发指令、访问运算数、执行运算。其中“分发指令”这个环节对性能的影响最大,为了加快运行速度,必须提高分发指令的速度。

 与传统的Java虚拟机基于栈不同,Dalvik是基于寄存器的。基于寄存器的虚拟机实现,虽然在硬件通用性上稍逊一筹,但是数据处理速度却有明显的改善,可以更为有效地减小冗余指令的分发和减小内存的读写访问。

  Android虚拟机优化

 Dalvik虚拟机针对移动终端所做的优化,使得其不需要很快的CPU速度和大量的内存空间。根据Google的测算,Android的早期版本只需要64MB的RAM即可使系统正常运转,其中24MB被用于底层系统的初始化和启动,另外20MB被用于高层启动、高层服务。随着Android版本的不断升级和应用功能的扩展,Android对内存的消耗也在逐渐增加。

 另外需要注意的是,Dalvik并不是按照Java虚拟机的规范来实现的,两者并不兼容。Java虚拟机运行的是Java字节码,而Dalvik虚拟机运行的则是其专有的DEX(DalvikExecutable)字节码。

 关于Java虚拟机

 在Java SE程序中,Java类会被编译成一个或者多个字节码文件(.class),然后打包成JAR文件。在执行期间,Java虚拟机会从JAR文件抽取相应的CLASS文件并从中读取指令和数据。而Android虽然也是基于Java语言进行编程的,但是在编译成CLASS文件后,Android会通过“dX”工具将应用所有的CLASS文件转换一个DEX文件,接着将DEX和应用的其他如资源文件等一起打包构成APK文件,而后Dalvik虚拟机会从其中读取指令和数据。

 上文的内容中,详细讲解Android开发环境搭建在虚拟机和原生库层面进行的优化,Android虚拟机的出现开发者更为方便进行Android开发。如果您同样对 Android应用开发感兴趣,可以关注我们的官网网站和微信、微博等。
[14本经典Android开发教程]-11-Android系统移植技术详解 -------------------------------------------------- (1)安装如下软件包 sudo apt-get install git-core sudo apt-get install gnupg sudo apt-get install sun-java5-jdk sudo apt-get install flex sudo apt-get install bison sudo apt-get install gperf sudo apt-get install libsdl-dev sudo apt-get install libesd0-dev sudo apt-get install build-essential sudo apt-get install zip sudo apt-get install curl sudo apt-get install libncurses5-dev sudo apt-get install zlib1g-dev .... -------------------------------------------------- 已上传9本: [14本经典Android开发教程]-1-Android开发从入门到精通 http://download.csdn.net/detail/cleopard/8355245 [14本经典Android开发教程]-2-Android开发手册—API函数详解 http://download.csdn.net/detail/cleopard/8374487 [14本经典Android开发教程]-3-Android SDK 中文开发文档 http://download.csdn.net/detail/cleopard/8380429 [14本经典Android开发教程]-4-Android应用程序开发36技 http://download.csdn.net/detail/cleopard/8380495 [14本经典Android开发教程]-5-linux Android基础知识总结 http://download.csdn.net/detail/cleopard/8380529 [14本经典Android开发教程]-6-Android驱动开发入门及手机案例开发分析教程 http://download.csdn.net/detail/cleopard/8388019 ....... 剩余3本稍后上传!@或直接从这里寻找@ http://download.csdn.net/user/cleopard/album @更多@ http://cleopard.download.csdn.net/ 福利 http://xuemeilaile.com 17份软件测试文档 http://download.csdn.net/album/detail/1425 13份WPF经典开发教程 http://download.csdn.net/album/detail/1115 C#资料合辑二[C#桌面编程入门篇] http://download.csdn.net/album/detail/957 C#资料合辑一[C#入门篇] http://download.csdn.net/album/detail/669 [Csharp高级编程(第6版)](共8压缩卷) http://download.csdn.net/album/detail/667 10个[精品资源]Java学习资料合辑[一] http://download.csdn.net/album/detail/663 10个C#Socket编程代码示例 http://download.csdn.net/album/detail/631 6份GDI+程序设计资源整合[全零分] http://download.csdn.net/album/detail/625 2014年移动游戏行业数据分析 http://download.csdn.net/detail/cleopard/8340331 一文读懂2014年全球互联网广告新生态 http://download.csdn.net/detail/cleopard/8340303
Android虚拟机Dalvik完整源码,宝贵资源,欢迎下载! This directory contains the Dalvik virtual machine and core class library, as well as related tools, libraries, and tests. A note about the licenses and header comments --------------------------------------------- Much of the code under this directory originally came from the Apache Harmony project, and as such contains the standard Apache header comment. Some of the code was written originally for the Android project, and as such contains the standard Android header comment. Some files contain code from both projects. In these cases, the header comment is a combination of the other two, and the portions of the code from Harmony are identified as indicated in the comment. Here is the combined header comment: /* * Copyright (C) The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * ---------- * * Portions of the code surrounded by "// BEGIN Harmony code" and * "// END Harmony code" are copyrighted and licensed separately, as * follows: * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ Native SH call bridge --------------------- Native SH call bridge is written by Shin-ichiro KAWASAKI and Contributed to Android by Hitachi, Ltd. and Renesas Solutions Corp.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值