tips:ionic

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
tips:ionic [2017/08/07 13:40] scipiotips:ionic [2017/08/07 13:54] (current) scipio
Line 18: Line 18:
 </code> </code>
  
-===== Project ===== +===== Create library =====
- +
-==== Create library ====+
  
 <code bash> <code bash>
Line 38: Line 36:
 </code> </code>
  
-==== Create project ==== +===== Update libs =====
- +
-  * https://devdactic.com/login-ionic-2/ +
-  * https://ionicacademy.com/ionic-3-lazy-loading/ +
-  * https://www.joshmorony.com/an-introduction-to-observables-for-ionic-2/ +
- +
-Activate library +
-<code bash> +
-. $LIB/bin/activate +
-</code> +
- +
-<code bash> +
-NAME=PeperStart +
-ionic start $NAME blank +
-cd $NAME +
-ionic browser add crosswalk #(this command enable also android platform) +
-</code> +
- +
-==== Update libs ====+
  
 <code bash> <code bash>
Line 66: Line 46:
 </code> </code>
  
-==== Android ====+===== Android =====
  
 It is important to install native gradle or use gradle shipped with android studio (see PATH below) It is important to install native gradle or use gradle shipped with android studio (see PATH below)
Line 109: Line 89:
 </code> </code>
  
-=== Add Native C++ support ===+==== Add java sources and native C++ support ====
  
 Add opencv support http://wiki.csgalileo.org/projects:giano:android#simpler_mode Add opencv support http://wiki.csgalileo.org/projects:giano:android#simpler_mode
Line 178: Line 158:
 </file> </file>
  
-==== Android Studio ====+with <hook src="scripts/config.xml.py" type="before_compile" /> patch **res/xml/config.xml** to export plugin interface, for example 
 +<file xml res/xml/config.xml> 
 + <feature name="TestPlugin"> 
 + <param name="android-package" value="org.csgalileo.giano.TestPlugin"></param> 
 + <param name="onload" value="true"></param> 
 + </feature> 
 +</file> 
 + 
 +define typescript interface 
 +<file typescript src/app/test.module.ts> 
 +import { Injectable } from '@angular/core'; 
 + 
 +declare var cordova:any; 
 + 
 +@Injectable() 
 +export class TestPlugin { 
 +    public testCall() { 
 +        cordova.exec( 
 +                function(data) { console.log("test-plugin getDate="+data); }, 
 +                function(error) { console.log("test-plugin:"+error); }, 
 +                "TestPlugin", 
 +                "getDate", 
 +                []); 
 +    } 
 +
 +</file> 
 + 
 +===== Android Studio =====
  
 After project creation via cli (see up) import project (Eclipse, ADT, gradle) from folder <project-root>/platforms/android (choose to update gradle). After project creation via cli (see up) import project (Eclipse, ADT, gradle) from folder <project-root>/platforms/android (choose to update gradle).
  • tips/ionic.1502106051.txt.gz
  • Last modified: 2017/08/07 13:40
  • by scipio