Wiki

Reso-nance numérique | Arts et cultures libres

Outils du site


Panneau latéral

logiciels:cordova:accueil

Ceci est une ancienne révision du document !


Table des matières

Apache Cordova

<blockquote>Apache Cordova ou plus anciennement Apache Callback ou PhoneGap, est un framework open-source développé par la Fondation Apache. Il permet de créer des applications mobiles pour différentes plates-formes (Android, iOS, Windows 8…) en HTML, CSS et JavaScript. Les applications qui en résultent sont hybrides, ce qui signifie qu'elles ne sont ni vraiment natives, ni purement basées sur les langages HTML, CSS et JavaScript.</blockquote>

Ressources utiles :

Ubuntu

Version de test : Ubuntu 14.04 LTS.

Installation

  1. Télécharger le Android SDK sur developer.android.com
  2. Décompresser et placer le dans votre dossier personnel par exemple : ~/Android
  3. Ajouter le chemin vers les SDK dans le fichier :
    1. nano ~/.bashrc
    2. Placer au début du fichier PATH=$PATH ~/Android/Sdk/platform-tools: ~/Android/Sdk/tools. Ctl-O (écrire), Ctl-q (quitter).
    3. Puis redémarrer pour être sûr (ou faire source ~/.bashrc
  4. Télécharger les mises à jour ou ajouts : android update sdk –no-ui
  5. Installer Nodejs
  6. Installer Apache Cordova : npm install -g cordova (ou avec sudo ?)
  7. Installer Ant : sudo apt-get -u install ant (obligatoire ?)

Configurer son téléphone

android list targets

https://github.com/snowdream/51-android nstall

1.Open the console to copy the file “51-android.rules” to “/etc/udev/rules.d/51-android.rules” by executing the command below. To Achieve it,you should be sure that you have the root permission.

sudo curl –create-dirs -L -o /etc/udev/rules.d/51-android.rules -O -L https://raw.githubusercontent.com/snowdream/51-android/master/51-android.rules

2.To give it appropriate permissions next execute the command:

sudo chmod a+r /etc/udev/rules.d/51-android.rules

3.Then execute:

sudo service udev restart

sudo reboot

4.When plugged in over USB, can verify that your device is connected by executing adb devices from your SDK platform-tools/ directory. If connected, you'll see the device name listed as a “device.”

cd /media/data/Softs/Android/Sdk/platform-tools/ adb devices

List of devices attached 7LCAKJZDIBIJ4DHI device

http://intown.biz/2014/03/07/android-cordova-emulators/

On Your Phone

It is easy to run the app on your own Android phone. I’m listing this option first because it is reasonably quick, and quicker than the SDK emulator. First go to Settings, turn on Developer Options and make sure USB Debugging is checked. You can then connect to your development machine with a USB and execute:

Créer un projet

  1. Créer un dossier pour votre projet : cd ~/Projects; mkdir helloWorld, cd helloWorld
  2. Créer une application Cordova : ordova create workshop com.yourname.workshop Workshop
  3. cd workshop
  4. Ajouter la plateforme Android : cordova platform add android

Create an Andorid emulator

      android create avd -n hello -t 1
      Run the cordova app on the emulator
      cordova emulate android
  Build your web app and place it in the www folder, making sure to include config.xml and cordova.js 

android sdk tools/android update sdk –no-ui path avec .bashrc tools/android

create avd -n hello -t 1 –abi android-wear/armeabi-v7a cordova emulate android

cordova run android

GEOLOCALISATION cordova plugin add org.apache.cordova.geolocation https://github.com/apache/cordova-plugin-geolocation/blob/master/doc/index.md

http://stackoverflow.com/questions/19778828/phonegap-enable-gps-location-at-app-runtime

http://tol8.blogspot.fr/2014/03/how-to-get-reliable-geolocation-data-on.html

PYTHON ANDROID BUILDOZER https://kivyspacegame.wordpress.com/2014/06/30/tutorial-how-to-build-python-for-android-with-ubuntu-and-buildozer/

QT5 FOR ANDROID http://qt-project.org/wiki/Qt5ForAndroid

/home/resonancg/www/wiki/data/attic/logiciels/cordova/accueil.1425659643.txt.gz · Dernière modification: 2015/03/06 17:34 de resonance