Ubuntu SDK installation is a very important step for developers. The reason being installation can take quite some time depending on the network speed. We strongly recommend installing Ubuntu before coming to the event in order to save time during the Hackathon.
Ubuntu Desktop OS
A developer may use the following commands to install the chroots using the following commands:
A developer may list all of the installed chroots using the following commands:
If a developer wants to install extra packages (for example some libs are needed for your application development) for the chroots (although this is normally not needed), a developer can use the following way to do it:
In the above command, it shows how to install
"libaccounts-glib-dev" to the armhf chroot, or use the following command in a terminal:
Then, we can install whatever packages we want to install/remove to the chroot:
Most of the information can be found on our developer website: www.developer.ubuntu.com.
Ubuntu Desktop OS
Annually, Canonical releases two versions in April and October. 15.04 is recommended for desktop OS installation during the Hackthon event though 15.10 is coming in Oct of 2015.
For 14.04 LTS Ubuntu desktop, the scope development cannot be running on the desktop due to API changes, and it can be only tested on the emulator and on a real phone.
For 14.04 LTS Ubuntu desktop, the scope development cannot be running on the desktop due to API changes, and it can be only tested on the emulator and on a real phone.
Install SDK
Developers can visit our developer website link “
Installing the SDK”. Just follow the instructions there to install the SDK.
Install chroots
In this step, we are going to install the chroots which will be used for cross-building the Ubuntu projects.
The chroots are classified into two categories:
When the Ubuntu SDK is launched for the very first time (look for “ ubuntu” in the dash),
The chroots are classified into two categories:
- i386 - for emulator target
- armhf - for phone target (ARM is the chipset for the phone)
When the Ubuntu SDK is launched for the very first time (look for “ ubuntu” in the dash),
it normally prompts the following dialog:
We can choose to install the chroots (i386/armhf) during the installation wizard. As shown above, at any point of time (after the SDK is launched), we can go to menu “
Tools->
Options->
Ubuntu” setting page to install the chroots (i386 and armhf).
The installation for the armhf/i386 chroots may take quite some time to finish depending on the network speed. Each of the chroots may take up to 1.7G disk space in the desktop.
Alternatively, a developer may remove an installed or partially-installed chroots using the following commands (this is normally used when the installation in the above step cannot be removed by selecting the "
Delete" for some reasons):
$ sudo click chroot -a i386 -f ubuntu-sdk-15.04 destroy
$ sudo click chroot -a armhf -f ubuntu-sdk-15.04 destroy
$sudo click chroot -ai386 -f ubuntu-sdk-15.04 create
$sudo click chroot -aarmhf -f ubuntu-sdk-15.04 create
A developer may list all of the installed chroots using the following commands:
~$ schroot -l
chroot:click-ubuntu-sdk-15.04-armhf
chroot:trusty-amd64-armhf
chroot:utopic-amd64-armhf
In the terminal, you can use "
apt-get install <packages>" to install whatever packages you want to install as long as the libs are supported by the phone.
Alternatively, a developer can use the following command to maintain chroots. We launch a terminal in the desktop, then type the following command:
$sudo click chroot -aarmhf -fubuntu-sdk-15.04 maint apt-get install libaccounts-glib-dev:armhf
$sudo click chroot -a armhf -f ubuntu-sdk-15.04 maint
Then, we can install whatever packages we want to install/remove to the chroot:
Install emulator
Emulator is used to test and verify your applications (
HTML 5 and
QML) and
Scopes if you do not have a Ubuntu phone with you. It emulates a real phone although GPS/sensors/telephony etc. are not emulated so far in the emulator.
In order to install an emulator, we need to do as follows:
Once the SDK is launched, we select “
Devices”, then select “
+”, which is located at the bottom-left of the SDK screen. We choose the i386 (which is faster than the armhf emulation). Normally, “
devel” channel is selected though “
devel-proposed” has the most updated features and it could be the latest Ubuntu phone image (depending on the installation time, for now, it should be 15.10) in which case it may not be compatible with our 15.04 chroot. The installation of the emulator may take some while depending on the network speed.
In order to deploy an app/scope to your emulator, you need to turn on the “
developer mode” in the emulator. We can launch the emulator like the following way:
Remember the default password for the emulator is “
0000”.
We can use the following way to turn on the
developer mode:
For phone target, we need to do the
same on the phone in order to let our apps deployed onto the target.
Once we have done all these, basically, the installation is finished. We probably need to follow the article “
creating an sdk app project” to see whether you can create and launch an app/scope into the emulator successfully. This step is to ensure whether your SDK installation is successful or not.
Install Qt help document
We use the following command to install the Qt help document:
sudo apt-get install qt5-doc
In Ubuntu SDK, we can position our cursor on an API or keywords in the editor, then press "
F1", you will be able to see the usage of the API.
Further reading
- https://developer.ubuntu.com/en/scopes/ - scope introduction and tutorials
- https://developer.ubuntu.com/en/apps/qml/ - QML introduction and tutorials
- https://developer.ubuntu.com/en/apps/html-5/ - HTML 5 introduction and tutorials
- http://blog.csdn.net/ubuntutouch - A lot of tutorials in Chinese. Google translate may help
- https://developer.ubuntu.com/en/community/training/ - training materials
IRC support Channel
#ubuntu-hackathon, #ubuntu-app-devel and #ubuntu-touch on freenode
More channels like "
#ubuntu-app-devel" and "
ubuntu-touch" can be used for getting answers. A developer can simply type "/join #ubuntu-hackathon" to join a channel. In addition, you may also subscribe the Ubuntu developer support
mailinglist.