小编use*_*565的帖子

球碰撞:球粘在一起

我按照http://www.emanueleferonato.com/2007/08/19/managing-ball-vs-ball-collision-with-flash/上的示例在Android上创建球碰撞,
我的代码组织如下:

int N = 6; // number of balls
for (int i=0; i<N; i++) {
    // move ball
    // as in line 10~39

    // collision detection
    for(int j=i+1; j<N; j++) {
        // as in line 66~77
    } // end for
} // end for
Run Code Online (Sandbox Code Playgroud)

但是,有时我的球可能粘在一起(重叠).
在这个例子中没有发生同样的情况.
为什么?
我需要为每个球开始一个线程吗?

android collision-detection

10
推荐指数
1
解决办法
1522
查看次数

C中的Android AES

我想在PC上加密我的文件(Windows 7,64bit)并在Android上解密它们.

我使用这个算法来加密文件.
http://gladman.plushost.co.uk/oldsite/AES/aes-byte-29-08-08.zip

我在PC上加密我的文件,将它们推送到SD卡.
不幸的是,当我尝试在Android上解密它们时,
结果却不同,
文件完全不可读......!

我的代码出了什么问题?

jbyteArray Java_com_example_hellojni_HelloJni_decrypt(JNIEnv* env, jobject thiz, jstring fileName) {
    ......

    /* read the file into the buffer */
    size_t result = fread (buffer_in, 1, file_size, fin);
    if (result!=file_size) { fputs("Reading error", stderr); exit(3); } /* end if */
    fclose(fin);

    /* decrypt file */
    aes_context ctx[1];
    aes_set_key(key, 16, ctx);
    long i;
    for (i=0; i<num_block; i++) {
        long begin = i*16;
        char *block = copyBlock(buffer_in, file_size, begin, 16), /* copy buffer_in[begin] ~ buffer_in[begin+16-1] to …
Run Code Online (Sandbox Code Playgroud)

c android aes

5
推荐指数
1
解决办法
1220
查看次数

在Android 4.0+中禁用主页按钮

我正在尝试用我自己的应用程序替换股票锁定屏幕.
在我的代码中,我想禁用主页按钮.
我知道如何在Android 2.3及更低版本中执行此操作,
但相同的代码不适用于Android 4.0+(按下Home按钮时返回桌面)

最近我发现了一个名为MiHome的应用程序,它有自己的锁定屏幕并且能够禁用主页按钮.
有谁知道它是如何实现这一点的???

android home-button

3
推荐指数
1
解决办法
2万
查看次数

标签 统计

android ×3

aes ×1

c ×1

collision-detection ×1

home-button ×1