中文字幕 另类精品,亚洲欧美一区二区蜜桃,日本在线精品视频免费,孩交精品乱子片免费

<sup id="3hn2b"></sup>

    1. <sub id="3hn2b"><ol id="3hn2b"></ol></sub><legend id="3hn2b"></legend>

      1. <xmp id="3hn2b"></xmp>

      2. 新聞中心

        Android C編程技巧

        作者: 時(shí)間:2016-10-08 來源:網(wǎng)絡(luò) 收藏

        Android C編程技巧

        本文引用地址:http://www.antipu.com.cn/article/201610/305822.htm

        運(yùn)行模擬器

        emulator -console

        * 將文件寫入到模擬器的userdata.img文件中

        adb push

        *將一個(gè)目錄拷貝到模擬器中,包括子目錄

        adb push

        * 將一個(gè)目錄從模擬器中拷出來

        adb pull

        * 使得模擬器可以運(yùn)行arm代碼.

        使用GNU/ARM Linux編譯器編譯你的應(yīng)用程序就可以了

        * 在模擬器里面運(yùn)行shell,需要先運(yùn)行模擬器

        adb shell

        *運(yùn)行模擬器中的一個(gè)控制臺(tái)程序

        adb shell

        *連接模擬器的控制臺(tái)

        telnet localhost 5554/6/8

        運(yùn)行C程序

        參考文獻(xiàn)

        Native C Hello World working in emulator

        http://groups.google.com/group/a ... wse_thread/threa...

        Native C Applications for Android

        http://benno.id.au/blog/2007/11/13/android-native-apps

        步驟

        * 下載GNU/ARM編譯工具

        http://www.codesourcery.com/gnu_toolchains/arm/download.html

        * 編寫c/c++代碼.

        * 使用GNU/ARM Linux 工具創(chuàng)建一個(gè)應(yīng)用程序,不使用動(dòng)態(tài)鏈接庫

        ex. arm-none-linux-gnueabi-g++.exe -static -o hello HelloAndroid.cpp

        * 啟動(dòng)模擬器

        $SDK_ROOT/tools/emulator.exe

        * 在命令行窗口運(yùn)行 abd將編譯好的hello程序放入模擬器的磁盤

        adb push hello /system/sbin/hello

        * 讓hello文件變成可執(zhí)行程序,不要使用 chmod ugo+x

        adb shell chmod 777 /system/sbin/hello

        * 運(yùn)行hello程序

        adb shell

        cd /system/sbin/

        hello

        EXAMPLE HELLO WORLD CODE

        //

        // HelloAndroid.cpp

        //

        //

        #include

        using std::cin;

        using std::cout;

        using std::endl;

        class MyName

        {

        public:

        void getname( void );

        void sayhello( void );

        private:

        char name[ 255 ];

        };

        void MyName::getname( void )

        {

        cout What is your name? ;

        cin >> name;

        }

        void MyName::sayhello( void )

        {

        cout Welcome name to the world of Android endl;

        }

        MyName name;

        int main( int argc, char *argv[] )

        {

        name.getname();

        name.sayhello();

        return 0;

        }



        關(guān)鍵詞:

        評(píng)論


        相關(guān)推薦

        技術(shù)專區(qū)

        關(guān)閉