Chinaunix首页 | 论坛 | 博客
  • 博客访问: 380985
  • 博文数量: 71
  • 博客积分: 3226
  • 博客等级: 中校
  • 技术积分: 970
  • 用 户 组: 普通用户
  • 注册时间: 2007-12-04 14:55
文章分类

全部博文(71)

文章存档

2012年(8)

2011年(12)

2010年(11)

2008年(29)

2007年(11)

分类:

2011-01-27 14:11:42

在Android 在NDK r5使用C/C++进行开发。(以前,Android 对C/C++开发的支持仅限于用C/C++开发动态链接库,然后在Java中以JNI的形式来调用)现在,你可以用纯C/C++开发了(参看下面的程序代码)。还有一段完整的代码示例在这里(墙,还有XML的manifest,又见XML)。看来,Google终于明白为什么使用Android的手机(如:Moto, 三星、索爱和HTC)的触摸体验远远不及object C搞出来的iPhone。 

void android_main(struct android_app* state) {

    // Make sure glue isn't stripped.

    app_dummy();

    // loop waiting for stuff to do.

    while (1) {

        // Read all pending events.

        int ident;

        int events;

        struct android_poll_source* source;

       // Read events and draw a frame of animation.

        if ((ident = ALooper_pollAll(0, NULL, &events,

                (void**)&source)) >= 0) {

            // Process this event.

            if (source != NULL) {

                source->process(state, source);

            }

        }

        // draw a frame of animation

        bringTheAwesome();

    }

}

 

阅读(7599) | 评论(1) | 转发(1) |
0

上一篇:make

下一篇:Android架构详解 不错,推荐下

给主人留下些什么吧!~~

wxfjx2011-01-29 22:39:48

貌似很不错啊,