Outils pour utilisateurs

Outils du site


issue132:ubports

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 tournent sur un dispositif réel. Il est toutefois nécessaire d'utiliser un jeu d'outils qui transforme le code source en application exécutable. Plusieurs outils sont utilisables : le plus traditionnel est le SDK Ubuntu Touch (kit de développement logiciel), tandis que le plus prometteur est Clickable.

Le SDK d'Ubuntu Touch n'est plus maintenu et par conséquent cela peut paraître inutile de passer du temps dans ce cours à expliquer comment il fonctionne. Bien que ce soit exact, il y a des principes que j'aimerais toutefois aborder. Clickable et le SDK suivent le même processus. Le code source de l'application est écrit et compilé, puis 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.

Lors du dernier UbuCon, j'ai animé un atelier de programmation de base. Afin de simplifier le processus d'installation, j'ai préparé une machine virtuelle avec le SDK Ubuntu Touch. Ensuite il suffit de télécharger le fichier, configurer son environnement de virtualisation et commencer à 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 du temps.

Le lien est : https://bit.ly/2JIdjBh. L'ordinateur hôte peut exécuter n'importe quel système d'exploitation qui puisse faire tourner VirtualBox. Voici les étapes pour Ubuntu 16.04.

La première étape consiste à 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

Une fois l'installation terminée, vous pouvez lancer le programme à partir du menu du bureau ou en saisissant la commande

virtualbox

Cliquez sur le bouton Nouveau puis nommez et configurez 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 virtuel existant. Ensuite, sélectionnez le fichier de la machine virtuelle que vous avez téléchargé précédemment.

La machine virtuelle est alors créée et doit maintenant être configurée.

Cliquez sur le bouton Paramètres. Dans Système, Processeur, sélectionnez Activer PAE/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, vous devez les activer 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 SDK utilisent l'accélération OpenGL et cela ne fonctionne pas très bien avec VirtualBox.

La machine virtuelle est maintenant prête.

Démarrez le SDK 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 une application pour le Web (WebApp). 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

issue132/ubports.txt · Dernière modification : 2018/05/07 12:11 de auntiee