issue119:ubuntu_touch
Différences
Ci-dessous, les différences entre deux révisions de la page.
Prochaine révision | Révision précédente | ||
issue119:ubuntu_touch [2017/04/03 19:00] – créée auntiee | issue119:ubuntu_touch [2017/04/17 11:29] (Version actuelle) – auntiee | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
- | In the previous chapter we have seen an introduction to the programming course with Ubuntu Touch. The next step is to prepare the development environment. When programming in any language, an SDK (Software Development Kit) is often used. The SDK consists of a set of tools that processes the source code and generates the executable for the platform that is being used. Ubuntu Touch is not an exception and also has its own SDK. | + | **In the previous chapter we have seen an introduction to the programming course with Ubuntu Touch. The next step is to prepare the development environment. When programming in any language, an SDK (Software Development Kit) is often used. The SDK consists of a set of tools that processes the source code and generates the executable for the platform that is being used. Ubuntu Touch is not an exception and also has its own SDK. |
- | Applications in GNU / Linux are in repositories. The repository contains a set of applications that can be easily installed. On some occasions, there are applications that are not in the official repositories. For these cases, it is possible to use personal repositories, | + | Applications in GNU / Linux are in repositories. The repository contains a set of applications that can be easily installed. On some occasions, there are applications that are not in the official repositories. For these cases, it is possible to use personal repositories, |
- | There are two other ways to do this: create a Live USB with Ubuntu, or use a virtual machine that has Ubuntu installed. The first one is simpler and works reasonably well if the USB memory is fast. The second way is more comfortable since it does not depend on a USB stick, but requires a more powerful computer to run the virtualized operating system. I will not go into how to create a Live USB or virtual machine. Anyone in one of these two cases can ask in the mailing list and I will guide him/her with the most important steps. | + | Dans le précédent chapitre, nous avons vu une présentation du cours de programmation pour Ubuntu Touch. L' |
+ | |||
+ | Dans GNU/Linux, les applications sont dans des dépôts. Le dépôt contient un ensemble d' | ||
+ | |||
+ | **There are two other ways to do this: create a Live USB with Ubuntu, or use a virtual machine that has Ubuntu installed. The first one is simpler and works reasonably well if the USB memory is fast. The second way is more comfortable since it does not depend on a USB stick, but requires a more powerful computer to run the virtualized operating system. I will not go into how to create a Live USB or virtual machine. Anyone in one of these two cases can ask in the mailing list and I will guide him/her with the most important steps. | ||
My development environment is: | My development environment is: | ||
Ligne 11: | Ligne 15: | ||
• Aquaris M10 FHD with OTA-14. | • Aquaris M10 FHD with OTA-14. | ||
- | It is possible that in other distributions there are some intermediate steps that need to be done to configure the SDK. If that is the case you can indicate it. | + | It is possible that in other distributions there are some intermediate steps that need to be done to configure the SDK. If that is the case you can indicate it.** |
+ | |||
+ | Il y a deux autres façons de le faire : créer un Live USB avec Ubuntu ou utiliser une machine virtuelle sur laquelle Ubuntu est installé. La première est plus simple et fonctionne relativement bien si la mémoire de la clé USB est rapide. La seconde est plus confortable, | ||
+ | |||
+ | Mon environnement de développement est ainsi : | ||
+ | • Ubuntu 16.04 LTS. | ||
+ | • Aquaris E4.5 avec OTA-14. | ||
+ | • Aquaris E5 HD avec OTA-14. | ||
+ | • Aquaris M10 FHD avec OTA-14. | ||
+ | |||
+ | Il est possible que, dans d' | ||
- | Installing the Ubuntu Touch SDK | + | **Installing the Ubuntu Touch SDK |
Installing the SDK is very simple and should not take more than a couple of minutes. It is advisable to have the system updated before you start. In the case of Ubuntu, this can be done with the commands: | Installing the SDK is very simple and should not take more than a couple of minutes. It is advisable to have the system updated before you start. In the case of Ubuntu, this can be done with the commands: | ||
Ligne 19: | Ligne 33: | ||
sudo apt-get update && sudo apt-get upgrade && sudo apt-get dist-upgrade | sudo apt-get update && sudo apt-get upgrade && sudo apt-get dist-upgrade | ||
- | You use sudo because package installation requires administrator permissions. The first command updates the list of repositories. If there is no error, the second command is executed, which is responsible for updating the applications. Finally, the third command updates some operating system packages that are not updated by default. | + | You use sudo because package installation requires administrator permissions. The first command updates the list of repositories. If there is no error, the second command is executed, which is responsible for updating the applications. Finally, the third command updates some operating system packages that are not updated by default.** |
- | Add the Ubuntu Touch SDK repository with the command: | + | Installer le SDK d' |
+ | |||
+ | L' | ||
+ | |||
+ | sudo apt-get update && sudo apt-get upgrade && sudo apt-get dist-upgrade | ||
+ | |||
+ | Vous utilisez sudo parce que l' | ||
+ | |||
+ | **Add the Ubuntu Touch SDK repository with the command: | ||
sudo add-apt-repository ppa: | sudo add-apt-repository ppa: | ||
Ligne 37: | Ligne 59: | ||
sudo apt-get install ubuntu-sdk | sudo apt-get install ubuntu-sdk | ||
- | Although only one package (ubuntu-sdk) is put in the command, all the dependencies of that package are automatically installed, so it works without problems. The installation may take a while depending on the Internet connection. It's a good time to let the computer work and have a good coffee. | + | Although only one package (ubuntu-sdk) is put in the command, all the dependencies of that package are automatically installed, so it works without problems. The installation may take a while depending on the Internet connection. It's a good time to let the computer work and have a good coffee.** |
- | Setting up the Environment | + | Ajoutez le dépôt du SDK d' |
+ | |||
+ | sudo add-apt-repository ppa: | ||
+ | |||
+ | L' | ||
+ | |||
+ | Tous les dépôts ont une signature qui nous assure que les paquets installés viennent de ce dépôt. La signature est ajoutée au système et sera utilisée quand les paquets du dépôt seront installés. | ||
+ | |||
+ | Après avoir ajouté un dépôt, il est nécessaire de mettre à jour l' | ||
+ | |||
+ | sudo apt-get update | ||
+ | |||
+ | Tout est prêt. La dernière étape de cette section est l' | ||
+ | |||
+ | sudo apt-get install ubuntu-sdk | ||
+ | |||
+ | Bien qu'un seul paquet ait été mis dans la commande, toutes les dépendances de ce paquet sont automatiquement installées, | ||
+ | |||
+ | **Setting up the Environment | ||
The Ubuntu Touch SDK includes tools to generate applications, | The Ubuntu Touch SDK includes tools to generate applications, | ||
Ligne 49: | Ligne 89: | ||
After writing the command, you have to close the user's session and log in again. You can start working with this small modification. To start, we need to run the ubuntu-sdk-ide application; | After writing the command, you have to close the user's session and log in again. You can start working with this small modification. To start, we need to run the ubuntu-sdk-ide application; | ||
- | If the user is not in the lxd group, the following screen error will appar. In that case, it is sufficient to log out and log in again. When launching, the IDE of Ubuntu Touch should give you no errors. | + | If the user is not in the lxd group, the following screen error will appar. In that case, it is sufficient to log out and log in again. When launching, the IDE of Ubuntu Touch should give you no errors.** |
- | Configuration Wizard | + | Paramétrer l' |
+ | |||
+ | Le SDK d' | ||
+ | |||
+ | Pour travailler avec LXD, vous devez ajouter l' | ||
+ | |||
+ | sudo usermod -a -G lxd user | ||
+ | |||
+ | Après avoir exécuté la commande, vous devez fermer la session et vous reconnecter. Avec cette petite modification, | ||
+ | |||
+ | Si l' | ||
+ | |||
+ | **Configuration Wizard | ||
The first screen (shown below) of the wizard is an introduction to Qt Creator. To continue, click the ‘Next’ button. | The first screen (shown below) of the wizard is an introduction to Qt Creator. To continue, click the ‘Next’ button. | ||
Ligne 63: | Ligne 115: | ||
Finally (bottom left), write the name of the kit. | Finally (bottom left), write the name of the kit. | ||
- | When you complete the last step, you return to the initial screen of the kits. Press the ‘Create new Kit’ button again and repeat the process by selecting Ubuntu Device. | + | When you complete the last step, you return to the initial screen of the kits. Press the ‘Create new Kit’ button again and repeat the process by selecting Ubuntu Device.** |
- | With this kit, there are more options to choose from. Phones or tablets that use Ubuntu Touch work with the armhf architecture. In the list, you have to select a kit that has that architecture. The version of Ubuntu Touch is Vivid, as in the previous case. Finally, you have to choose 686 or x64 depending on whether the computer uses 32 or 64 bits. | + | Assistant de configuration |
+ | |||
+ | Le premier écran de l' | ||
+ | |||
+ | Bien que les cours soient centrés sur les dispositifs mobiles, tels que téléphones ou tablettes, vous pouvez aussi appliquer le savoir appris pour créer des applications de PC de bureau. Chacun de ces dispositifs est associé à un kit, un ensemble d' | ||
+ | |||
+ | Cliquez sur le bouton « Créer un nouveau kit » (montré ci-dessus). La première option doit être sélectionnée. | ||
+ | |||
+ | Dans la liste (ci-dessous), | ||
+ | |||
+ | Enfin, (en bas à gauche), écrivez le nom du kit. | ||
+ | |||
+ | Quand vous avez terminé la dernière étape, vous retournez à l' | ||
+ | |||
+ | **With this kit, there are more options to choose from. Phones or tablets that use Ubuntu Touch work with the armhf architecture. In the list, you have to select a kit that has that architecture. The version of Ubuntu Touch is Vivid, as in the previous case. Finally, you have to choose 686 or x64 depending on whether the computer uses 32 or 64 bits. | ||
After pressing the ‘Next’ button, you must write the Kit name. | After pressing the ‘Next’ button, you must write the Kit name. | ||
Ligne 71: | Ligne 137: | ||
At this time it is not necessary to create additional kits (below). | At this time it is not necessary to create additional kits (below). | ||
- | In the last step of the wizard (bottom), you can configure the physical devices and the emulator. There are some problems with the emulator. For now, I recommend not to configure the emulator. Applications can be tested natively on the computer. For this reason, you must uncheck the ‘Create emulator’ box, and click on the ‘Finish’ button. | + | In the last step of the wizard (bottom), you can configure the physical devices and the emulator. There are some problems with the emulator. For now, I recommend not to configure the emulator. Applications can be tested natively on the computer. For this reason, you must uncheck the ‘Create emulator’ box, and click on the ‘Finish’ button.** |
+ | |||
+ | Avec ce kit, il y a plus d' | ||
+ | |||
+ | Après avoir appuyé sur le bouton « Suivant », vous devez écrire le nom du kit. | ||
+ | |||
+ | Pour l' | ||
+ | |||
+ | À la dernière étape de l' | ||
+ | |||
+ | **Hello World | ||
+ | |||
+ | In order to keep the good traditions, the first step is to program a minimal application that allows us to check the correct operation of the SDK. The application will run on the computer natively and on a tablet. As you will see, it is quite simple to do it. Kits are updated frequently. If the screen above appears, all the kits must be marked and updated.** | ||
Hello World | Hello World | ||
- | In order to keep the good traditions, | + | Pour garder les bonnes |
- | Project Creation | + | **Project Creation |
Click on the File menu, New file or project. A window (below) will appear with the types of projects that can be used. The user interface is made with QML which is a scripting language oriented to the creation of graphical interfaces. The logic of the application can be done with several languages. JavaScript will be used for now. Select the first option and then click on the ‘Choose’ button. | Click on the File menu, New file or project. A window (below) will appear with the types of projects that can be used. The user interface is made with QML which is a scripting language oriented to the creation of graphical interfaces. The logic of the application can be done with several languages. JavaScript will be used for now. Select the first option and then click on the ‘Choose’ button. | ||
Ligne 93: | Ligne 171: | ||
Running the Application on Your Computer | Running the Application on Your Computer | ||
- | To run the application you have to press the ‘Play’ button in the lower left part of Qt Creator. | + | To run the application you have to press the ‘Play’ button in the lower left part of Qt Creator.** |
- | Running the Application on a Real Device | + | Création d'un projet |
+ | |||
+ | Cliquez sur le menu Fichiers > Nouveau fichier ou projet. Une fenêtre (voir ci-dessous) apparaîtra avec les types de projets qui peuvent être utilisés. L' | ||
+ | |||
+ | Vous devez choisir le dossier dans lequel les projets seront sauvegardés. Le nom du projet ne peut pas contenir d' | ||
+ | |||
+ | Les applications ont besoin d' | ||
+ | |||
+ | Vous devez sélectionner les kits que vous voulez utiliser. Par défaut, les deux seront sélectionnés de façon à faire tourner l' | ||
+ | |||
+ | Le dernier écran contient un résumé des étapes de l' | ||
+ | |||
+ | Le projet (montré ci-dessous) s' | ||
+ | |||
+ | Faire tourner l' | ||
+ | |||
+ | Pour faire tourner l' | ||
+ | |||
+ | **Running the Application on a Real Device | ||
Before running the application, | Before running the application, | ||
Ligne 105: | Ligne 201: | ||
After a few seconds, a notification must appear with the connection request of the computer. | After a few seconds, a notification must appear with the connection request of the computer. | ||
- | You have now completed all the steps on the side of the tablet. In the IDE, you must select the tablet as the compilation target. To do this, click on the button above the Play, and select the device we just configured as the destination. | + | You have now completed all the steps on the side of the tablet. In the IDE, you must select the tablet as the compilation target. To do this, click on the button above the Play, and select the device we just configured as the destination.** |
- | A few seconds after pressing the Play button, the application will appear on the device. | + | Faire tourner l' |
+ | |||
+ | Avant de lancer l' | ||
+ | |||
+ | Cliquez sur À propos. | ||
+ | |||
+ | Sélectionnez le mode Développeur. Ce mode est désactivé par défaut, car il permet un contrôle à distance du dispositif s'il est connecté par USB à l' | ||
+ | |||
+ | Après quelques secondes, une notification devrait apparaître avec la demande de connexion de l' | ||
+ | |||
+ | Vous avez maintenant terminé toutes les étapes du côté de la tablette. Dans l'IDE, vous devez sélectionner la tablette comme cible de la compilation. Pour ce faire, cliquez sur le bouton au-dessus de Démarrer et sélectionnez comme destination le dispositif que vous venez de configurer. | ||
+ | |||
+ | **A few seconds after pressing the Play button, the application will appear on the device. | ||
The error shown in the above image may appear. | The error shown in the above image may appear. | ||
Ligne 115: | Ligne 223: | ||
Now you have to associate the Kit back to the Project. Click on ‘Projects’ (on the sidebar), ‘Add Kit,’ and select the Kit that appears in the dropdown. | Now you have to associate the Kit back to the Project. Click on ‘Projects’ (on the sidebar), ‘Add Kit,’ and select the Kit that appears in the dropdown. | ||
- | Wait a couple of seconds and select the device as the compilation target. It is important that you try the compilation in both cases. In the next chapter, I will start with the source code and assume that everything works correctly on both the computer and the test device. If you have any problems you can ask on the mailing list. | + | Wait a couple of seconds and select the device as the compilation target. It is important that you try the compilation in both cases. In the next chapter, I will start with the source code and assume that everything works correctly on both the computer and the test device. If you have any problems you can ask on the mailing list.** |
- | Resources | + | Quelques secondes après avoir appuyé sur le bouton Démarrer, l' |
+ | |||
+ | L' | ||
+ | |||
+ | Dans la barre latérale de Qt Creator, vous devez cliquer sur le boutons « Dispositifs ». Puis, cliquez sur l' | ||
+ | |||
+ | Maintenant, vous devez associer à nouveau le Kit au Projet. Cliquez sur « Projets » (dans la barre latérale), « Ajouter un kit » et sélectionnez le Kit qui apparaît dans la liste déroulante. | ||
+ | |||
+ | Attendez une poignée de secondes et sélectionnez le dispositif comme cible de la compilation. Il est important que vous essayiez la compilation dans les deux cas. Dans le prochain chapitre, je commencerai par le code source en supposant que tout fonctionne correctement, | ||
+ | |||
+ | |||
+ | **Resources | ||
Mailing List: https:// | Mailing List: https:// | ||
Ligne 123: | Ligne 242: | ||
Larrea Mikel: revision of the chapter in Spanish. | Larrea Mikel: revision of the chapter in Spanish. | ||
Cesar Herrera: revision of the English translation. | Cesar Herrera: revision of the English translation. | ||
- | Joan CiberSheep: revision of the English translation. | + | Joan CiberSheep: revision of the English translation.** |
+ | |||
+ | Ressources | ||
+ | Mailing list : https:// | ||
+ | |||
+ | Personnes qui ont collaboré : | ||
+ | Larrea Mikel : révision du chapitre en espagnol. | ||
+ | Cesar Herrera : révision de la traduction en anglais. | ||
+ | Joan CiberSheep : révision de la traduction en anglais. | ||
issue119/ubuntu_touch.1491238807.txt.gz · Dernière modification : 2017/04/03 19:00 de auntiee