Linuxϰ²×°ÅäÖÃAndroid¿ª·¢»·¾³
×ªÔØ android sdk 1.5 °²×°ÓëÅäÖÃ
²Î¿¼ ubuntu 8.10 °²×° Android
1.ÏÂÔØandroid sdk
ÏÂÔØµØÖ·ÈçÏ£º
http://dl.google.com/android/android-sdk-windows-1.5_r2.zip
http://dl.google.com/android/android-sdk-linux_x86-1.5_r2.zip
2.
ÏÂÔØeclipse 3.4.2
°´¹Ù·½ÎĵµËµ£¬android sdk ¿ÉÒÔÔËÐÐÔÚeclipse
3.3ÒÔÉϵÄIDEÖУ¬ubuntuÔ´ÖеÄeclipse°æ±¾¹ýµÍ£¬½¨ÒéʹÓÃeclipse 3.4.2£¬ÆäÏÂÔØµØÖ·Îª:
http://download.actuatechina.com/eclipse/eclipse/downloads/drops/R-3.4.2-200902111700/eclipse-SDK-3.4.2-linux-gtk.tar.gz
3.
°²×°eclipse 3.4.2
ÏȽ«eclipse½âѹ:
$tar xzvf
eclipse-SDK-3.4.2-linux-gtk.tar.gz
½«½âѹ³öµÄeclipseÎļþ¼ÐÒÆ¶¯µ½Ä¿±êĿ¼ÖÐÈ¥£¬ÔÚ
ÕâÀïÎÒÉ趨µÄ°²×°Ä¿±êΪ£º/usr/localÏ¡£
$sudo mv eclipse
/usr/local/
(
Java libjvm.so and SELinux error:
/opt/jre1.6.0_03/bin/../lib/i386/client/libjvm.so: cannot restore segment prot after reloc: Permission denied
½â¾ö·½·¨£ºchcon -t textrel_shlib_t /opt/jre1.6.0_03/lib/i386/client/libjvm.so
)
4.°²×°android sdk
½âѹandroid sdk°ü:
$unzip android-sdk-linux_x86-1.5_r2.zip
ÒÆ¶¯µ½Ä¿±êÄ¿
¼£º£¼ÔÚÕâÀïÎÒ½«½âѹ³öµÄsdkÎļþ¼ÐĿ¼¸Ä³ÉÁËandroid-sdk£¾
$mv
android-sdk-linux_x86-1.5_r2 android-sdk
$sudo mv android-sdk
/usr/local/
5.ÅäÖû·¾³±äÁ¿£º
ÐÞ¸Ä~/.bashrcÎļþ£¬¼ÓÈëandroid
sdkÓëeclipseµÄ»·¾³±äÁ¿¡£
$vi ~/.bashrc
ÔÚÎļþµÄ×î
ºó¼ÓÈë
export
PATH=/usr/local/android-sdk/tools:/usr/local/eclipse:$PATH
±£´æ²¢
Í˳övi
ʹÅäÖÃÐÅÏ¢ÉúЧ
$source ~/.bashrc
6.android
avdÅäÖÃÐÅÏ¢µÄÉú³É
android avdµÄ´´½¨¸ñʽΪ:android create avd -n your-avd-name -t
your-targets
ÆäÖУº-nµÄ²ÎÊýΪÎÒÃÇÒª´´½¨µÄavdµÄÃû×Ö;-tµÄ²ÎÊýΪAvailable Android
targetsµÄid,ÎÒÃÇ¿ÉÒÔʹÓÃÃüÁandroid list²éѰÆä¾ßÌåÐÅÏ¢¡£
$android
list
Available Android targets:
id: 1
Name: Android 1.1
Type: Platform
API level: 2
Skins: HVGA-P, HVGA (default), QVGA-P, HVGA-L, QVGA-L
id: 2
Name: Android 1.5
&nb
Ïà¹ØÎĵµ£º
±¾ÎÄÖн«½²Êölinux»·¾³±à³ÌÖÐÏ̵߳ÄʹÓᣲ»Ëµ·Ï»°Ö±½ÓÉÏ´úÂ룺
#include <pthread.h>
#include <assert.h>
struct ThreadData
{
int i;
};
void * ThreadProc(void* arg)
{
ThreadData* data = static_cast<ThreadData*>(arg);
//do something
pthread_exit(data);
}
int main() ......
ǰÑÔ£ºÄ¿Ç°ÕýÔÚæÓÚARMƽ̨µÄLinuxÓ¦ÓóÌÐòµÄ¿ª·¢£¨ÆäʵÊÇ¸Õ¸ÕÆð²½Ñ§Ï°À²£©¡£µ×²ãµÄ¶«Î÷²»Óÿ¼ÂÇÁË£¬¿ª·¢°å×ÓÌṩÁËNAND Bootloader£¬ºÍLinux 2.6µÄÔ´Â룬¶øÇÒ¶¼±àÒëºÃÁË¡£×Ô¼º±àÒëµÄbootloader¿ÉÒÔÓ㬵«ÊÇLinux±àÒëºó£¬ÎļþºÜ´ó£¬ÔÝÇÒ¾ÍÓÃÈ˼ұàÒëµÄϵͳ£¬ÏÈרÐÄдӦÓóÌÐò °É¡£¡£
ÕýÎÄ£ºÒª×öµÄÈÎÎñÊÇ£¬°ÑÒ»¿é°å×ÓÉ쵀 ......
ÔÚÆ½³£µÄ×÷ÒµÖУ¬ÓÐʱºòÀÏʦÈÃ×Ô¼ºÊµÏÖÖîÈçcatµÈÀàµÄ³ÌÐò£¬ÓÐʱºò½ÐÓÃshellʵÏÖ£¬ÓÐʱºòÓÃcʵÏÖ£¬µ«ÊÇÎÒ¾³£Ò»µãÍ·Ð÷¶¼Ã»ÓУ¬²»¹ýÎÒÏëµ½linux¿ªÔ´µÄ£¬ÃüÁî´úÂë¿ÉÒÔÄÃÀ´²Î¿¼Ï°¢£¬ËùÒÔÎÒ¾ÍÏë¿´¿´linuxÃüÁîµÄÔ´´úÂ룬ÓÚÊǾͿªÊ¼Á˰ڶɹ·¹·µÄËÑË÷¹ý³Ì¡£´Ó½á¹ûÀ´¿´£¬ÓÐÁ½ÖÖÇé¿ö£¬Ò»ÖÖÊǸøÓèrpmµÄ°üµÄÐÎʽ£»ÁíÒ»ÖÖÊÇ»ùÓÚdeb°üµÄÐ ......
ÕâÀï¼ÌÐøÉÏһƪ¹ØÓÚÏ̺߳¯ÊýµÄ½éÉÜ£º
int pthread_detach (pthread_t thread_handle);
Õâ¸öº¯ÊýµÄ×÷ÓÃÊÇÈÃthread_handleÖ¸ÏòµÄÄ¿±êÏß³ÌÔÚÖÐÖ¹µÄʱºòÇåÀí×Ô¼ºÓµÓеÄÊý¾Ý¡£ÔÚÕâ¸öº¯Êýµ÷ÓÃÖ®ºó£¬
²»ÄÜÔÙ¶Ôthread_handleʹÓÃpthread_join¡£
ÏÔ¶øÒ×¼ûµÄÊÇ£¬Èç¹ûÎÒÃÇûÓжÔд´½¨µÄÏ̵߳÷ÓÃpthread_detach£¬Õâ¸öÏß ......
Ò»¡¢ ldconfig£º
¡¡¡¡LinuxϵͳÖУ¬ÎªÁËÈö¯Ì¬Á´½Ó¿âΪϵͳËù¹²Ïí£¬»¹ÐèÔËÐж¯Ì¬Á´½Ó¿âµÄ¹ÜÀíÃüÁî——ldconfig.
¡¡¡¡1. ldconfigÃüÁîµÄÓÃ;£ºÖ÷ÒªÊÇÔÚĬÈÏËÑѰĿ¼£¨/libºÍ/usr/lib£©ÒÔ¼°¶¯Ì¬¿âÅäÖÃÎļþ/etc/ld.so.confÄÚËùÁеÄĿ¼Ï£¬ËÑË÷³ö¿É¹²ÏíµÄ¶¯Ì¬Á´½Ó¿â£¨¸ñʽÈçǰ½éÉÜ£¬lib*.so*£©£¬½ø¶ø´´½¨³ö¶¯Ì¬×°È ......