Ceci est une ancienne révision du document !
Applications in Ubuntu Touch (UBports) are programmed on the computer and run in a real device. To do this, it is necessary to use a set of tools that transform the source code into the application executable. There are several tools you can use: the most traditional is the Ubuntu Touch SDK, while the most promising is Clickable. The Ubuntu Touch SDK is no longer supported. It may seem like a bad idea to spend time in the course explaining how it works. While it is true, there are some premises I would like to comment on. Both the SDK and Clickable follow the same workflow. The application source code is written, compiled, and an application executable is generated. To be able to run the ARM application on a PC, you need to use a container that “adapts” both architectures. At the last UbuCon, I gave a basic programming workshop. In order to simplify the installation process, I prepared a virtual machine with the Ubuntu Touch SDK. Just download the file, set up your virtualization environment, and start programming.
Les applications dans Ubuntu Touch (UBports) sont programmées sur l'ordinateur et tourne sur un vrai dispositif. Pour le faire, il est nécessaire d'utiliser un jeu d'outils qui transforme le code source en application exécutable. Il y a plusieurs outils que vous pouvez utiliser : le plus traditionnel est l'Ubuntu Touch SDK (kit de développement logiciel), alors que le plus prometteur est Clickable.
Le SDK d'Ubuntu Touch n'est plus maintenu. Ça peut paraître une mauvaise idée de passer du temps dans ce cours à expliquer comment il marche. Bien que ça soit crai, je voudrais en parler. Clickable et le SDK suivent le même processus. Le code source de l'application est écrit, compilé et une application exécutable est générée. Pour être capable de lancer une application pour ARM sur un PC, vous avez besoin d'utiliser un conteneur qui « adapte » les deux architectures.
Au dernier UbuCon, j'ai animé un atelier de programmation de base. De façon à simplifier le processus d'installation, j'ai préparé une machine virtuelle avec le SDK d'Ubuntu Touch. Téléchargez simplement le fichier, paramétrez votre environnement de virtualisation et commencez à programmer.
Installing the virtual machine The virtual machine uses Ubuntu Mate 16.04. The user and the password are the same: “ubucon”. I recommend you to download the virtual machine in parallel. It’s 12 GB and can take a long time to download. The link is: https://bit.ly/2JIdjBh. The host computer can run any operating system that can run VirtualBox. Here are the steps for Ubuntu 16.04. The first step is to add the VirtualBox repository. sudo nano /etc/apt/sources.list Add to the end of the file:
Installation de la machine virtuelle
La machine virtuelle utilise Ubuntu Mate 16.04. L'utilisateur et le mot de passe sont les mêmes : « ubucon ». Je vous recommande de télécharger la machine virtuelle en parallèle. Elle fait 12 Go et le téléchargement peut prendre longtemps.
Le lien est : https://bit.ly/2JIdjBh. L'ordinateur hôte peut faire tourner n'importe quel système d'exploitation dans lequel VirtualBox peut tourner. Voici les étapes pour Ubuntu 16.04.
La première étape est d'ajouter le dépôt de VirtualBox.
sudo nano /etc/apt/sources.list
Ajoutez à la fin du fichier :
deb http://download.virtualbox.org/virtualbox/debian xenial contrib Save the changes and add the Oracle signature: wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add - Install VirtualBox. sudo apt-get update; sudo apt-get install virtualbox-5.2 dkms build-essential When finished you can launch it from the desktop menu or by typing the command virtualbox Click on the New button and configure the name and operating system. I recommend you to use the maximum RAM you have available in the system.
deb http://download.virtualbox.org/virtualbox/debian xenial contrib
Sauvegardez les modifications et ajoutez la signature d'Oracle :
wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add -
Installez VirtualBox.
sudo apt-get update; sudo apt-get install virtualbox-5.2 dkms build-essential
Quand c'est fini, vous pouvez la lancer à partir du menu du bureau ou en tapant la commande
virtualbox
Cliquez sur le bouton Nouveau et configurez le nom et le système d'exploitation.
Je vous recommande d'utiliser le maximum de RAM disponible sur votre système.
You must select Use an existing virtual hard disk file. Then select the virtual machine file you downloaded earlier. The virtual machine is already created and now needs to be configured. Click on the Settings button. In System, Processor, select Enable PAE/NX to improve the performance of the virtual machine. Your computer's virtualization options may be turned off. In that case they should be activated in the BIOS configuration. In Display, you can configure the graphics memory of the virtual machine. Even if your computer supports it, I recommend disabling 3D acceleration. The SDK tools use OpenGL acceleration, and it does not work well within VirtualBox. The virtual machine is now ready. Start the Ubuntu Touch SDK by double-clicking on the icon.
Vous devez sélectionner Utiliser un fichier de disque dur existant. Ensuite, sélectionnez le fichier de machine virtuelle que vous avez télécharger précédemment.
La machine virtuelle est déjà créée et a besoin maintenant d'être configurée.
Cliquez sur le bouton Paramètres. Dans Système, Processeur, sélectionnez Activer PNAE/NX pour améliorer la performance de la machine virtuelle. Les options de virtualisation de l'ordinateur peuvent être désactivées. Dans ce cas, elles devraient être activées dans la configuration du BIOS.
Dans Affichage, vous pouvez configurer la mémoire graphique de la machine virtuelle. Même si votre ordinateur le supporte, je vous recommande de désactiver l'accélération 3D. Les outils du SDK utilise l'accélération OpenGL et elle ne marche pas bien dans VirtualBox.
La machine virtuelle est maintenant prête.
Démarrez le SDK d'Ubuntu Touch en double-cliquant sur l'icône.
Conclusions We have already prepared the working environment for the course. In the next delivery, we will start with a Web application (WebApp). Although programmed into a virtual machine, it is possible to connect a phone or tablet (with UBports) and run the application natively. If you have any questions, you can ask them in the Telegram group of the course: https://t.me/ubuntu_touch_course
Conclusions
Nous avons déjà préparé l'environnement de travail du cours. Dans la prochaine séance, nous démarrerons avec un application pour le Web (WabApp). Bien que programmée dans une machine virtuelle, il est possible de connecter un téléphone ou une tablette (avec UBports) et de faire tourner l'application nativement.
Si vous avez des questions, vous pouvez les poser dans le groupe Telegram du cours : https://t.me/ubuntu_touch_course