screen size compatibility

by Abhi » Fri, 18 Dec 2009 00:06:37 GMT


Sponsored Links
 Hi,

I want to make my app compatible to different screen sizes. I am right
now developing on the Droid and need to know how can I import the
screen image on eclipse emulator? I don't have a droid phone but want
to make sure my app layout doesn't change on the Droid.

Any suggestions?

Abhi

--



screen size compatibility

by admin.androidsl...@googlemail.com » Fri, 18 Dec 2009 00:19:55 GMT


 You can use an emulator and set it to Droid WVGA resolution.

If you are just testing screen sizes this should be fine.

If you need to test other functionality of the device, e.g. camera,
gps, integration between apps, etc. you will be better off with the
device itself.

--


Sponsored Links


Other Threads

1. a simple native pthread test but SIGSEGV generated!

hello world
i try to do a simple pthread test on android (natively)

/*========START OF CODE ===============*/
#include <stdio.h>
#include <sys/types.h>
#include <pthread.h>

void *hello(void *arg)
{
        printf("Hello from node %d\n", *(int *)arg);
}

int main(int argc, char* argv[])
{
        int n,i;
        pthread_t threads[2];

        n = 2;

        /* Start up thread */
        for (i = 0; i < n; i++)
        {
                pthread_create(&threads[i], NULL, hello, (void *)&i);
        }

        /* Synchronize the completion of each thread. */
        for (i = 0; i < n; i++)
        {
                pthread_join(threads[i],NULL);
        }
    printf("pthread_test returns \n");
    return 0;
}
/*===========END OF CODE=========*/

then i compile it  (pthread.c)
$>arm-none-linux-gnueabi-gcc -c -g pthread.c
$>arm-none-linux-gnueabi-ld --entry=main --dynamic-linker /system/bin/
linker -nostdlib -rpath /system/lib -rpath system/lib -L system/lib  -
lc -o pthread_test pthread.o

./system is the directory of system image


but in pthread_join , SIGSEGV will be generated

i use strace to debug this
# ./strace ./pthread_test
execve("./pthread_test", ["./pthread_test"], [/* 10 vars */]) = 0
getpid()                                = 189
syscall_983045(0xb00169c4, 0x4990, 0xb0011030, 0, 0x1, 0xbecf6d94,
0xbecf6d9c, 0xf0005, 0, 0, 0, 0, 0, 0xbecf6d60, 0xb0000dcd,
0xb00015ac, 0x80000010, 0xb00169c4, 0, 0, 0, 0xeb48, 0xcd1f8, 0xcd1d0,
0, 0, 0, 0, 0, 0, 0, 0) = 0
gettid()                                = 189
sigaction(SIGILL, {0xb0001211, [], SA_RESTART}, {SIG_DFL}, 0) = 0
sigaction(SIGABRT, {0xb0001211, [], SA_RESTART}, {SIG_DFL}, 0) = 0
sigaction(SIGBUS, {0xb0001211, [], SA_RESTART}, {SIG_DFL}, 0) = 0
sigaction(SIGFPE, {0xb0001211, [], SA_RESTART}, {SIG_DFL}, 0) = 0
sigaction(SIGSEGV, {0xb0001211, [], SA_RESTART}, {SIG_DFL}, 0) = 0
sigaction(SIGSTKFLT, {0xb0001211, [], SA_RESTART}, {SIG_DFL}, 0) = 0
open("libc.so", O_RDONLY|O_LARGEFILE)   = -1 ENOENT (No such file or
directory)
open("/system/lib/libc.so", O_RDONLY|O_LARGEFILE) = 3
lseek(3, 0, SEEK_SET)                   = 0
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0`
\225\0\000"..., 4096) = 4096
lseek(3, -8, SEEK_END)                  = 227472
read(3, "\0\0\340\257PRE ", 8)          = 8
mmap2(0xafe00000, 274432, PROT_READ|PROT_EXEC, MAP_PRIVATE|
MAP_ANONYMOUS, -1, 0) = 0xafe00000
mmap2(0xafe00000, 214032, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED,
3, 0) = 0xafe00000
mprotect(0xafe00000, 217088, PROT_READ|PROT_WRITE|PROT_EXEC) = 0
mmap2(0xafe35000, 8420, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED,
3, 0x35) = 0xafe35000
mmap2(0xafe38000, 41760, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|
MAP_ANONYMOUS, -1, 0) = 0xafe38000
close(3)                                = 0
mprotect(0xafe00000, 217088, PROT_READ|PROT_EXEC) = 0
getuid32()                              = 0
geteuid32()                             = 0
open("/dev/urandom", O_RDONLY|O_LARGEFILE) = 3
read(3, "%\374\353\364", 4)             = 4
close(3)                                = 0
mprotect(0x8000, 4096, PROT_READ|PROT_EXEC) = 0
getuid32()                              = 0
geteuid32()                             = 0
brk(0)                                  = 0x11000
brk(0x11000)                            = 0x11000
brk(0x12000)                            = 0x12000
mmap2(0x10000000, 1048576, PROT_READ|PROT_WRITE, MAP_PRIVATE|
MAP_ANONYMOUS|MAP_NORESERVE, -1, 0) = 0x10000000
mprotect(0x10000000, 4096, PROT_NONE)   = 0
clone(child_stack=0x100fff00, flags=CLONE_VM|CLONE_FS|CLONE_FILES|
CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_DETACHED) = 190
futex(0x100fff00, FUTEX_WAKE, 1Hello from node 0
)        = 1
mmap2(0x10000000, 1048576, PROT_READ|PROT_WRITE, MAP_PRIVATE|
MAP_ANONYMOUS|MAP_NORESERVE, -1, 0) = 0x10000000
mprotect(0x10000000, 4096, PROT_NONE)   = 0
clone(child_stack=0x100fff00, flags=CLONE_VM|CLONE_FS|CLONE_FILES|
CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_DETACHED) = 191
futex(0x100fff00, FUTEX_WAKE, 1Hello from node 1
)        = 1
--- SIGSEGV (Segmentation fault) @ 0 (4) ---
sigaction(SIGUSR1, {SIG_IGN}, {SIG_DFL}, 0) = 0
gettid()                                = 189
SYS_281(0x1, 0x1, 0, 0xffffe52c, 0xb000f55c) = 3
SYS_283(0x3, 0xbecf69b6, 0x14, 0x1, 0x3) = 0
write(3, "\275\0\0\0", 4)               = 4
read(3, 0xbecf6a54, 1)                  = ? ERESTARTSYS (To be
restarted)
--- SIGCONT (Continued) @ 0 (0) ---
read(3, "", 1)                          = 0
close(3)                                = 0
sigaction(SIGSEGV, {SIG_IGN}, {0xb0001211, [], SA_RESTART}, 0) = 0
sigreturn()                             = ? (mask now [])
--- SIGSEGV (Segmentation fault) @ 0 (4) ---
+++ killed by SIGSEGV +++




so i would like to ask why pthread_join here will always generate
SIGSEGV???

thanks

--~--~---------~--~----~------------~-------~--~----~

2. new raw folder cannot be found by aapt tool

I am trying to use a wav file for my test application in the Eclipse
IDE.  I created a raw folder under res, then imported the sound file
into it.

My code:
MediaPlayer mp = MediaPlayer.create(Test_Class.this,
R.raw.largeSound);

The 'R.raw' is reported as an error, "R.raw cannot be resolved"

So the application/IDE can't find the raw folder, but the raw folder
is included in the project under the 'res' folder.  The R.java file
doesn't reflect the raw folders presence, so is there something I have
to do to 'let it know' I've added the folder to the project?

I've deleted the raw folder, and tried to add it again, but still to
no avail.  :(



--~--~---------~--~----~------------~-------~--~----~

3. Successfully ported Android on Beagle Board.

4. Not able to locate any database on Emulator

5. After executed /init, VM is not running...

6. ADB blue-screen when installing my app

7. Scrolling with Multiple ListViews