Sunday, June 03, 2012

Install Android in VirtualBox with Internet connection

  1. Download a "Buildroid for VirtualBox" OVA file at http://www.buildroid.org. There are 3 versions: for "phone", for "tablet" and for "tablet" with phone capabilities. [There is a Buildroid image with Market/Play app but "for testing purpose only".]
  2. Import the Buildroid image into Virtualbox: File --> Import Appliance...
  3. Install Google Play Store app (and other apps) (in Windows):
    • Get the adb (Android Debug Bridge) utility from Android SDK (http://developer.android.com/sdk/index.html) or download the adb at https://sites.google.com/site/keyablefile/adb-win.zip (including adb.exe and AdbWinApi.dll).
    • Download the app at http://buildroid.org/Download/buildroid-gapps-ics-20120317-signed.tgz
    • VirtualBox: Settings --> Network --> Adapter 1 --> Attached to: NAT; Advanced --> Port Forwarding --> Insert new rule: both Host Port and Guest Port = 5555. [Multiple virtual machines: increment the host port (5556,...) and keep the same guest port for each machine.] [Adapter 2 is used for emulating a Wifi connection.]
    • Start Buildroid virtual machine. Open Buildroid VM Configuration, there should be the IP address under IP Management.
    • In Windows Explorer, go to the folder containing adb.exe; Shift-right click --> Open command window here. [Check adb help for options and parameters.]
      • adb connect localhost (or adb connect the_above_IP_address)
      • adb push path\to/buildroid-gapps-ics-20120317-signed.tgz /sdcard/ (copy the .tgz apps file to Android)
      • adb shell
      • su
      • mount -o remount,rw /system
      • tar -xvzf /sdcard/buildroid-gapps-ics-20120317-signed.tgz
      • mount -o remount,ro /system
      • reboot
    • The Adroid machine will reboot and there should be Google apps including Market/Play.
Ref:
- http://keyable.blogspot.jp/2012/05/how-to-run-android-40-in-virtualbox.html
- http://www.buildroid.org/blog/?page_id=121

Install Android in VirtualBox

  • Dowwnload android-x86-4.0-RC1-eeepc.iso or android-x86-4.0-RC1-asus_laptop.iso from http://www.android-x86.org/download.
  • Create a new virtual machine on VirtualBox. OS type: Linux, version Linux 2.6. Memory: 512 MB or 1000 MB. Create a new boot harddisk. Adjust the settings: Sound: Sound Blaster 16; Network: NAT (or Bridged), adapter: PC-net-FAST III
  • Install Android. Choose Install Android-x86 to harddisk from the boot menu. Create one partition for the full harddisk, formatted as ext3. Install the boot loader GRUB. When the installation finishes, select "Run Android x86" to boot the Andoid. (Before the next booting, remove the CD image from Settings-Storage-IDE Controller.)
  • To make the mouse work in the virtual machine, go to “Machine” in the menu and select “Disable mouse integration” (right Ctrl, by default, to restore the mouse in host machine). Alt-1 and Alt-7 to enter command line or go back to graphical interface. Shutdown the machine by command-line (halt) or from menu of VirtualBox. Press Esc to exit standby mode.
  • To connect the Internet (from command line, tested with NAT):
    • netcfg to list the devices.
    • dhcpd eth0
    • setprop net.dns1 8.8.8.8
Ref:
- http://maketecheasier.com/install-android-4-0-ice-cream-sandwich-in-virtualbox/2012/03/02
- http://groups.google.com/group/android-x86/browse_thread/thread/eb88bb948176f6b8
- http://groups.google.com/group/android-x86/browse_thread/thread/ec0aee3a027775d7

Note:
  • By the above method, the Internet can be accessed using browser, but other apps cannot access the Internet (they need "wifi").
  • To access the Internet with other apps: see http://keyable.blogspot.jp/2012/05/how-to-run-android-40-in-virtualbox.html

Thursday, May 03, 2012

Read Vietnamese on Sony Reader PRS-T1

Fully embed fonts:
  1. Add the ePub book into Calibre. Right click on the book, choose Tweak Book. Choose Explode ePub.
  2. The file browser (Windows Explorer) will open at an temporary address like C:\Users\UserName\AppData\Local\Temp\calibre_0.8.44_tmp_2s_358\qsvcc__exploded. There should be files stylesheet.css and content.opf.
  3. In the directory containing the .css file, make a new directory named fonts. Copy 4 Gentium Book Basic fonts to that directory (the fonts can be download at scripts.sil.org/Gentium_basic).
  4. Open the .css file in a text editor and add 4 @font-face statements. (Notice the url at src:.) (There may be other .calibre, .calibre1,... in the file.)
    @font-face {
        font-family: serif;
        font-weight: normal;
        font-style: normal;
        src: url(fonts/GenBkBasR.ttf)
        }
    @font-face {
        font-family: serif;
        font-weight: normal;
        font-style: italic;
        src: url(fonts/GenBkBasI.ttf)
        }
    @font-face {
        font-family: serif;
        font-weight: bold;
        font-style: normal;
        src: url(fonts/GenBkBasB.ttf)
        }
    @font-face {
        font-family: serif;
        font-weight: bold;
        font-style: italic;
        src: url(fonts/GenBkBasBI.ttf)
        }
    
    Anywhere in the .css file where there is
    font-family: "Gentium Book", serif;
    can either be replaced with
    font-family: serif;
    or removed altogether because serif is the default font used by the reader.
  5. Edit the .opf file, manually add the 4 font files to the section. (In theory, this step is to make a compliant epub. In practice, it may make no difference to whether the epub will read correctly on PRS-T1.)
    <manifest>
        ... lots of file paths ...
        <item href="fonts/GenBkBasR.ttf" id="serifr" media-type="application/x-truetype-font"/>
        <item href="fonts/GenBkBasI.ttf" id="serifi" media-type="application/x-truetype-font"/>
        <item href="fonts/GenBkBasB.ttf" id="serifb" media-type="application/x-truetype-font"/>
        <item href="fonts/GenBkBasBI.ttf" id="serifbi" media-type="application/x-truetype-font"/>
    </manifest>
    
    The href attribute needs to be the path of the .ttf file relative to the .opf file inside the epub.
  6. Save and close all the edited files. Run Rebuild ePub in the window from Calibre.
Note:
  1. It is not a good idea to do a Calibre conversion on an epub after it has fonts fully embedded. Sometimes the fonts no longer work afterwards.
  2. The fonts may not work on the reader when fully embedded to an epub which has previously been added @font-face statements during a Calibre conversion using the ExtraCSS box. The conversion process will have placed all the @font-faces in each and every (x)html file inside the epub rather than in the .css file. These may well override the ones just manually added to the .css file. If this is the problem, manually removing the @font-faces from the html files should correct it.
More to read: 3 ways to achieve epubs with customized fonts
  1. Embedding. Font files are copied into the epub, @font-face css is added to the epub's existing css file.
    Often used by publishers for DRM'd retail epubs; but can be done for epubs not locked by DRM.
    Pros
    - epub should work on any reader which uses the Adobe renderer.
    Cons
    - non-DRM epubs only
    - The font files would be contained in every single epub. Some are quite large and add up to a lot of disk space if thousands of books are kept on the reader.
    - Have to manually edit each epub to embed font files, extra @font-face css and make some changes to the epub's .opf file.
  2. Font files are copied to the reader, @font-face css is placed in a specially-named .css file on the reader.
    This requires the firmware on the reader to be slightly modified to recognise the .css filename containing the @font-faces. This is because Adobe has seen fit to hide its default css file deep inside the firmware where users can't get at it.
    Pros
    - Can be used for all epubs whether they have DRM or not.
    - Only need to copy the font files and @font-face css to the reader once.
    - Don't need to do anything special in Calibre, nor to edit each epub.
    Cons
    - Have to 'hack' the reader firmware.
  3. A kind of hybrid. Font files are copied to the reader, @font-face css added to each epub's css file.
    The @font-face css can be added into each epub's css file manually using Calibre's Tweak-epub feature. Or this can also be done by a Calibre conversion to epub, by copying the @font-face css into Calibre's Convert - Look&Feel - ExtraCSS box.
    Pros
    - no hacking required
    - Only need to copy the font files to the reader once.
    - If the @font-face css is added to Calibre Preferences, this process is only needed to be done once. Cons
    - non-DRM epubs only
    - Because the @font-face css is slightly different for each brand of reader, the same epub cannot be used on different readers, e.g. an epub prepared for a Sony will not display correctly on a PocketBook, and vice versa.
Acknowledgments: jackie_w from mobileread.com
  • http://www.mobileread.com/forums/showpost.php?p=1818037&postcount=11
  • http://www.mobileread.com/forums/showpost.php?p=1726853&postcount=190

Monday, April 30, 2012

Using Epson Scanner 7600U (Windows 7)

On Epson's page (http://www.epson.jp/dl_soft/list/1221.htm), no driver for Windows 7. Thanks to http://d.hatena.ne.jp/miya_kaz/20120110/1326180360, it is found that the scanner can be used by the GT-9300's driver.

http://www.epson.jp/dl_soft/list/1502.htm#43

ここでWin7 64bit用のEPSON Scanをダウンロード,実行

使用する機器を聞かれるので,GT-9300を選択,インストール

スキャナをPCに接続する。最初のドライバ探しは失敗する。

デバイスマネージャでプロパティ→ハードウェア→プロパティ→設定の変更クリック。

ドライバータブ→ドライバの更新→コンピュータを参照→デバイスドライバの一覧から選択→イメージングデバイス→EPSON→GT-9300 を選択,インストール

ここまでやったらEPSON Scanを実行。Scanできました。