2011年2月12日 星期六

Linux filesystem 定義文件

neproton.pathname.com/fhs/

目前2.3版
http://proton.pathname.com/fhs/pub/fhs-2.3.pdf

透過Facebook分享

Install LAMP under Ubuntu 10.10

LAMP is Linux, Apache, Mysql and Php.

You can use that to build web server, database under Linux.

You can use the following commmand to install LAMP

1. install lamp-server


nelsonchung@nelsonchung-10:~$ sudo apt-get install lamp-server^
正在讀取套件清單... 完成
正在重建相依關係        
正在讀取狀態資料... 完成
Note, selecting 'libwrap0' for task 'lamp-server'
Note, selecting 'mysql-server-core-5.1' for task 'lamp-server'
Note, selecting 'mysql-client-core-5.1' for task 'lamp-server'
Note, selecting 'libmysqlclient16' for task 'lamp-server'
Note, selecting 'libdbi-perl' for task 'lamp-server'
Note, selecting 'apache2' for task 'lamp-server'
Note, selecting 'apache2-mpm-prefork' for task 'lamp-server'
Note, selecting 'apache2.2-common' for task 'lamp-server'
Note, selecting 'apache2.2-bin' for task 'lamp-server'
Note, selecting 'apache2-utils' for task 'lamp-server'
Note, selecting 'libapr1' for task 'lamp-server'
Note, selecting 'libaprutil1' for task 'lamp-server'
Note, selecting 'libaprutil1-dbd-sqlite3' for task 'lamp-server'
Note, selecting 'libaprutil1-ldap' for task 'lamp-server'
Note, selecting 'ssl-cert' for task 'lamp-server'
Note, selecting 'mysql-server' for task 'lamp-server'
Note, selecting 'libapache2-mod-php5' for task 'lamp-server'
Note, selecting 'php5-common' for task 'lamp-server'
Note, selecting 'php5-cli' for task 'lamp-server'
Note, selecting 'libdbd-mysql-perl' for task 'lamp-server'
Note, selecting 'libplrpc-perl' for task 'lamp-server'
Note, selecting 'libhtml-template-perl' for task 'lamp-server'
Note, selecting 'mysql-common' for task 'lamp-server'
Note, selecting 'libnet-daemon-perl' for task 'lamp-server'
Note, selecting 'tcpd' for task 'lamp-server'
Note, selecting 'mysql-client-5.1' for task 'lamp-server'
Note, selecting 'mysql-server-5.1' for task 'lamp-server'
Note, selecting 'php5-mysql' for task 'lamp-server'
libwrap0 已經是最新版本了。
ssl-cert 已經是最新版本了。
tcpd 已經是最新版本了。
The following packages were automatically installed and are no longer required:
  linux-headers-2.6.35-22 linux-headers-2.6.35-22-generic
使用 'apt-get autoremove' 來將其移除。
下列的額外套件將被安裝:
  apache2 apache2-mpm-prefork apache2-utils apache2.2-bin apache2.2-common
  libapache2-mod-php5 libapr1 libaprutil1 libaprutil1-dbd-sqlite3
  libaprutil1-ldap libdbd-mysql-perl libdbi-perl libhtml-template-perl
  libmysqlclient16 libnet-daemon-perl libplrpc-perl mysql-client-5.1
  mysql-client-core-5.1 mysql-common mysql-server mysql-server-5.1
  mysql-server-core-5.1 php5-cli php5-common php5-mysql
建議套件:
  apache2-doc apache2-suexec apache2-suexec-custom php-pear
  libipc-sharedcache-perl tinyca mailx php5-suhosin
下列【新】套件將會被安裝:
  apache2 apache2-mpm-prefork apache2-utils apache2.2-bin apache2.2-common
  libapache2-mod-php5 libapr1 libaprutil1 libaprutil1-dbd-sqlite3
  libaprutil1-ldap libdbd-mysql-perl libdbi-perl libhtml-template-perl
  libmysqlclient16 libnet-daemon-perl libplrpc-perl mysql-client-5.1
  mysql-client-core-5.1 mysql-common mysql-server mysql-server-5.1
  mysql-server-core-5.1 php5-cli php5-common php5-mysql
升級 0 個,新安裝 25 個,移除 0 個,有 1 個未被升級。
需要下載 149kB/32.7MB 的套件檔。
此操作完成之後,會多佔用 81.4MB 的磁碟空間。
是否繼續進行 [Y/n]?y
下載:1 http://archive.ubuntu.com/ubuntu/ maverick/main libnet-daemon-perl all 0.43-1 [46.9kB]
下載:2 http://archive.ubuntu.com/ubuntu/ maverick/main libplrpc-perl all 0.2020-2 [36.0kB]
下載:3 http://archive.ubuntu.com/ubuntu/ maverick/main libhtml-template-perl all 2.9-1 [65.8kB]
取得 149kB 用了 3s (47.3kB/s)                
正在預先設定套件 ...
選取了原先未被選取的套件 mysql-common。
(正在讀取資料庫 ... 系統目前共安裝了 145081 個檔案和目錄。)
正在解開 mysql-common (從 .../mysql-common_5.1.49-1ubuntu8.1_all.deb)...
選取了原先未被選取的套件 libnet-daemon-perl。
正在解開 libnet-daemon-perl (從 .../libnet-daemon-perl_0.43-1_all.deb)...
選取了原先未被選取的套件 libplrpc-perl。
正在解開 libplrpc-perl (從 .../libplrpc-perl_0.2020-2_all.deb)...
選取了原先未被選取的套件 libdbi-perl。
正在解開 libdbi-perl (從 .../libdbi-perl_1.611-1_i386.deb)...
選取了原先未被選取的套件 libmysqlclient16。
正在解開 libmysqlclient16 (從 .../libmysqlclient16_5.1.49-1ubuntu8.1_i386.deb)...
選取了原先未被選取的套件 libdbd-mysql-perl。
正在解開 libdbd-mysql-perl (從 .../libdbd-mysql-perl_4.016-1_i386.deb)...
選取了原先未被選取的套件 mysql-client-core-5.1。
正在解開 mysql-client-core-5.1 (從 .../mysql-client-core-5.1_5.1.49-1ubuntu8.1_i386.deb)...
選取了原先未被選取的套件 mysql-client-5.1。
正在解開 mysql-client-5.1 (從 .../mysql-client-5.1_5.1.49-1ubuntu8.1_i386.deb)...
選取了原先未被選取的套件 mysql-server-core-5.1。
正在解開 mysql-server-core-5.1 (從 .../mysql-server-core-5.1_5.1.49-1ubuntu8.1_i386.deb)...
正在進行 man-db 的觸發程式 ...
正在設定 mysql-common (5.1.49-1ubuntu8.1) ...
選取了原先未被選取的套件 mysql-server-5.1。
(正在讀取資料庫 ... 系統目前共安裝了 145446 個檔案和目錄。)
正在解開 mysql-server-5.1 (從 .../mysql-server-5.1_5.1.49-1ubuntu8.1_i386.deb)...
選取了原先未被選取的套件 libapr1。
正在解開 libapr1 (從 .../libapr1_1.4.2-3ubuntu1_i386.deb)...
選取了原先未被選取的套件 libaprutil1。
正在解開 libaprutil1 (從 .../libaprutil1_1.3.9+dfsg-3ubuntu0.10.10.1_i386.deb)...
選取了原先未被選取的套件 libaprutil1-dbd-sqlite3。
正在解開 libaprutil1-dbd-sqlite3 (從 .../libaprutil1-dbd-sqlite3_1.3.9+dfsg-3ubuntu0.10.10.1_i386.deb)...
選取了原先未被選取的套件 libaprutil1-ldap。
正在解開 libaprutil1-ldap (從 .../libaprutil1-ldap_1.3.9+dfsg-3ubuntu0.10.10.1_i386.deb)...
選取了原先未被選取的套件 apache2.2-bin。
正在解開 apache2.2-bin (從 .../apache2.2-bin_2.2.16-1ubuntu3.1_i386.deb)...
選取了原先未被選取的套件 apache2-utils。
正在解開 apache2-utils (從 .../apache2-utils_2.2.16-1ubuntu3.1_i386.deb)...
選取了原先未被選取的套件 apache2.2-common。
正在解開 apache2.2-common (從 .../apache2.2-common_2.2.16-1ubuntu3.1_i386.deb)...
選取了原先未被選取的套件 apache2-mpm-prefork。
正在解開 apache2-mpm-prefork (從 .../apache2-mpm-prefork_2.2.16-1ubuntu3.1_i386.deb)...
選取了原先未被選取的套件 apache2。
正在解開 apache2 (從 .../apache2_2.2.16-1ubuntu3.1_i386.deb)...
選取了原先未被選取的套件 php5-common。
正在解開 php5-common (從 .../php5-common_5.3.3-1ubuntu9.3_i386.deb)...
選取了原先未被選取的套件 libapache2-mod-php5。
正在解開 libapache2-mod-php5 (從 .../libapache2-mod-php5_5.3.3-1ubuntu9.3_i386.deb)...
選取了原先未被選取的套件 libhtml-template-perl。
正在解開 libhtml-template-perl (從 .../libhtml-template-perl_2.9-1_all.deb)...
選取了原先未被選取的套件 mysql-server。
正在解開 mysql-server (從 .../mysql-server_5.1.49-1ubuntu8.1_all.deb)...
選取了原先未被選取的套件 php5-cli。
正在解開 php5-cli (從 .../php5-cli_5.3.3-1ubuntu9.3_i386.deb)...
選取了原先未被選取的套件 php5-mysql。
正在解開 php5-mysql (從 .../php5-mysql_5.3.3-1ubuntu9.3_i386.deb)...
正在進行 ureadahead 的觸發程式 ...
ureadahead will be reprofiled on next reboot
正在進行 man-db 的觸發程式 ...
正在進行 ufw 的觸發程式 ...
正在設定 libnet-daemon-perl (0.43-1) ...
正在設定 libplrpc-perl (0.2020-2) ...
正在設定 libdbi-perl (1.611-1) ...
正在設定 libmysqlclient16 (5.1.49-1ubuntu8.1) ...
正在設定 libdbd-mysql-perl (4.016-1) ...
正在設定 mysql-client-core-5.1 (5.1.49-1ubuntu8.1) ...
正在設定 mysql-client-5.1 (5.1.49-1ubuntu8.1) ...
正在設定 mysql-server-core-5.1 (5.1.49-1ubuntu8.1) ...
正在設定 mysql-server-5.1 (5.1.49-1ubuntu8.1) ...
mysql start/running, process 2998
正在設定 libapr1 (1.4.2-3ubuntu1) ...
正在設定 libaprutil1 (1.3.9+dfsg-3ubuntu0.10.10.1) ...
正在設定 libaprutil1-dbd-sqlite3 (1.3.9+dfsg-3ubuntu0.10.10.1) ...
正在設定 libaprutil1-ldap (1.3.9+dfsg-3ubuntu0.10.10.1) ...
正在設定 apache2.2-bin (2.2.16-1ubuntu3.1) ...
正在設定 apache2-utils (2.2.16-1ubuntu3.1) ...
正在設定 apache2.2-common (2.2.16-1ubuntu3.1) ...
Enabling site default.
Enabling module alias.
Enabling module autoindex.
Enabling module dir.
Enabling module env.
Enabling module mime.
Enabling module negotiation.
Enabling module setenvif.
Enabling module status.
Enabling module auth_basic.
Enabling module deflate.
Enabling module authz_default.
Enabling module authz_user.
Enabling module authz_groupfile.
Enabling module authn_file.
Enabling module authz_host.
Enabling module reqtimeout.
正在設定 apache2-mpm-prefork (2.2.16-1ubuntu3.1) ...
 * Starting web server apache2                                           [ OK ]
正在設定 apache2 (2.2.16-1ubuntu3.1) ...
正在設定 php5-common (5.3.3-1ubuntu9.3) ...
正在設定 libapache2-mod-php5 (5.3.3-1ubuntu9.3) ...

Creating config file /etc/php5/apache2/php.ini with new version
 * Reloading web server config apache2                                   [ OK ]
正在設定 libhtml-template-perl (2.9-1) ...
正在設定 mysql-server (5.1.49-1ubuntu8.1) ...
正在設定 php5-cli (5.3.3-1ubuntu9.3) ...

Creating config file /etc/php5/cli/php.ini with new version
update-alternatives: using /usr/bin/php5 to provide /usr/bin/php (php) in auto mode.
正在設定 php5-mysql (5.3.3-1ubuntu9.3) ...
正在進行 libc-bin 的觸發程式 ...
ldconfig deferred processing now taking place
nelsonchung@nelsonchung-10:~$

2. set the password of Mysql

3. test Apache

open browser and type http://localhost
It is workable if you see the message "It works" on the browser.


4. test php
vim /var/www/test.php
and type


restart apache
sudo /etc/init.d/apache2 restart

open browser and tyep http://localhost/test.php
It is workable if you see the php version on the browser.



5. configure mysql

5.1 check hosts

nelsonchung@nelsonchung-10:~$ cat /etc/hosts | grep localhost
127.0.0.1 localhost.localdomain localhost
::1 nelsonchung-10 localhost6.localdomain6 localhost6
::1     localhost ip6-localhost ip6-loopback

5.2 check bind-address is the same with hosts
nelsonchung@nelsonchung-10:~$ cat /etc/mysql/my.cnf | grep bind-address
bind-address = 127.0.0.1
nelsonchung@nelsonchung-10:~$ 

6. install phpMyAdmin


sudo apt-get install libapache2-mod-auth-mysql phpmyadmin

You will need to choose web server 

I choose apache2




nelsonchung@nelsonchung-10:~$ sudo apt-get install libapache2-mod-auth-mysql phpmyadmin
[sudo] password for nelsonchung: 
正在讀取套件清單... 完成
正在重建相依關係          
正在讀取狀態資料... 完成
The following packages were automatically installed and are no longer required:
  linux-headers-2.6.35-22 linux-headers-2.6.35-22-generic
使用 'apt-get autoremove' 來將其移除。
下列的額外套件將被安裝:
  dbconfig-common javascript-common libjs-mootools libmcrypt4 php5-gd
  php5-mcrypt wwwconfig-common
建議套件:
  libmcrypt-dev mcrypt postgresql-client apache apache-ssl
下列【新】套件將會被安裝:
  dbconfig-common javascript-common libapache2-mod-auth-mysql libjs-mootools
  libmcrypt4 php5-gd php5-mcrypt phpmyadmin wwwconfig-common
升級 0 個,新安裝 9 個,移除 0 個,有 1 個未被升級。
需要下載 5,244kB 的套件檔。
此操作完成之後,會多佔用 21.5MB 的磁碟空間。
是否繼續進行 [Y/n]?y
下載:1 http://archive.ubuntu.com/ubuntu/ maverick/main dbconfig-common all 1.8.46 [474kB]
下載:2 http://archive.ubuntu.com/ubuntu/ maverick/universe wwwconfig-common all 0.2.1 [22.8kB]
下載:3 http://archive.ubuntu.com/ubuntu/ maverick/universe javascript-common all 7 [3,854B]
下載:4 http://archive.ubuntu.com/ubuntu/ maverick/main libapache2-mod-auth-mysql i386 4.3.9-13ubuntu1 [25.9kB]
下載:5 http://archive.ubuntu.com/ubuntu/ maverick/universe libjs-mootools all 1.2.4.0~debian1-1 [248kB]
下載:6 http://archive.ubuntu.com/ubuntu/ maverick/universe libmcrypt4 i386 2.5.8-3.1 [76.1kB]       
下載:7 http://archive.ubuntu.com/ubuntu/ maverick-updates/main php5-gd i386 5.3.3-1ubuntu9.3 [34.0kB]
下載:8 http://archive.ubuntu.com/ubuntu/ maverick/universe php5-mcrypt i386 5.3.3-0ubuntu2 [16.9kB] 
下載:9 http://archive.ubuntu.com/ubuntu/ maverick-updates/universe phpmyadmin all 4:3.3.7-3build0.10.10.1 [4,342kB]
取得 5,244kB 用了 48s (107kB/s)                                                                     
正在預先設定套件 ...
選取了原先未被選取的套件 dbconfig-common。
(正在讀取資料庫 ... 系統目前共安裝了 147691 個檔案和目錄。)
正在解開 dbconfig-common (從 .../dbconfig-common_1.8.46_all.deb)...
選取了原先未被選取的套件 wwwconfig-common。
正在解開 wwwconfig-common (從 .../wwwconfig-common_0.2.1_all.deb)...
選取了原先未被選取的套件 javascript-common。
正在解開 javascript-common (從 .../javascript-common_7_all.deb)...
選取了原先未被選取的套件 libapache2-mod-auth-mysql。
正在解開 libapache2-mod-auth-mysql (從 .../libapache2-mod-auth-mysql_4.3.9-13ubuntu1_i386.deb)...
選取了原先未被選取的套件 libjs-mootools。
正在解開 libjs-mootools (從 .../libjs-mootools_1.2.4.0~debian1-1_all.deb)...
選取了原先未被選取的套件 libmcrypt4。
正在解開 libmcrypt4 (從 .../libmcrypt4_2.5.8-3.1_i386.deb)...
選取了原先未被選取的套件 php5-gd。
正在解開 php5-gd (從 .../php5-gd_5.3.3-1ubuntu9.3_i386.deb)...
選取了原先未被選取的套件 php5-mcrypt。
正在解開 php5-mcrypt (從 .../php5-mcrypt_5.3.3-0ubuntu2_i386.deb)...
選取了原先未被選取的套件 phpmyadmin。
正在解開 phpmyadmin (從 .../phpmyadmin_4%3a3.3.7-3build0.10.10.1_all.deb)...
正在進行 man-db 的觸發程式 ...
正在進行 libapache2-mod-php5 的觸發程式 ...
 * Reloading web server config apache2                                                        [ OK ] 
正在進行 doc-base 的觸發程式 ...
Processing 1 added doc-base file(s)...
Registering documents with scrollkeeper...
正在設定 dbconfig-common (1.8.46) ...

Creating config file /etc/dbconfig-common/config with new version
正在設定 wwwconfig-common (0.2.1) ...
正在設定 javascript-common (7) ...
正在設定 libapache2-mod-auth-mysql (4.3.9-13ubuntu1) ...
正在設定 libjs-mootools (1.2.4.0~debian1-1) ...
正在設定 libmcrypt4 (2.5.8-3.1) ...
正在設定 php5-gd (5.3.3-1ubuntu9.3) ...
正在設定 php5-mcrypt (5.3.3-0ubuntu2) ...
正在設定 phpmyadmin (4:3.3.7-3build0.10.10.1) ...
dbconfig-common: writing config to /etc/dbconfig-common/phpmyadmin.conf

Creating config file /etc/dbconfig-common/phpmyadmin.conf with new version

Creating config file /etc/phpmyadmin/config-db.php with new version
granting access to database phpmyadmin for phpmyadmin@localhost: success.
verifying access for phpmyadmin@localhost: success.
creating database phpmyadmin: success.
verifying database phpmyadmin exists: success.
populating database via sql...  done.
dbconfig-common: flushing administrative password
 * Reloading web server config apache2                                                        [ OK ] 
正在進行 libc-bin 的觸發程式 ...
ldconfig deferred processing now taking place

7. test phpmyadmin

open web browser and type http://localhost/phpmyadmin/


You can start to develop your web site on /var/www
Reference:

透過Facebook分享

2011年2月11日 星期五

[Android] Activity全螢幕效果

需要這兩段code


//去除標題框
requestWindowFeature(Window.FEATURE_NO_TITLE);
//全螢幕效果
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);

加在onCreate內

source code download

PS.
記得要放在這兩行code之間
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
不然會有error

透過Facebook分享

samba 開啟可寫入檔案的目錄

編輯 /etc/samba/smb.conf


[Test]
        comment = write test
        path = /home/nelsonchung/test
        writable = yes

sudo service smbd restart

Reference:
http://linux.vbird.org/linux_server/0370samba.php#server_smb.conf_dir


透過Facebook分享

2011年2月10日 星期四

wget proxy 設定

設定檔位置
/etc/wgetrc
找到keyword
http_proxy

設定好後
就可以用wget在有proxy環境下使用嚕

透過Facebook分享

[Android] 十字定位的座標位置

第一次進Android會需要作十字定位
產生的檔案釋放到哪裡去呢

/data/system/calibration

這樣一來
以後不用把整個data做一次format了

透過Facebook分享

[Android] OnTimer function

在Android下如何作到類似MFC OnTimer功能呢

1. 宣告Timer timer;
2. onCreate內

        timer = new Timer();
        timer.schedule(new CShowTime(), 1000, 5000);


3. 實做class CShowTime
private class CShowTime extends TimerTask{
}
你需要override run function

sample code download

經由實驗結果timer還蠻準的

Reference:
http://developer.android.com/reference/java/util/Timer.html
http://ccckmit.wikidot.com/ga:timertask

透過Facebook分享

2011年2月9日 星期三

[Android] 寫入檔案到sd卡

使用
try{

String directory = "/mnt/sdcard/";
String filename = "text.txt";
File file = new File(directory, filename);
outputStream = new FileOutputStream(file);
}

catch (FileNotFoundException ex) {
            Log.w(TAG, ex);
            return null;
}


總是會有exception-FileNotFoundException

create file會失敗

如果你想要對sd卡寫入檔案
你需要在AndroidManifest.xml中加入

允許你的應用程式可以寫入資料到sd卡中


Reference:
http://www.cnmsdn.com/html/201012/1293359114ID8890_2.html

透過Facebook分享

2011年2月8日 星期二

The message from building Camera application

mm showcommands
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=2.2
TARGET_PRODUCT=imx51_bbg
TARGET_BUILD_VARIANT=eng
TARGET_SIMULATOR=false
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
HOST_ARCH=x86
HOST_OS=linux
HOST_BUILD_TYPE=release
BUILD_ID=FRF85B
============================================
No private recovery resources for TARGET_DEVICE imx51_bbg
make: Entering directory `/home/nelsonchung/myandroid9.1'
Copying: out/target/common/obj/APPS/Camera_intermediates/classes-full-debug.jar
out/host/linux-x86/bin/acp -fpt out/target/common/obj/APPS/Camera_intermediates/classes-full-debug.jar out/target/common/obj/APPS/Camera_intermediates/emma_out/lib/classes-full-debug.jar
Copying: out/target/common/obj/APPS/CameraTests_intermediates/classes-full-debug.jar
out/host/linux-x86/bin/acp -fpt out/target/common/obj/APPS/CameraTests_intermediates/classes-full-debug.jar out/target/common/obj/APPS/CameraTests_intermediates/emma_out/lib/classes-full-debug.jar
Copying: out/target/common/obj/APPS/CameraTests_intermediates/classes-full-names.jar
out/host/linux-x86/bin/acp out/target/common/obj/APPS/CameraTests_intermediates/emma_out/lib/classes-full-debug.jar out/target/common/obj/APPS/CameraTests_intermediates/classes-full-names.jar
Copying: out/target/common/obj/APPS/CameraTests_intermediates/classes.jar
out/host/linux-x86/bin/acp out/target/common/obj/APPS/CameraTests_intermediates/classes-full-names.jar out/target/common/obj/APPS/CameraTests_intermediates/classes.jar
target Dex: CameraTests
out/host/linux-x86/bin/dx -JXms16M -JXmx1536M --dex --output=out/target/common/obj/APPS/CameraTests_intermediates/classes.dex    out/target/common/obj/APPS/CameraTests_intermediates/classes.jar
target Package: CameraTests (out/target/product/imx51_bbg/obj/APPS/CameraTests_intermediates/package.apk)
touch out/target/product/imx51_bbg/obj/APPS/CameraTests_intermediates//dummy
(cd out/target/product/imx51_bbg/obj/APPS/CameraTests_intermediates/ && jar cf package.apk dummy)
zip -qd out/target/product/imx51_bbg/obj/APPS/CameraTests_intermediates/package.apk dummy
rm out/target/product/imx51_bbg/obj/APPS/CameraTests_intermediates//dummy
out/host/linux-x86/bin/aapt package -u  -c en_US,en_GB,fr_FR,it_IT,es_ES,es_US,de_DE,nl_NL,cs_CZ,pl_PL,zh_TW,zh_CN,ru_RU,ko_KR,nb_NO,pt_PT,pt_BR,da_DK,el_GR,sv_SE,tr_TR,ja_JP,hdpi,mdpi,nodpi -M packages/apps/Camera/tests/AndroidManifest.xml   -I out/target/common/obj/APPS/framework-res_intermediates/package-export.apk --min-sdk-version 8 --target-sdk-version 8 --version-code 8 --version-name 2.2   -F out/target/product/imx51_bbg/obj/APPS/CameraTests_intermediates/package.apk
out/host/linux-x86/bin/aapt add -k out/target/product/imx51_bbg/obj/APPS/CameraTests_intermediates/package.apk out/target/common/obj/APPS/CameraTests_intermediates/classes.dex
 'out/target/common/obj/APPS/CameraTests_intermediates/classes.dex' as 'classes.dex'...
mv out/target/product/imx51_bbg/obj/APPS/CameraTests_intermediates/package.apk out/target/product/imx51_bbg/obj/APPS/CameraTests_intermediates/package.apk.unsigned
java -jar out/host/linux-x86/framework/signapk.jar build/target/product/security/testkey.x509.pem build/target/product/security/testkey.pk8 out/target/product/imx51_bbg/obj/APPS/CameraTests_intermediates/package.apk.unsigned out/target/product/imx51_bbg/obj/APPS/CameraTests_intermediates/package.apk.signed
mv out/target/product/imx51_bbg/obj/APPS/CameraTests_intermediates/package.apk.signed out/target/product/imx51_bbg/obj/APPS/CameraTests_intermediates/package.apk
mv out/target/product/imx51_bbg/obj/APPS/CameraTests_intermediates/package.apk out/target/product/imx51_bbg/obj/APPS/CameraTests_intermediates/package.apk.unaligned
out/host/linux-x86/bin/zipalign -f 4 out/target/product/imx51_bbg/obj/APPS/CameraTests_intermediates/package.apk.unaligned out/target/product/imx51_bbg/obj/APPS/CameraTests_intermediates/package.apk.aligned
mv out/target/product/imx51_bbg/obj/APPS/CameraTests_intermediates/package.apk.aligned out/target/product/imx51_bbg/obj/APPS/CameraTests_intermediates/package.apk
Install: out/target/product/imx51_bbg/data/app/CameraTests.apk
out/host/linux-x86/bin/acp -fpt out/target/product/imx51_bbg/obj/APPS/CameraTests_intermediates/package.apk out/target/product/imx51_bbg/data/app/CameraTests.apk
Install: out/target/product/imx51_bbg/system/app/Camera.apk
out/host/linux-x86/bin/acp -fpt out/target/product/imx51_bbg/obj/APPS/Camera_intermediates/package.apk out/target/product/imx51_bbg/system/app/Camera.apk
make: Leaving directory `/home/nelsonchung/myandroid9.1'

會將編譯好的Camera.apk放到out/target/product/imx51_bbg/system/app

透過Facebook分享