<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    隨筆-348  評(píng)論-598  文章-0  trackbacks-0

    I’m starting to learn how to develop to Android and so far to me the only downside of the whole dev environment is the painfully slow Android Emulator. Don’t get me wrong, it’s such a beautifully made emulator that covers most (if not all) details of a real device, I specially like tricks such as limiting network bandwidth to simulate your app under a slow connection, but let’s face it, the thing is slow.

    I have to say I don’t have a top of line computer either, it’s a Core 2 Duo with 4gb of RAM running Ubuntu 11.10 (amd64), so I started searching for tricks to speedup the emulator, until I found that Android-x86 can be used as a emulator. The experience is not as good as Google’s official emulator but with some tweaks you can really speedup turnaround both in boot time and overall execution speed. OK, TL;DR, enough small talk, let’s get down to business, click the following link to go to the full post :)

    The Android-x86 project provides some ISO images that can be ran on VirtualBox (download it here if you don’t have it yet). I took the time to wrote the steps bellow based on various blog posts about the subject.

    First, download an ISO from Android-x86 download page, android-x86-2.3-RC1-eeepc.iso should do, this one is pretty stable and has ethernet support. There is a RC1 honeycomb port here but I didn’t test it.

    Now create a VM on VirtualBox, my settings were:

    Linux / Linux 2.6, RAM: 256 MB, Fixed Size, 512 MiB VDI Disk

     

    You can play with these options to find which ones fits better with your apps, for me 256 MiB was sufficient

     

     

    OK, after that you need to setup the ISO file, to do this select your VM from the list and go to Settings / Storage, click on the disk icon and chose a virtual CD/DVD disk file. Select your ISO of choice :)

     

     

    Now go to Network, there you have two easy options – If you have a router on your network, select Bridged Adapter and your internet connected adapter (mine is eth1). This is the easiest option in my opinion.

     

     

    If you don’t have a router or if it didn’t work for any reason, select NAT. Using NAT you can’t connect directly to the device, but thankfully VirtualBox has a handy port forward feature. To use it you just need to click on Advanced / Port forwarding and add a rule like this one:

     

     

    Note that no matter which mode you choose you need to click in advanced and select PCnet-FAST III as the Adapter Type.

    You can also disable the USB controller if you don’t need it.

    Now click OK and start up your VM. From the GRUB menu, select Install to Harddisk

     

     

    Follow screen instructions. From the partition options menu select Create/Modify partitions, this will show you the partition manager (cfdisk), there, using the arrow keys, select New / Primary and specify the size (534.64 for me). Make the partition Bootable and select Write, after that select Quit to go back to the installation menu.

    Select the recently created partition (sda1) and click OK. Now format the partition as ext3 and install GRUB.

    When the installation asks if you want the system directory as read-write, answer Yes. Installation should not take long. You can create a fake SD card, I created an 128 MiB one. You can skip this step and select reboot.

    Now that installation is done you can shutdown the VM, go to settings and remove the ISO from the settings menu, and start it again.

     

     

    From the GRUB menu above, select Debug Mode to configure the screen resolution, here I created a 480×750 entry to better simulate a smartphone screen. To do this you need to run these commands:

    mount -o remount,rw /mnt
    cd /mnt/grub
    vi menu.lst

     

    This will open GRUB’s menu configuration with the default entries, you need to create a new entry with these options:

    title Android-x86 2.3 Smartphone
            kernel /android-2.3-RC1/kernel quiet root=/dev/ram0 androidboot_hardware=eeepc acpi_sleep=s3_bios,s3_mode DPI=160 UVESA_MODE=480x800 SRC=/android-2.3-RC1 SDCARD=/data/sdcard.img
     

    To go to edit mode on vi use the Insert key (to go to insert mode). After inserting the above lines save the file to disk: press Escape (to leave insert mode), then write :wq on the bottom command line.

    Now you need to umount the disk and reboot your VM, to do this execute these comands:

    cd /
    umount /mnt
    reboot -f

     

    And Done! Now let’s go to some needed adjustments…

    After a couple seconds you’ll be greeted with Android’s home screen. Click on the VM screen, if the cursor don’t show up press  Right CTRL + i, click on the application menu icon and go to Settings. There, enable the Ethernet adapter. To go back to the home screen press Win Key, to go back one screen press Esc. To show the options menu press F2.

     

     

    If you choose NAT you’re ready to go, if you choose Bridged you need to get the VM’s IP, so press ALT + F1 to go to the Busybox prompt and execute netcfg.

    Your network configuration will be printed to the console, to go back to the user interface press ALT + F7.

     

     

    Now you need to connect adb to be able to use the emulator from Eclipse.

    Open a console and go to android sdk home/platform-tools, once there execute this for NAT:

    adb connect 127.0.0.1

     

    If you set networking as Bridged Adapter, execute this:

    adb connect your-android-ip-see-netcfg-step-above
     

    Done with the adjustments :)

    Now go to Eclipse and run your project as an Android Application, if the device selection screen doesn’t show up go to Run Configurations and set the Android Launcher to use Manual selection.

     

     

    Dpne! (for real this time)

    I usually test using the official emulator once just to make sure everything is OK.

    You can also download older versions of android from the android-x86 project website to simulate other devices. Hope it helps, if you have any problems let me know in the comments section :)



    ---------------------------------------------------------
    專注移動(dòng)開發(fā)

    Android, Windows Mobile, iPhone, J2ME, BlackBerry, Symbian
    posted on 2011-11-21 08:54 TiGERTiAN 閱讀(1065) 評(píng)論(0)  編輯  收藏

    只有注冊(cè)用戶登錄后才能發(fā)表評(píng)論。


    網(wǎng)站導(dǎo)航:
    博客園   IT新聞   Chat2DB   C++博客   博問  
     
    主站蜘蛛池模板: 一级做a爰片久久毛片免费看| mm1313亚洲精品国产| 羞羞视频免费网站日本| 亚洲国产精品人久久电影| 亚洲老妈激情一区二区三区| 亚欧免费无码aⅴ在线观看| 黄色一级视频免费观看| 中文日韩亚洲欧美制服| 亚洲午夜精品在线| 久久久久亚洲精品无码蜜桃| 亚洲欧洲自拍拍偷午夜色无码| 老湿机一区午夜精品免费福利 | 久久精品国产亚洲av四虎| 国产免费久久精品久久久| 免费无码肉片在线观看| 在线看免费观看AV深夜影院| 色欲A∨无码蜜臀AV免费播| 黄色短视频免费看| 一级白嫩美女毛片免费| 无码日韩人妻AV一区免费l| 色费女人18女人毛片免费视频| 亚洲欧洲日韩国产综合在线二区| 久久久久国色AV免费看图片| 3d动漫精品啪啪一区二区免费| 麻豆安全免费网址入口| 久久亚洲中文字幕精品有坂深雪| 国产精品va无码免费麻豆| 女人18一级毛片免费观看| 国产免费看JIZZ视频| 亚洲AV无码一区二区三区牲色 | 久久精品国产亚洲AV麻豆不卡| 日韩激情淫片免费看| 在线观看片免费人成视频无码| 亚洲AV永久无码精品一百度影院| 成人片黄网站色大片免费| 免费观看成人久久网免费观看| 亚洲高清国产拍精品熟女| 亚洲成av人在线观看网站| 欧美色欧美亚洲另类二区| 黄色免费在线网址| 羞羞视频免费网站在线看|