Showing posts with label Ubuntu. Show all posts
Showing posts with label Ubuntu. Show all posts

Sunday, March 2, 2014

Android SDK Tools on Ubuntu 14.04 beta x64

Android SDK Tools require 32 bit libraries and normally you are recommended to install ia32-libs package, which is not available for Ubuntu 14.04 anymore.
$ sudo apt-get install ia32-libs
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package ia32-libs is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
  lib32z1 lib32ncurses5 lib32bz2-1.0

E: Package 'ia32-libs' has no installation candidate
 

Android Debug Bridge (adb) 

$ ~/android-sdk-linux/platform-tools/adb
/home/dandar3/android-sdk-linux/platform-tools/adb: error while loading shared libraries: 
libstdc++.so.6: cannot open shared object file: No such file or directory

Install lib32stdc++6 package:
$ sudo apt-get install lib32stdc++6
[...]
The following NEW packages will be installed
  lib32stdc++6
0 to upgrade, 1 to newly install, 0 to remove and 0 not to upgrade.
[...]
Preparing to unpack .../lib32stdc++6_4.8.2-16ubuntu4_amd64.deb ...
Unpacking lib32stdc++6 (4.8.2-16ubuntu4) ...
Setting up lib32stdc++6 (4.8.2-16ubuntu4) ...
Processing triggers for libc-bin (2.19-0ubuntu2) ...
adb should work fine now.
$ ~/android-sdk-linux/platform-tools/adb version
Android Debug Bridge version 1.0.31

Android Asset Packaging Tool (aapt)


aapt requires both lib32stdc++6 as well as lib32z1 (which in fairness it was suggested above).

$ sudo apt-get install lib32z1
[...]
The following NEW packages will be installed
  lib32z1
0 to upgrade, 1 to newly install, 0 to remove and 0 not to upgrade.
[...]
Preparing to unpack .../lib32z1_1%3a1.2.8.dfsg-1ubuntu1_amd64.deb ...
Unpacking lib32z1 (1:1.2.8.dfsg-1ubuntu1) ...
Setting up lib32z1 (1:1.2.8.dfsg-1ubuntu1) ...
Processing triggers for libc-bin (2.19-0ubuntu2) ...

Testing again it should work now:
$ ~/android-sdk-linux/build-tools/19.0.2/aapt version
Android Asset Packaging Tool, v0.2


Resources:


Friday, May 24, 2013

Android Emulator performance - Windows 8 vs Ubuntu 13.04

I mentioned earlier I've been trying Ubuntu for Android development, and today I'll try to capture the difference in performance of the Android emulator on the two platforms. I haven't seen much difference in terms of Eclipse performance, but when it comes down to the Emulator it is quite obvious.

I'm not quite sure what makes the difference so large, might be the OS or maybe the QEMU software implementation on each OS. I chose to test with Android 4.2.2 AVD images just to push it - older versions like Android 2.1 or 2.3 seem to work better.

Also I'm running the tests on my home Dell laptop which is a few years old, making the difference even more obvious. I find Windows 8 on this machine faster than Windows 7 and generally a pleasant experience while probably on par with Ubuntu 13.04 in terms of performance.

While I find Windows more familiar and easier to use, because of the poor Android emulator experience on Windows I find using Ubuntu a less annoying experience for this particular task.

Environment


Machine

  • Dell Vostro 1520
  • 15.4” Widescreen WXGA+ CCLF, anti-glare (1440x900);
  • Intel Core 2 Duo P8600 (2.4 GHz, 1066 Mhz, 3 MB cache);
  • Intel® 45 Express chipset
  • Intel Integrated GMA 4500MHD;
  • 4 GB RAM, 800 MHz DDR2 Dual Channel;
  • 320 GB Seagate ST9320423ASG 7200 rpm, NCQ enabled;

    Windows 8

    • Windows 8 (x64)
      Version: 6.2.9200
    • android-sdk\tools\emulator-x86.exe
      Version: n/a
      Build Time: Tue May 14 02:49:56 2013
    • Intel HAXM 1.0.6 
    • Intel 4 Series Express display driver
      WDDM 1.1, 8.15.10.2702

    Ubuntu 13.04

    • Ubuntu 13.04 (x64)
      Linux VOSTRO 3.8.0-21-generic #32-Ubuntu SMP Tue May 14 22:16:46 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
    • android-sdk/tools/emulator64-x86
      Android emulator version 22.0 (build_id OPENMASTER-675183)

    Eclipse / Android SDK

    • Eclipse 4.3 M7 x64, Kepler
      • 20130509-1105 (x64) - Windows
      • 20130225-0426 (x64) - Ubuntu
    • Oracle / Sun JDK 1.7.0_21 (x64)
    • Android SDK Tools 22
    • Android SDK Platform Tools 17
    • Android 4.2.2 (API 17) - Intel x86 Atom System Image rev. 1

    Android Virtual Devices


    Phone

    • 3.2" QVGA (320 x 480: mdpi)
    • Android 4.2.2 - API Level 17
    • Intel Atom (x86)
    • RAM: 512 MB
    • VM Heap: 16 MB
    • Internal Storage: 200 MB
    • SD Card: 200 MB
    • Use Host GPU

    Nexus 7

    • Nexus 7 (7.27", 800 x 1280: tvdpi)
    • Android 4.2.2 - API Level 17
    • Intel Atom (x86)
    • RAM: 512 MB
    • VM Heap: 32 MB
    • Internal Storage: 200 MB
    • SD Card: 200 MB
    • Use Host GPU

    Windows 8


    Performance on the Phone AVD is acceptable although slightly laggy, using Intel HAXM 1.0.6 and "Use Host GPU" option. My GPU chip / driver don't seem to support OpenGL 2.0 (1.1 only?), showing in the startup messages.
    Starting emulator for AVD 'Phone_4.2'
    Failed to create Context 0x3005
    could not get wglGetExtensionsStringARB
    emulator: WARNING: Could not initialize OpenglES emulation, using software renderer.
    could not get wglGetExtensionsStringARB
    could not get wglGetExtensionsStringARB
    could not get wglGetExtensionsStringARB
    could not get wglGetExtensionsStringARB
    could not get wglGetExtensionsStringARB
    could not get wglGetExtensionsStringARB
    could not get wglGetExtensionsStringARB
    emulator: device fd:688
    HAX is working and emulator runs in fast virt mode
    AnTuTu Benchmark v3.3 scores:
    • Total: 13,837
    • CPU: 7,503
    • GPU: 141
    • RAM: 5,643
    • I/O: 550

    For Nexus 7 AVD, I had to drop down the RAM to 512 MB to get HAXM working with it, maybe because I configured HAXM earlier to only use 512 MB, trying to avoid the system running out of memory (only 4 GB of RAM). The experience is laggy (1-2 seconds wait between activities), barely usable - disabling animations helps a bit.
    Starting emulator for AVD 'Nexus_7'
    Failed to create Context 0x3005
    could not get wglGetExtensionsStringARB
    emulator: WARNING: Could not initialize OpenglES emulation, using software renderer.
    could not get wglGetExtensionsStringARB
    could not get wglGetExtensionsStringARB
    could not get wglGetExtensionsStringARB
    could not get wglGetExtensionsStringARB
    could not get wglGetExtensionsStringARB
    could not get wglGetExtensionsStringARB
    could not get wglGetExtensionsStringARB
    emulator: device fd:692
    HAX is working and emulator runs in fast virt mode
    emulator: emulator window was out of view and was recentered
    AnTuTu Benchmark v3.3 scores:
    • Total: 11,572
    • CPU: 6,282
    • GPU: 42
    • RAM: 4,713
    • I/O: 535

    Ubuntu 13.04


    Emulators start in seconds (15-30) to desktop, compared to minutes (1-3) in Windows!

    Phone 4.2 AVD is quite snappy, and haven't done anything special for it like install KVM. No additional messages at startup. AnTuTu shows same OpenGL 1.1 on screen during testing, but the FPS is much higher (~60 fps)!

    AnTuTu Benchmark v3.3 scores:
    • Total: 15,440
    • CPU: 7,728
    • GPU: 1,234
    • RAM: 5,918
    • I/O: 560

    Nexus 7 AVD starts quickly and it's very snappy! Navigation through activities and scrolling is very responsive, a huge difference from Windows. Some error messages at image startup though:
    Starting emulator for AVD 'Nexus_7'
    Failed to load libGL.so
    error libGL.so: cannot open shared object file: No such file or directory
    Failed to load libGL.so
    error libGL.so: cannot open shared object file: No such file or directory
    emulator: emulator window was out of view and was recentered
    Reading this thread I created the link below to fix the error message - didn't see any change in the scores though.
    # sudo apt-get install libgl1-mesa-dev
    # sudo ln -sv /usr/lib/x86_64-linux-gnu/libGL.so /usr/lib/libGL.so
    ‘/usr/lib/libGL.so’ -> ‘/usr/lib/x86_64-linux-gnu/libGL.so’
    
    AnTuTu Benchmark v3.3 scores:
    • Total: 14,104
    • CPU: 7,365
    • GPU: 538
    • RAM: 5,662
    • I/O: 560

    Sunday, April 28, 2013

    Ubuntu 13.04 on ASUS R2H

    With Ubuntu 13.04 "Raring Ringtail" just released the other day, thought I would upgrade the recent 12.04 installation. Instead of doing a fresh install, I've decided for an upgrade - never done one before and wanted to see how well it works.

    I wouldn't recommend it though, for two reasons: one cause I first had to upgrade to 12.10 (~700 MB download) and then again to 13.04 (another 700MB) - much larger than downloading the full 13.04 ISO - and second cause the wi-fi network was quite slow at around 50 KB/s and took ages to download and seemed like hogging the wi-fi channel for my laptop to use at the same time (seen similar with the original install when downloading updates). One advantage on the other hand is that it kept what I had, like apps and screen resolution / calibration.

    Some parts of the UI seem a little more responsive (like dragging the on-screen keyboard around), but the I guess visual effects (fading, zooming) make it slower. Other things like starting programs seem slower as well - the file manager starts after a few seconds after being clicked with a gray window for another couple of seconds, then you get your files. VNC connection seems slower as well.

    Cue Ubutu Software Center > Unity Tweak Tool.


    CompizConfig Settings Manager is still there - disabling animations and fading windows locks up the UI for a good few seconds, but it will come back eventually.


    One thing I didn't cover in previous post was the on-board keyboard, which comes very handy when you use the unit away from your desk. Search for OnBoard Settings:


    Another thing I didn't cover was how to enable hibernation. Press the Power hardware button and will be presented with the lock / standby / hibernate / shutdown dialog.
    http://askubuntu.com/questions/94754/how-to-enable-hibernation

    And this is all for now...


    Saturday, April 13, 2013

    Ubuntu 12.04.2 on ASUS R2H

    Today we're going to install Ubuntu 12.04.2 Desktop on the ASUS-R2H UMPC. Why not latest 12.10? I've already done that and somehow it seems slower - feel free to install that if you want, should be fairly close to the one below.
    * * *

    Screen resolution is quite low (640x480) and windows are not fitting entirely. If you have an external monitor connect it through the VGA port, otherwise you use ALT + left mouse to move a window around say to get to the buttons at the bottom (best to connect an external mouse and keyboard).

    You can increase the resolution to 800x480 by going into System Settings (left) > Displays, and in there uncheck Mirror displays box, select Laptop (left) and change the resolution from the drop-down (now 800x480 becomes available, filling up the screen).


    If you prefer to continue the installation remotely, once you connect to the local network (wi-fi or wired) enable Desktop Sharing and use a VNC client for remote control - I've used TightVNC from my Windows laptop.


    Start installation with the shortcut on the desktop. I won't cover all steps, they are quite easy to follow and you can find a lot of step-by-step tutorials on the net covering it all in detail. Checking the box to Download updates while installing makes it download a lot of things during installation and at times it will hog the wi-fi network...


    What I will cover though is the partition creation part - I already had the disk split into a Windows 8 partition (will replace with Ubuntu) and a personal data partition (that i'd like to keep). In my previous attempt, I chose the Install Ubuntu alongside Windows 8 which didn't work out very well for me, as it removed all partitions (again, remember to back up your disk! see note at the start) - maybe because it couldn't find any un-allocated disk space. So what I'll do is go with the manual option, remove the recovery and Windows 8 partition and manually create a swap and system partitions for Ubuntu (just as well it might work to use the manual step to remove the two and then come back and choose the first option, haven't tried it though).


    Remove first two partitions
    Create new partitions (swap + system)
    Click Install now to continue with the installation, that will take a while... Once done it will ask you to restart - remove the USB stick and restart.

    * * *

    Now installed, login and change resolution, maybe enable Desktop Sharing, just like you did when in the installer (see above). Finish installing updates (around 139) through the Update Manager (left) - that will take a while...

    UI performance:
    • install MyUnity and CompizConfig Settings Manager (Ubuntu Software Center)
    • disable window animations, fading and other effects...


    Touch screen works, but the cursor is off:
    • install xinput-calibrator (Ubuntu Software Center)
      https://apps.ubuntu.com/cat/applications/xinput-calibrator/
    • Run application from Dash Home (search for calibrate)
    • Copy the on-screen output and save to persist settings:
      copy the snippet below into '/etc/X11/xorg.conf.d/99-calibration.conf'...
    • Select text (existing terminal window) > right click > Copy
    • Right-click (existing terminal window) > Open Terminal
    • sudo mkdir /etc/X11/xorg.conf.d/
    • sudo gedit /etc/X11/xorg.conf.d/99-calibration.conf
    • Right click > Paste > Save

    Webcam works, but the image is upside down. Haven't tried this fix just yet:
    http://www.danbishop.org/2011/03/27/asus-upside-down-webcam-in-ubuntu/

    Bluetooth seems to work out of the box.

    Fingerprint reader:
    • install Fingerprint GUI
      https://launchpad.net/~fingerprint/+archive/fingerprint-gui
      sudo add-apt-repository ppa:fingerprint/fingerprint-gui
      sudo apt-get update
      sudo apt-get install libbsapi policykit-1-fingerprint-gui fingerprint-gui
    • logout and log back in
    • run Fingerprint GUI to enroll / verify your fingerprint(s)

    GPS