Skip to content

Commit f95c325

Browse files
committed
nambahin readme-en dalam format md html dan pdf
1 parent 7c1d3bf commit f95c325

21 files changed

+1087
-1
lines changed

.directory

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[Dolphin]
2+
Timestamp=2015,2,9,7,0,56
3+
Version=3
4+
ViewMode=1

Makefile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
INSTALL_LOG = install.log
2+
VERSION = 1.0.8
3+
.PHONY : build
4+
5+
all:
6+
@echo "Create README.md"
7+
cat `pwd`/src/* > README.md
8+
sed -i.txt 's|<end>||g' README.md
9+
sed -i.txt 's|(../img|(img|g' README.md
10+
rm README.md.txt
11+
sed 's|(img|(https://github.com/ignsdk/doc-id/raw/master/img|g' README.md > README-single.md

README-en.html

Lines changed: 232 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,232 @@
1+
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2+
<html>
3+
<head>
4+
<meta http-equiv="content-type" content="text/html; charset=utf-8">
5+
<meta name="generator" content="ReText 4.1.2">
6+
<title>README-en</title>
7+
</head>
8+
<body>
9+
<h2>IGNSDK Installation</h2>
10+
<p>IGN SDK included in IGOS Nusantara D9.1 as default package. If it's not installed in your system, see the following step to start the installation:</p>
11+
<ol>
12+
<li>Open yours Terminal Application</li>
13+
<li>IGN SDK binary is launcher for the application built with IGN SDK. You could install IGN SDK package using this command:<blockquote>
14+
<p>$ sudo yum install ignsdk</p>
15+
</blockquote>
16+
</li>
17+
<li>You could try another optional package called <code>ignsdk-devtools</code>. This package is contain tools for creating and packaging IGN SDK Application. Try this command to install <code>ignsdk-devtools</code>: <blockquote>
18+
<p>$ sudo yum install ignsdk-devtools</p>
19+
</blockquote>
20+
</li>
21+
<li>You could test the SDK by running the sample application that located in /usr/share/ignsdk/test. Try this example test:<blockquote>
22+
<p>ignsdk -p /usr/share/ign-sdk/test/calculator.ign</p>
23+
</blockquote>
24+
</li>
25+
</ol>
26+
<h2>Create Application with IGN SDK</h2>
27+
<p>IGN SDK Developer Tools will help you to create an IGN SDK application. In other way, this script could packaging your application into <strong>.deb</strong> (Debian, Ubuntu, LinuxMint, etc) and <strong>.rpm</strong> (IGOS Nusantara, openSUSE) package. Before further reading, make sure that IGN SDK Developer Tools have installed in your Linux Machine that supported by IGN SDK.</p>
28+
<ol>
29+
<li>Open your terminal</li>
30+
<li>Run <code>ignsdk-app-creator -p [packet_name]</code> command in your terminal. <strong>[packet_name]</strong> is filled with your application name. The character must be in lower case, alphanumeric or <strong>dash</strong> ( - ) character. Make a sure that your application name is not duplicate with other application installed at repository (ex: gimp, apache, mysql, dsb.). For the example, you could give a name <code>aplikasi-keren</code> for your application.</li>
31+
</ol>
32+
<pre><code>$ ignsdk-app-creator -p aplikasi-keren
33+
</code></pre>
34+
35+
<ol>
36+
<li>In the next step, the creator will prompt you to type the application name. Fill it with your application name</li>
37+
</ol>
38+
<pre><code>Application name: Aplikasi Keren
39+
</code></pre>
40+
41+
<ol>
42+
<li>In category field, fill the number that match with a category of your application. For the example "Aplikasi Keren" is music player application, so you must fill the field with number 2 (Audio).</li>
43+
</ol>
44+
<pre><code>Choose one: 2
45+
</code></pre>
46+
47+
<ol>
48+
<li>Next, you will prompt to fill the package version. Fill it with 1.0</li>
49+
</ol>
50+
<pre><code>Version [1.0]: 1.0
51+
</code></pre>
52+
53+
<ol>
54+
<li>For the package release field, fill it with code of distro that will be installation target of your application. If you want to target your application for IGOS Nusantara D9.x, fill it with "ign9"</li>
55+
</ol>
56+
<pre><code>Release [1]: ign9
57+
</code></pre>
58+
59+
<ol>
60+
<li>In the license field, fill it with your license option that will be used for your application. It's better to understand the license content you choose in this step</li>
61+
</ol>
62+
<pre><code>License [MIT/BSD/GPL2/GPL3/etc, default=MIT]: MIT
63+
</code></pre>
64+
65+
<ol>
66+
<li>Fill your application URL website in the URL Field</li>
67+
</ol>
68+
<pre><code>URL [example.com]: ignsdk.web.id
69+
</code></pre>
70+
71+
<ol>
72+
<li>Fill the description field with a description of your application</li>
73+
</ol>
74+
<pre><code>Description: Aplikasi keren untuk memutar musik
75+
</code></pre>
76+
77+
<ol>
78+
<li>This script will create new application in <strong>/home/user/IGNSDK-APP/aplikasi-keren.ign</strong> directory. You could run that application with this command</li>
79+
</ol>
80+
<pre><code>$ ignsdk -p ~/IGNSDK-APP/aplikasi-keren.ign
81+
</code></pre>
82+
83+
<h2>Debugging</h2>
84+
<p>In development phase, debugging process has an important roles for helping a developer to know what a process has been executed or emitted error by our application. In IGN SDK, you could choose two mode for debugging your application. You could choose local debugging or remote debugging.</p>
85+
<h3>1.1 Local Debugging</h3>
86+
<p>By default, IGN SDK local debugging could be activated by this method:</p>
87+
<ul>
88+
<li>Give a parameter -d while execute IGN SDK application</li>
89+
</ul>
90+
<pre><code>$ ignsdk -d -p ~/IGNSDK-APP/aplikasi-keren.ign
91+
</code></pre>
92+
93+
<ul>
94+
<li>Add the <code>debug</code> object with <code>true</code> value within <code>ignsdk.json</code> file</li>
95+
</ul>
96+
<pre><code class="json">{
97+
&quot;config&quot; : {
98+
&quot;debug&quot; : true,
99+
&quot;websecurity&quot; : true,
100+
&quot;name&quot; : &quot;Aplikasi Keren&quot;
101+
}
102+
}
103+
</code></pre>
104+
105+
<p><img alt="Local Debugging" src="img/gb1.png"></p>
106+
<h3>1.2 Remote Debugging</h3>
107+
<p>Remote debugging will facilitated developer to enter IGN SDK debug mode with browser or other device. To activated remote debugging, you just add a parameter <code>-r &lt;port&gt;</code> while execute IGN SDK application</p>
108+
<pre><code>$ ignsdk -d -r 8080 ~/IGNSDK-APP/aplikasi-keren.ign
109+
</code></pre>
110+
111+
<p>Then access the debugging mode at your browser with this URL <code>http://ip-target:port</code>. For the example you could try <code>http://127.0.0.1:8080</code> to access your application debugging mode.</p>
112+
<h2>Packaging the Application</h2>
113+
<p>IGN SDK-based application could distribute to user in many ways. The easiest way to distribute your application is create .deb or .rpm package for your application. The script that will be used for packaging the application is <code>ignsdk-app-builder</code>.</p>
114+
<ol>
115+
<li>Open your terminal</li>
116+
<li>Run this command “ignsdk-app-builder -p [package_name]” in terminal. [packet_name] is name of application that you create before, and it's located in
117+
'/home/igos/IGNSDK-APP/'. </li>
118+
</ol>
119+
<pre><code>$ ignsdk-app-builder -p aplikasi-keren
120+
</code></pre>
121+
122+
<ol>
123+
<li>Packaging system will start the process</li>
124+
<li>If the process has finish, the package will bundled in .rpm with name <code>aplikasikeren.ign-1.0-ign9.noarch.rpm</code>. You could find the package at <code>/home/igos/rpmbuild/RPMS/noarch/</code>. And now try to install that package with this command:</li>
125+
</ol>
126+
<pre><code>$ sudo yum install ~/rpmbuild/RPMS/noarch/aplikasi-keren.ign-1.0-ign9.noarch.rpm
127+
</code></pre>
128+
129+
<ol>
130+
<li>After the package is installed, it will appear a menu called <strong>Aplikasi Keren</strong>. Next, the application could execute from that menu</li>
131+
</ol>
132+
<h2>Example Application</h2>
133+
<h3>2.1 Spawn API</h3>
134+
<p><strong>Javascript :</strong></p>
135+
<pre><code class="javascript">/*Import Sys Module from IGNSDK runtime*/
136+
var sys = ign.sys();
137+
138+
$(document).ready(function(){
139+
$('#exec').click(function(){
140+
/*Get the command field
141+
dari text input id (#) &quot;cmd&quot;*/
142+
var cmd = $('#cmd').val();
143+
/*Command are sent to IGN SDK runtime
144+
IGNSDK untuk di eksekusi*/
145+
sys.exec(cmd);
146+
sys.out.connect(function(out){
147+
/*stdout result from runtime is display to id element*/
148+
$('#out').prepend(out+&quot;&lt;br&gt;&quot;);
149+
})
150+
});
151+
152+
$('#kill').click(function(){
153+
/*Stopping the process*/
154+
sys.kill();
155+
});
156+
});
157+
</code></pre>
158+
159+
<p><strong>HTML :</strong></p>
160+
<pre><code class="html">&lt;body&gt;
161+
&lt;input type=&quot;text&quot; value=&quot;ping google.com&quot; id=&quot;cmd&quot;&gt;
162+
&lt;input type=&quot;submit&quot; value=&quot;exec&quot; id=&quot;exec&quot;&gt;
163+
&lt;input type=&quot;submit&quot; value=&quot;kill&quot; id=&quot;kill&quot;&gt;&lt;br&gt;
164+
&lt;div id=&quot;out&quot;&gt;&lt;/div&gt;
165+
&lt;/body&gt;
166+
</code></pre>
167+
168+
<h3>2.2 CRUD</h3>
169+
<p><strong>Javascript :</strong></p>
170+
<pre><code class="javascript">//Import required module from IGN SDK runtime
171+
var fs = ign.filesystem();
172+
var sql = ign.sql();
173+
//database file name
174+
var dbFile = &quot;coba.db&quot;;
175+
176+
$(document).ready(function(){
177+
//reference http://goo.gl/E0obMa
178+
//check if in database is exists
179+
if(fs.info(dbFile).exists){
180+
// if database exists, application will execute load() function
181+
sql.driver(&quot;sqlite&quot;, dbFile);
182+
load();
183+
}
184+
else{
185+
//Execute the setupDB() if database is not exists
186+
setupDb();
187+
}
188+
});
189+
190+
function setupDb(){
191+
//connect to database
192+
sql.driver(&quot;sqlite&quot;, dbFile);
193+
194+
//create user table wit id, nama, and umur field
195+
sql.query(&quot;create table user(id INTEGER PRIMARY KEY AUTOINCREMENT,nama varchar(10), umur smallint)&quot;);
196+
}
197+
198+
function add(){
199+
var nama = $(&quot;#nama&quot;).val();
200+
var umur = $(&quot;#umur&quot;).val();
201+
//query for inserting data into database
202+
var add = sql.query(&quot;insert into user (nama,umur) values ('&quot;+nama+&quot;',&quot;+umur+&quot;)&quot;);
203+
alert(&quot;input berhasil status &quot;+add.status);
204+
}
205+
206+
function load(){
207+
//query for fetching data
208+
var loadData = sql.query(&quot;select * from user&quot;);
209+
var html=&quot;&quot;;
210+
211+
loadData.content.forEach(function(data){
212+
html += &quot;Nama : &quot; + data.nama + &quot;&lt;br&gt;&quot;;
213+
html += &quot;Umur : &quot; + data.umur + &quot;&lt;br&gt;&quot;;
214+
html += &quot;&lt;a href='#' onclick='del(&quot;+data.id+&quot;)'&gt;Delete&lt;/a&gt;&lt;hr&gt;&quot;;
215+
});
216+
$(&quot;#out&quot;).html(html);
217+
}
218+
219+
function del(id){
220+
//query for deleting data
221+
var del = sql.query(&quot;delete from user where id=&quot;+id);
222+
}
223+
</code></pre>
224+
225+
<p><strong>HTML :</strong></p>
226+
<pre><code class="html">&lt;input type=&quot;text&quot; placeholder=&quot;Nama&quot; id=&quot;nama&quot;&gt;&lt;br&gt;
227+
&lt;input type=&quot;text&quot; placeholder=&quot;Umur&quot; id=&quot;umur&quot;&gt;&lt;br&gt;
228+
&lt;input type=&quot;submit&quot; value=&quot;Tambah Data&quot; onclick=&quot;add()&quot;&gt;
229+
&lt;div id=&quot;out&quot;&gt;&lt;/div&gt;
230+
</code></pre>
231+
</body>
232+
</html>

0 commit comments

Comments
 (0)