Hi  Karthikeyan R,

   I used your example in my android Testproject but i got some exception,
"java.lang.NoClassDefFoundError: com.android.chimpchat.adb.AdbBackend" Can 
you please tel me whats wrong i did?

Thanks
Arjun


On Wednesday, August 3, 2011 11:21:16 AM UTC+5:30, Karthikeyan R wrote:
>
> You can use shutdown() function from AdbBackend 
>
> On Aug 3, 3:06 am, Nitin Chhabra <[email protected]> wrote: 
> > Hi karthik, 
> > 
> > Thanks for the help. I am able to run Monkeyrunner using Java. 
> > But "device.dispose()", does not seem to work, it does not close the 
> > socket connection being made. 
> > 
> > Is there any way around to disconnect my MonkeyRunner from the 
> > device? 
> > 
> > On Aug 2, 2:41 am, CCN CCN <[email protected]> wrote: 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > > Hi Karthikeyan 
> > > I'm also trying to use monkeyrunner of Java, but running your example 
> > > I get an error: 
> > 
> > > 12:29:20 E/adb: Failed to get the adb version: Cannot run program 
> > > "adb": error=2, No such file or directory 
> > 
> > > Meaning the error is understandable, but I do not how to fix it znab. 
> > 
> > > I tried to fix the problem by connecting ddmlib in draft form and 
> > > directly in the code to set the path to the ADB but to no avail. The 
> > > application just freezes. 
> > 
> > > p.s. I'm sorry I do not know much English 
> > 
> > > On Aug 2, 11:34 am, Karthikeyan R <[email protected]> wrote: 
> > 
> > > > Hi Nithin, 
> > 
> > > > I missed your post that is the reason for delayed reply. 
> > 
> > > > Please use the below snippet  (Make sure to include monkeyrunner, 
> > > > ddmlib, jython, sdklib jars) 
> > 
> > > > import com.android.monkeyrunner.adb.AdbBackend; 
> > > > import com.android.monkeyrunner.core.IMonkeyDevice; 
> > > > import com.android.monkeyrunner.core.TouchPressType; 
> > 
> > > > public class sampleMonkey { 
> > 
> > > >  public static void main(String[] args) { 
> > > >     sampleMonkey monkey=new sampleMonkey(); 
> > > >     monkey.demo(); 
> > > >  } 
> > > >  public void demo() 
> > > >  { 
> > > >     AdbBackend adb = new AdbBackend(); 
> > > >     IMonkeyDevice device = adb.waitForConnection(); 
> > 
> > > >     // Actions should go here 
> > > >     device.touch(200, 200,TouchPressType.DOWN); 
> > 
> > > >     device.dispose(); 
> > > >  } 
> > 
> > > > } 
> > 
> > > > Thanks 
> > > > --Karthik 
> > 
> > > > On Jul 30, 1:53 am, Nitin Chhabra <[email protected]> wrote: 
> > 
> > > > > Hi Bill/Karthikeyan, 
> > 
> > > > > Can you please help me out as well in this regard. I am able to 
> runMonkeyRunnerusing Python Scripts on Windows 
> > > > > Platform. But I would like to use it in Java, as my test 
> application 
> > > > > is being 
> > > > > built in Java. I am usingMonkeyRunnerto automate things only. I 
> can 
> > > > > call my Python script using Java to runMonkeyRunner, but that is 
> not 
> > > > > a clean solution! 
> > 
> > > > > Karthik, can you please help me as you have mentioned that you 
> have 
> > > > > got that running. Can you please point me to some sample code as 
> well. 
> > 
> > > > > On Jun 28, 9:44 am, Karthikeyan R <[email protected]> wrote: 
> > 
> > > > > > Hi Bill, 
> > 
> > > > > > Thank you so much for pointing me to those links. 
> > 
> > > > > > It helps me a lot and now I can able use monkey runner from 
> java. 
> > 
> > > > > > This group is rocking . . . 
> > 
> > > > > > Thanks 
> > > > > > --Karthik 
> > 
> > > > > > On Jun 28, 2:19 am, Bill Napier <[email protected]> wrote: 
> > 
> > > > > > >MonkeyRunneractually has a small example of doing this in it's 
> own source 
> > > > > > > code: 
> > 
> > > > > > >
> http://android.git.kernel.org/?p=platform/sdk.git;a=blob;f=monkeyrunn... 
> > 
> > > > > > > IMonkeyBackend adb = new AdbBackend(); 
> > > > > > > IMonkeyDevice device = adb.waitForConnection(); 
> > 
> > > > > > > And you can see the IMonkeyDevice source here:
> http://android.git.kernel.org/?p=platform/sdk.git;a=blob;f=monkeyrunn... 
> > 
> > > > > > > And see that it has a bunch of methods on it like 
> "takeSnapshot", "touch", 
> > > > > > > "drag", etc. 
> > 
> > > > > > > Hopefully that's enough to get you started. 
> > 
> > > > > > > Bill 
> > 
> > > > > > > On Fri, Jun 24, 2011 at 7:27 PM, Karthikeyan R <
> [email protected]>wrote: 
> > 
> > > > > > > > Hi Bill, 
> > 
> > > > > > > > Thank you so much for sharing the information. 
> > 
> > > > > > > > we wanted to create a automation framework in java 
> havingMonkeyRunner 
> > > > > > > > as base. 
> > 
> > > > > > > > Could you give me one small sample using java, it will be 
> really 
> > > > > > > > helpful for us. 
> > 
> > > > > > > > To give you a context we wanted to automated the device as a 
> whole 
> > > > > > > > where we interact with multiple apk's  hope our choice of 
> monkey 
> > > > > > > > runner is right for that. 
> > 
> > > > > > > > Thank you in advance. 
> > 
> > > > > > > > Thanks 
> > > > > > > > --Karthik 
> > 
> > > > > > > > On Jun 24, 10:39 am, Bill Napier <[email protected]> 
> wrote: 
> > > > > > > > > If you mean from Java on the phone (like as part of an 
> application), then 
> > > > > > > > > the answer is no. 
> > 
> > > > > > > > > If you mean from Java on a computer, then the answer is 
> yes.  You just 
> > > > > > > > need 
> > > > > > > > > to make your java project depend on theMonkeyRunner.jar 
> and you can call 
> > > > > > > > > some of it's internal classes to do what you need. 
> > 
> > > > > > > > > We're in the middle of changing how the code is structured 
> to make this 
> > > > > > > > even 
> > > > > > > > > easier, but it's not quite ready yet. 
> > 
> > > > > > > > > On Wed, Jun 22, 2011 at 8:16 PM, Karthik <
> [email protected]> wrote: 
> > > > > > > > > > Hi, 
> > 
> > > > > > > > > > Is it possible to usemonkeyrunnerfrom java. 
> > 
> > > > > > > > > > If yes please let me know the approach. 
> > 
> > > > > > > > > > Thanks in advance 
> > 
> > > > > > > > > > Thanks 
> > > > > > > > > > --Karthik 
> > 
> > > > > > > > > > -- 
> > > > > > > > > > You received this message because you are subscribed to 
> the Google 
> > > > > > > > > > Groups "Android Developers" group. 
> > > > > > > > > > To post to this group, send email to 
> > > > > > > > [email protected] <javascript:> 
> > > > > > > > > > To unsubscribe from this group, send email to 
> > > > > > > > > > [email protected]<javascript:>
> > > > > > > > > >  
> > > > > > > > > > For more options, visit this group at 
> > > > > > > > > >http://groups.google.com/group/android-developers?hl=en 
> > 
> > > > > > > > -- 
> > > > > > > > You received this message because you are subscribed to the 
> Google 
> > > > > > > > Groups "Android Developers" group. 
> > > > > > > > To post to this group, send email to 
> [email protected] <javascript:> 
> > > > > > > > To unsubscribe from this group, send email to 
> > > > > > > > [email protected]<javascript:> 
> > > > > > > > For more options, visit this group at 
> > > > > > > >http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to