In my attempt to make the sample ContactManager android application
work under JPF, I did the following:

I wrote a main method with this code:
    public static void main(String[] args)
    {
        ContactManager cm = new ContactManager();
        Intent i = new Intent();
        i.setComponent(new
ComponentName("ContactManager","com.example.android.contactmanager"));
        cm.startActivity(i);
    }

And then I tried to execute this class under JPF. But I got this
error:
java.lang.RuntimeException: Stub!
        at android.content.Context.<init>(Context.java:4)
        at android.content.ContextWrapper.<init>(ContextWrapper.java:5)
        at android.view.ContextThemeWrapper.<init>(ContextThemeWrapper.java:
5)
        at android.app.Activity.<init>(Activity.java:6)
        at com.example.android.contactmanager.ContactManager.<init>

and tracing this error, it is caused at the execution of the very
first statement:
ContactManager cm = new ContactManager();

Searching on the group led me to the following thread:
http://groups.google.com/group/android-developers/browse_thread/thread/a680b65f287e1b8c/caecec75f1b384f3?lnk=gst&q=+Stub!+%09#

The discussion here essentially says that the only way to test code
that uses Android API is on a device or emulator. So am I hitting a
dead end here, by trying to explore a way to test android application
(that certainly uses Android classes) under JPF, without running the
emulator in the JPF?

I would be happy if experienced folks can confirm whether it is
impossible to test android applications in another tool, without
running the emulator in that tool.


On Apr 11, 7:26 am, Amruta Gokhale <amruta.gokh...@gmail.com> wrote:
> Bump!
> Has anyone got ideas on this? Verifying android applications using
> Java path finder features as one of the topics of Google Summer of
> Code 2010 (though I am exploring a narrower version of this as a
> course project). So I am sure this is a problem worth a look!
>
> On Apr 8, 11:35 pm, Amruta <amruta.gokh...@gmail.com> wrote:
>
>
>
> > Hello,
>
> > I would be grateful if I get any suggestions about the feasibility of
> > a project that I am trying.
>
> > I am trying to test a sample android application using another tool,
> > namely, Java Path Finder(JPF), which is a open source model checker
> > for verifying programs and detecting errors in the program. (http://
> > babelfish.arc.nasa.gov/trac/jpf). What JPF does is that it explores
> > all the "interesting" paths of execution of a program, and checks
> > whether taking any of those paths would produce an error. To be able
> > to test a program in JPF, the program must be stand-alone program
> > having a "main" method.
>
> > Since I cannot run an android application as a stand-alone program, I
> > need to have another program that calls the application. I have doubts
> > about how this can be done.
>
> > I read that one can invoke an android application by calling
> > startActivity() on the right intent, but this is possible only for
> > applications that interact with other applications. Is there any way
> > to call any application (even those that do not interact with other
> > applications) from a stand-alone java program? Or in other words, is
> > it possible to start running an application other than on an emulator?
>
> > If the only way to run an android application in a tool like JPF would
> > be, by first running emulator in JPF, this is totally different from
> > what I am trying to achieve. Running an emulator in JPF would mean,
> > verifying whether the emulator code is producing any errors. But what
> > I am trying to achieve is much simpler : testing a single android
> > application to detect any errors. I hope there is some way out here!
>
> > Thank you for your inputs.
>
> > Amruta

-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en

To unsubscribe, reply using "remove me" as the subject.

Reply via email to