Apache Cordova development environment install on Ubuntu

Apache Cordova has very nice documentation, however as so many projects it is focused on the Windows/MacOS duopolies only. Fortunately it's not too hard to work out the differences. Installing dependencies Thanks to: https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager sudo apt-get install python-software-properties python g++ make ant openjdk-7-jre openjdk-7-jdk Installing Android SDK Please note: one of the problems I found was that I had some Android tools from the Ubuntu repos that were conflicting with the SDK install. It's probably a good idea to remove them first. That might save you from a lot of headaches down the line (and time to troubleshoot). sudo apt-get remove android-tools-adb android-tools-fastboot Download as per http://developer.android.com/sdk/index.html wget http://dl.google.com/android/android-sdk_r22.6.2-linux.tgz Note: check for updated link version obviously vim ~/.bashrc Add the PATH variables to the top of the file #AndroidDev PATH export PATH=${PATH}:~/android-sdk-linux/tools export PATH=${PATH}:~/android-sdk-linux/platform-tools Reload bash variables without reboot / logout source ~/.bashrc Testing SDK android This command should now bring up the SDK manager. Installing Eclipse IDE This is obviously an optional step depending on the IDE you want to use. I have previously covered a manual Eclipse install (as opposed to the Ubuntu repositories). Install Eclipse ADT Plugin As per: http://developer.android.com/sdk/installing/installing-adt.html Node.js Install The main difficulty on Ubuntu (as with so many development tools - see Eclipse above) is that the included node.js version in the Ubuntu repositories is outdated (remove the Ubuntu version with 'sudo apt-get remove node'). sudo add-apt-repository ppa:chris-lea/node.js sudo apt-get update sudo apt-get install python-software-properties python g++ make nodejs Install Cordova sudo npm install…

Continue Reading

Ubuntu Touch install on Nexus 4

This is the last of a series of alternative mobile OS installs and the easiest install by a country mile ! Install Everything is quite well documented here: https://wiki.ubuntu.com/Touch/Install. sudo add-apt-repository ppa:phablet-team/tools sudo apt-get update sudo apt-get install phablet-tools android-tools-adb android-tools-fastboot phablet-flash ubuntu-system --channel devel --bootstrap That is it really ! This is how a OS change on a mobile should work ! Issues Ubuntu touch can not yet handle the radio firmware past Android 4.3 devices. So if your N4 was upgraded to Android 4.4 (KitKat) you need to flash the radio to the Android 4.3 (up to Version 2.0.1700.84) else WIFI will not work. Download 4.3 Stock Image from: https://developers.google.com/android/nexus/images#occamjwr66y fastboot flash radio fastboot flash radio radio-mako-m9615a-cefwmazm-2.0.1700.84.img fastboot reboot Wifi setup (Optional - this can be done via phone UI as well). Connect the phone via USB adb shell nmcli -pretty dev wifi connect NETWORK-NAME password PASSWORD

Continue Reading

Install FirefoxOS on Nexus S (GT-9023)

I just had one of my old hand-me-down phones returned by my offspring in a great condition (junior is very careful with his equipment - well done young man !). This doesn't happen all too often shows that the Nexus S is a decently built phone. This is also a good example of breaking the built-in obsolescence of modern phones. This particular unit has served me well for nearly 2 years (my average is one year) and served 2 kids after that. These instructions have been compiled on Ubuntu 13.10 64bit to allow me to re-do this process in future. It should work on any Linux based distro (see pre-requisites) - if you are using another Operating System it might be time to switch. Hopefully it might be useful for other people as well. Installing pre-requisites As per https://developer.mozilla.org/en-US/docs/Developer_Guide/Build_Instructions/Linux_Prerequisites wget https://hg.mozilla.org/mozilla-central/raw-file/default/python/mozboot/bin/bootstrap.py python bootstrap.py Ubuntu 13.10 additions As per https://developer.mozilla.org/en-US/Firefox_OS/Firefox_OS_build_prerequisites#Ubuntu_13.10. sudo apt-get install --no-install-recommends autoconf2.13 bison bzip2 ccache curl flex gawk gcc g++ g++-multilib gcc-4.6 g++-4.6 g++-4.6-multilib git lib32ncurses5-dev lib32z1-dev zlib1g:amd64 zlib1g-dev:amd64 zlib1g:i386 zlib1g-dev:i386 libgl1-mesa-dev libx11-dev make zip libxml2-utils sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.6 1 sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 2 sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.6 1 sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 2 sudo update-alternatives --set gcc "/usr/bin/gcc-4.6" sudo update-alternatives --set g++ "/usr/bin/g++-4.6" Check out & build Firefox OS git clone git://github.com/mozilla-b2g/B2G.git cd B2G echo "export HIDPI=1" > .userconfig ./config.sh nexus-s ./build.sh -j3 The config script will take quite some time depending on your internet connection as…

Continue Reading

SMS Gateway using Sierra Wireless USB Modem on Debian Wheezy

I have been planning to set up a SMS Gateway for sending and receiving SMS messages via a headless utility unit (Raspberry Pi) for a while. Since I had a leftover Sierra Wireless AirCard 880U from Telstra in Australia I wanted to re-purpose this unit with a spare SIM card. Unfortunately it was very hard to find any good setup manual for this particular combination and took some time to fiddle & debug. This is the working setup for future reference and hopefully it helps somebody. Install dependencies Note: install usb-modeswitch BEFORE connecting USB Modem sudo apt-get install usb-modeswitch gsm-utils smstools gammu Connect the USB Modem Check if modem is recognised lsub Bus 003 Device 002: ID 1199:6855 Sierra Wireless, Inc. Edit smstools config file vim /etc/smsd.conf Change the GSM1 entry [GSM1] init = ATE0;+CPMS="SM","SM" device = /dev/ttyUSB2 incoming = yes mode = new baudrate = 115200 smsc = 61418706700 pin = ignore #rtscts = yes #cs_convert = yes report = yes sending_disabled = no memory_start = 1 pre_init = yes primary_memory = SM secondary_memory = SM secondary_memory_max = 40 Troubleshooting the modem I installed gammu purely to have an easier way to test if the modem actually worked. You can use gammu-config to do a GUI config or create a config file manually vim /etc/gammurc [gammu] port = /dev/ttyUSB2 connection = at115200 Testing gammu-detect ; Configuration file generated by gammu-detect. ; Please check The Gammu Manual for more information. [gammu] device = /dev/ttyUSB0 name = Phone on USB serial…

Continue Reading

Connection Android 4.x MTP mass storage to Ubuntu 12.x

The ability to connect Android 4.+ devices to Ubuntu using the USB Mass Storage interface has always been a pain. With Ubuntu 13.04 a new MTP back-end (gvfs-mtp) is going to be introduced, but I have had some issues with the 13.04 Beta so I found this backport PPA to Ubuntu 12.04 and 12.10 sudo add-apt-repository ppa:langdalepl/gvfs-mtp sudo apt-get update sudo apt-get install gvfs sudo apt-get upgrade Kudos to Phillip Langdale for the work and maintaining the PPA !

Continue Reading

Running Android 4.0 (ICS) on Virtualbox

Debugging things on the Android Emulator (incluced in the SDK) can be a very slow and cumbersome process. Thanks to the Android-x86 Project it's quite easy to run Android in VirtualBox. This is highly useful when you need to test mobile apps and websites from the Android Browser (as well as Chrome Mobile). Download an Ethernet enabled ISO from Tablets x86 wget http://dl.dropbox.com/u/75945873/android-x86-4.0-eth0-generic_x86-20120426.iso.torrent transmission android-x86-4.0-eth0-generic_x86-20120426.iso.torrent Create new ViratualBox VM Important Settings (see screenshots) OS: Linux, Version: Linux 2.6 Enable VTx/AMD-V Use Bridged Network Adapter (if you want to allow direct Internet Access) Mount the ISO file downloaded previosly and start the VM Create the Root Filesystem (ext3) on the VBox .vdi created with the new VM, mark as bootable Write the Filesystem changes to disk (VDI) and format the disk Install GRUB Boatloader Copy files from ISO to VDI Unmount the ISO image and reboot Note: You need to disable the mouse pointer integration (if you have installed VirtualBox Client Add-ons) in the menu of Virtualbox ('Machine' --> 'Disable Mouse Integration') when you start the VM (see screenshot). I have not found a way to disable this by default on Virtualbox on Ubuntu (If anybody has managed this I would love to know how !) Start the Android Setup Wizard to set locale and you should be up and running (network should already function to test external sites from Android browser) !

Continue Reading

Intel Ultrabook tweaks on Ubuntu 12.04

After upgrading my Toshiba Z830 Ultrabook to 12.04 (Precise Pangolin) I noticed that the ability to control the screen back-light was not working using the Toshiba Fn F6/F7 keys. Thanks to http://www.linlap.com/wiki/acer+aspire+s3 the solution was found quite quickly. sudo vim /etc/default/grub This will open the grub configuration file. (Grub is the initial boot selection software) To be able to dim the screen brightness, You've got to modify the line: GRUB_CMDLINE_LINUX="" to these two lines: pcie_aspm=force GRUB_CMDLINE_LINUX="quiet splash pcie_aspm=force i915.i915_enable_rc6=1 i915.lvds_downclock=1 acpi_osi=Linux acpi_backlight=vendor elevator=noop" Another neat tip: intel-gpu-tools can be used to control brightness from the commandline. # will set brightness at 50% intel_backlight 50 EDIT [2012-08-24]: to avoid issues on resume you need to add a script to the sudo vim /etc/pm/sleep.d/20_wakeup Add the following: #!/bin/bash case "$1" in suspend|hibernate) #do nothing ;; resume|thaw) echo 7 > /sys/class/backlight/toshiba/brightness ;; *) exit 1 ;; esac exit 0 Mark the file as executable sudo chmod +x /etc/pm/sleep.d/20_wakeup

Continue Reading

Android 4.0 screenshot functionality on Galaxy Nexus

One of the features I missed since the good old Android 1.5 days was the ability to take screen-shots on the device. Prior to Android 4 (ICS) the only workable way to create screen-shots was to connect via USB cable and use the Android SDK to make remote screen-shots. On Android 4.0 all you have to do is press Volume Down Key + Power Key down at the same time and hold.  You should hear the camera click (if audio is on) and Android will show a notification that the screenshot was saved on your device and you can now upload or transfer to your favourite service.

Continue Reading

Mobile Browser Testing on the Desktop

If you need to check websites for mobile compliance on a regular basis you know that having a device to constantly check is painful and slows down your work during debugging and phases of constant change.   by  adactio  There are a few tools that will make this work a lot easier: Google Chrome Chrome does have some nice dedicated plug-ins to help with this task Ripple Mobile Environment Emulator (https://chrome.google.com/webstore/detail/geelfhphabnejjhdalkjhgipohgpdnoc) appMobi HTML5 XDK (https://chrome.google.com/webstore/detail/onmkoldigcfmebcinpmineoadckalllb) Firefox I am not aware of any plug-ins like Chrome, but as a hack I have found it useful to employ a user-agent switching plugin to trick the browser User Agent Switcher (http://chrispederick.com/work/user-agent-switcher/) works well for this. Download the User Agent Switcher Add-on for Firefox Restart Firefox for the add-on change to take place. To start a new browsing session using an emulated browser, go to Tools > User Agent Switcher and select the appropriate mobile web browser you want to emulate To switch back to normal browsing, just select the default option from the above menu. If you need more specific UA Strings check here: http://www.zytrax.com/tech/web/mobile_ids.html For more serious work there are obviously dedicated emulators from the major Mobile OS vendors (but they need to be installed and configured for each platform): Android (http://developer.android.com/guide/developing/tools/emulator.html) iOS (http://developer.apple.com/devcenter/ios/) WinPhone (http://www.microsoft.com/download/en/details.aspx?id=13890) Nokia (http://www.developer.nokia.com/Develop/Web/) Opera (http://www.opera.com/developer/tools/mini/) WebOS (http://developer.palm.com/)   PS: Nothing substitutes final QA testing on actual devices ...  

Continue Reading