(closed)Wta: Sapa tau ada yg kenal?

by Dedi Sopian » Thu, 06 May 2010 13:42:26 GMT

Sponsored Links
 Oke sudah tersambung sama yg bersangkutan. Thanks ingpownya.

ada google
tinggal search aja.
privacy is all lost :)


Other Threads

1. About Monkey Scripting option


I would like to tell every body that it is possible to simulate a
sequence of events on emulator using monkey scripting option "-f" .

It is successful on android 2.0 sdk



2. Java Question about reflection

Nothing specifically related to Android: more a java question while
struggling making the switch from objective c to java:

1. In Java static methods when implemented in derived classes are
hidden, not overridden. If I have a method foo() in class A and B.
Execution of: A b = new B(); b.foo() will execute method foo() in
class A. That causes me a problem because if I use factory methods in
classes, for each subclass I need to reimplement the static factory
method. I was wondering how people solved this with or without
reflection (I am okay paying the performance toll at object creation).

2. I am trying to replicate the easy functionality of the
NSClassFromString method. Basically, if I have a string for a full
qualified class name, what is the best way to invoke a static method
with a known signature for that class.

In objective c:

Class foo()
        NSString *r = @"Bar";
        Class c = NSClassFromString(r);
        return c;

then you can call method sna() on class Bar with [foo() sna:d]

So far in Java using reflection, I came up with this convoluted code
that doesn't replicate the behavior for the parameters for the
function (I pass back the object reference, not the method back,
therefore I also have to pass the parameter to call the method):

static SuperClassOfBar foo(float d) {
        try {
            String r = "Bar";
            Class c = Class.forName("com.example."+r); // Fully
qualified name for class
            Class partypes[] = new Class[1];
            partypes[0] = Float.TYPE;
            Method m = c.getDeclaredMethod("sna", partypes);
            Object arglist[] = new Object[1];
            arglist[0] = d;
            Object o = m.invoke(null, arglist);
            return SuperClassOfBar.class.cast(o);
        } catch (Exception e) {
            return null;

It works but it's heavy and not pretty. I understand that leaving a
dynamic language like objective c , I have to make some compromises,
but I may miss something about Java for not having found something
more lightweight for such a generic programming functionality. Any
suggestions to simplify this implementation are welcome.

Thanks in advance.


3. Layout - Is there some way to do wraparound with horizontal linear layout

4. how can i save my overlays?

5. Motodev Studio for Android Dev?

6. Reminder: IRC office hours tomorrow

7. Loading entire Asset folder