[android-developers] Re: Help designning the UI

2016-06-06 Thread Diego Torres Milano
Follow https://developer.android.com/design/material/index.html


On Sunday, 5 June 2016 07:16:02 UTC-4, Ventura wrote:
>
> Hello, I am trying to design a cool UI for my app, because it's really 
> ugly at the moment.
>
> How can I know what size will have my icons and what mobile should I 
> design by default? 
> I checked the documentation.. but I get lose with that things. 
>
> I was thinking that I need a kind of template of a mobile with his 
> dimesions in pixeles and his dp so I can export the icons to different 
> mobiles, is it right? I hope that someone can help me with this here :).
>

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/dbd7372e-c159-4f82-90a9-dcf7004ee9f7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: Question: Is there a way to inquire the port forwarding done by Android Studio?

2016-03-24 Thread Diego Torres Milano
Take a look at http://developer.android.com/reference/android/os/Debug.html


On Wednesday, 23 March 2016 22:45:34 UTC-4, Dato Da wrote:
>
> If Android Studio is running on my development machine, when I launch the 
> app on a device from the command line using this command:
>
> $ adb shell am start -D -n  -a ...
>
> Android Studio would immediately forward a port on the local host (8600 
> and up) to the jdwp port of the app, so that the debugger in Android Studio 
> could debug the app if necessary.
>
> Now, if, say, I would like to use a 3rd party debugger (rather than the 
> debugger in Android Studio) to debug the app, I will need to connect that 
> debugger to the port forwarded by Android Studio to that app to get the 
> debugging to work.
>
> *My question: How can I determine what that port is? *
>
> Here are a couple of things I've tried (to no avail):
> 1. $ adb forward --list
>   Alas, the forwarding done by Android Studio isn't shown.
> 2. $ adb forward tcp:9010 jdwp:
>   Connecting the debugger to 9010 failed, probably because the jdwp 
> port is already locked up by Android Studio's port forwarding.
> 3. I can turn on DDMS and see the port assigned to the app. But what I 
> need is an API or text output so that I can get that info programmatically?
>
> You insight would be appreciated.
>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/b4f4ba11-7a0a-4728-8f8d-3e9be224a922%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: MonkeyRunner.waitForConnection() can't get device with network

2016-02-17 Thread Diego Torres Milano
Try *AndroidViewClient/culebra* 
 that could connect to 
devices connected over the network (i.e. TV) with no problems.
If you want to just take screenshots `dump -f` (one of the tools included 
in the package) does just that.


On Wednesday, 17 February 2016 03:26:30 UTC-5, huang xin wrote:
>
> Hi,
>
> Now, i'm studying how to use the MonkeyRunner to test android devices. 
> There is an android tv set, enabled adbd, no usb debug port, but network 
> is available. I can use a following commend to connect this device with adb
>
> *adb connect 172.30.198.240.*
>
> List of devices attached
> 172.30.198.240:device
>
>
> Then i checked this connection that was successful.  i can use adb shell 
> command to login the tv.
>
>  i wrote a python script(called test.py) to test the MonkeyRunner.
>
> #Script start###
> *from com.android.monkeyrunner import MokeyRunner, MonkeyDevice*
>
> *device = MonkeyRunner.waitForConnection() # <---wait for ever*
>
> *if device is not None:*
> *device.takSnapshot()*
> ##Script END###
>
> after aboves done, i input the* monkeyrunner.bat test.py* in the dos 
> terminal of win7.
> the codes blockedt the MonkeyRunner.waitForConnection() for ever, and adb 
> server was killed.
>
> I also tried to use next method: *monkeyrunner.bat -s 172.30.198.240 
> test.py, *but failed again.
>
>
> Then i change  a phone with a usb debug port to connect my pc. Above 
> script ran ok.
>
> I don't know why, could you help me?
>
> thanks a lot
>
>
>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/9b01921e-fa87-4994-beb7-8b7526607665%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: How to take a screenshot from a background service?

2015-03-11 Thread Diego Torres Milano
If you can do it from a computer with AndroidViewClient/culebra (
https://github.com/dtmilano/AndroidViewClient) installed, `*culebra*` could 
generate a script for you that would look like (I've just edited it and 
added the while):

#! /usr/bin/env python
# -*- coding: utf-8 -*-
'''
Copyright (C) 2013-2014  Diego Torres Milano
Created on 2015-03-11 by Culebra v10.1.0
  ________
 /  \  /  \  /  \  /  \ 
/  __\/  __\/  __\/  __\_
___/  /__/  /__/  /__/  /
   | / \   / \   / \   / \   \___
   |/   \_/   \_/   \_/   \o \ 
   \_/--
@author: Diego Torres Milano
@author: Jennifer E. Swofford (ascii art snake)
'''


import re
import sys
import os


try:
sys.path.insert(0, os.path.join(os.environ['ANDROID_VIEW_CLIENT_HOME'], 
'src'))
except:
pass

from com.dtmilano.android.viewclient import ViewClient

TAG = 'CULEBRA'

_s = 5
_v = '--verbose' in sys.argv


kwargs1 = {'ignoreversioncheck': False, 'verbose': False, 
'ignoresecuredevice': False}
device, serialno = ViewClient.connectToDeviceOrExit(**kwargs1)
kwargs2 = {'startviewserver': True, 'forceviewserveruse': False, 
'autodump': False, 'ignoreuiautomatorkilled': True}
vc = ViewClient(device, serialno, **kwargs2)

while True:

vc.writeImageToFile('/tmp/screenshots/${serialno}-${focusedwindowname}-${timestamp}.png',
 
'PNG')
vc.sleep(4)


On Tuesday, 10 March 2015 08:04:27 UTC-4, Jonathan Chacón wrote:

 Hello, 

 I need to take a screenshot each four seconds and I thought to develop a 
 service with a timer to take the screenshot but I don't know how to take 
 the screenshot with a not root device. 

 I found ASL (Android Service Library) but I don't know how to include it 
 to install and start ASL from my App. 

 Any suggestion please? 

 Regards 
 Jonathan Chacón 



-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: Monkey Talk

2015-02-10 Thread Diego Torres Milano
What you describe seems easy to achieve in AndroidViewClient/culebra 
https://github.com/dtmilano/AndroidViewClient , even just using the GUI. 
You may need to tweak the spreadsheet part, but it will be even easier if 
you can export it to CSV.
Give it a try and ask for help here or 
at http://stackoverflow.com/questions/tagged/androidviewclient.


On Sunday, 8 February 2015 23:11:38 UTC-5, janvi wrote:

 Hello All,

 I'm new to monkey talk tool.Is the following feature supported in Monkey 
 Talk?

 I have an App which supports 5 languages(de,hu,da en,etc).Button names and 
 strings used in App are different for these languages.
 I need to test validation of these strings .I have an excel which contains 
 all the strings of the above languages mentioned.
 I want to check if the button has a label called hello in english and if 
 we change to danish lanuage in phone then hello is replaced by the 
 corresponding word in danish which is in excel.

 I want to validate and verify buuton label name with corresponding value 
 in excel(If xxx is the same as hello in danish then xxx which is displayed 
 in App should be similar to xxx which is under danish language in excel).Is 
 this possible??

 Can we do it using JAVA Script in monkey talk??

 Any help would be appreciated .
 Thanks in advance.


-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: monkeyrunner broken pipe exception

2014-06-30 Thread Diego Torres Milano
Give AndroidViewClient/culebra 
https://github.com/dtmilano/AndroidViewClient a try. It handles the 
device connection better.

On Sunday, 29 June 2014 23:48:43 UTC-4, wang nungchao wrote:

 Update: 
 My monkeyrunner script:

 import sys
 from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice

 device = MonkeyRunner.waitForConnection(1000,HT3CJPNA0647)
 device.wake()
 while 1:
 device.drag((400, 1400), (400, 400), 2, 10)
 MonkeyRunner.sleep(3)
 device.touch( 835, 1418, MonkeyDevice.DOWN)
 MonkeyRunner.sleep(0.7)
 device.touch( 834, 1417, MonkeyDevice.UP)
 

 The exception happen in device.drag

 wang nungchao於 2014年6月30日星期一UTC+8上午11時44分16秒寫道:

 My device is HTC butterfly
 In Android 4.1, it never happen, but Android 4.3 sometime will happen.

 I run the same monkeyrunner script, sometime it has broken pipe 
 exception, but sometime not.
 How can I fix this issue ? Or this is HTC or Android 4.3 issue ?

 The detail log:
 140630 11:27:11.088:S [main] [com.android.chimpchat.adb.AdbChimpDevice] 
 Error sending drag start event
 140630 11:27:11.088:S [main] 
 [com.android.chimpchat.adb.AdbChimpDevice]java.net.SocketException: Broken 
 pipe
 140630 11:27:11.088:S [main] [com.android.chimpchat.adb.AdbChimpDevice] 
 at java.net.SocketOutputStream.socketWrite0(Native Method)
 140630 11:27:11.088:S [main] [com.android.chimpchat.adb.AdbChimpDevice] 
 at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
 140630 11:27:11.088:S [main] [com.android.chimpchat.adb.AdbChimpDevice] 
 at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
 140630 11:27:11.088:S [main] [com.android.chimpchat.adb.AdbChimpDevice] 
 at sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:202)
 140630 11:27:11.088:S [main] [com.android.chimpchat.adb.AdbChimpDevice] 
 at sun.nio.cs.StreamEncoder.implFlushBuffer(StreamEncoder.java:272)
 140630 11:27:11.088:S [main] [com.android.chimpchat.adb.AdbChimpDevice] 
 at sun.nio.cs.StreamEncoder.implFlush(StreamEncoder.java:276)
 140630 11:27:11.088:S [main] [com.android.chimpchat.adb.AdbChimpDevice] 
 at sun.nio.cs.StreamEncoder.flush(StreamEncoder.java:122)
 140630 11:27:11.088:S [main] [com.android.chimpchat.adb.AdbChimpDevice] 
 at java.io.OutputStreamWriter.flush(OutputStreamWriter.java:212)
 140630 11:27:11.088:S [main] [com.android.chimpchat.adb.AdbChimpDevice] 
 at java.io.BufferedWriter.flush(BufferedWriter.java:236)
 140630 11:27:11.088:S [main] [com.android.chimpchat.adb.AdbChimpDevice] 
 at 
 com.android.chimpchat.ChimpManager.sendMonkeyEventAndGetResponse(ChimpManager.java:187)
 140630 11:27:11.088:S [main] [com.android.chimpchat.adb.AdbChimpDevice] 
 at com.android.chimpchat.ChimpManager.sendMonkeyEvent(ChimpManager.java:235)
 140630 11:27:11.088:S [main] [com.android.chimpchat.adb.AdbChimpDevice] 
 at com.android.chimpchat.ChimpManager.touchDown(ChimpManager.java:88)
 140630 11:27:11.088:S [main] [com.android.chimpchat.adb.AdbChimpDevice] 
 at com.android.chimpchat.adb.AdbChimpDevice$2.start(AdbChimpDevice.java:575)
 140630 11:27:11.088:S [main] [com.android.chimpchat.adb.AdbChimpDevice] 
 at 
 com.android.chimpchat.adb.LinearInterpolator.interpolate(LinearInterpolator.java:118)
 140630 11:27:11.088:S [main] [com.android.chimpchat.adb.AdbChimpDevice] 
 at com.android.chimpchat.adb.AdbChimpDevice.drag(AdbChimpDevice.java:556)
 140630 11:27:11.088:S [main] [com.android.chimpchat.adb.AdbChimpDevice] 
 at com.android.monkeyrunner.MonkeyDevice.drag(MonkeyDevice.java:174)
 140630 11:27:11.088:S [main] [com.android.chimpchat.adb.AdbChimpDevice] 
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 140630 11:27:11.088:S [main] [com.android.chimpchat.adb.AdbChimpDevice] 
 at 
 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 140630 11:27:11.088:S [main] [com.android.chimpchat.adb.AdbChimpDevice] 
 at 
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 140630 11:27:11.088:S [main] [com.android.chimpchat.adb.AdbChimpDevice] 
 at java.lang.reflect.Method.invoke(Method.java:597)
 140630 11:27:11.088:S [main] [com.android.chimpchat.adb.AdbChimpDevice] 
 at 
 org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:186)
 140630 11:27:11.088:S [main] [com.android.chimpchat.adb.AdbChimpDevice] 
 at org.python.core.PyObject.__call__(PyObject.java:345)
 140630 11:27:11.088:S 



-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For 

[android-developers] Re: Is there a way to use the emulator on the console?

2014-04-28 Thread Diego Torres Milano
Use *-no-window* (disable graphical window display) argument and you can 
use if from command line (i.e. adb shell).

On Monday, 28 April 2014 04:17:46 UTC-4, Thorsten Jolitz wrote:

 Nikolay Elenkov nikolay...@gmail.com javascript: writes: 

  On Sun, Apr 27, 2014 at 11:41 PM, Thorsten Jolitz 
  tjo...@gmail.comjavascript: 

  wrote: 
  
  
  
  Since I like to work on the console (without X11) I ask myself if there 
  is any way to use the emulator from the console? Most likely not, but I 
  thought I ask anyway ... thanks for any hints. 
  
  
  Run the emulator on a different machine and connect using TCP. 
  Or, better yet, develop on a real device. 

 The latter is probably the way to go, thanks. 

 -- 
 cheers, 
 Thorsten 



-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: NAF Nodes

2013-04-25 Thread Diego Torres Milano
You didn't mention how you want to access these nodes.
If you are creating tests give 
AndroidViewClienthttps://github.com/dtmilano/AndroidViewClient and 
culebra https://github.com/dtmilano/AndroidViewClient/wiki/culebra a 
shot. They could generate *unique IDs* that may help you accessing them.


On Wednesday, 17 April 2013 07:59:34 UTC-4, Anuj Dewan wrote:

 Hi,

 I am using NAF in my application and i want to access these NAF 
 button(through UI) but can't access them.

 I saw the below documentation, where it is explained we can not access, 
 NAF components 

 Optionally, click on the *Toggle NAF Nodes* button to see UI components 
 that are not accessible to the uiautomatortesting framework. Only limited 
 information may be available for these components.

 Could you please recommend someway, how i can access it or any workaround 

 I have attached the NAF component that i need to access.

 Thanks,
 Anuj





-- 
-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[android-developers] Re: how to read screen data on Android

2012-11-16 Thread Diego Torres Milano
Just use:

*$ adb shell screencap -p /mnt/sdcard/sc.png*
*$ adb pull /mnt/sdcard/sc.png*

and you'll get the screenshot as PNG.


On Friday, 16 November 2012 11:20:14 UTC-5, bob wrote:

 I'm pretty sure this doesn't work for the Google Nexus 7.


 Even with the Android screen practically all black, I loaded 
 the screenshot data into IrfanView, and it looked like a bunch of 
 random-ish junk all over.



 On Thursday, November 15, 2012 8:56:09 PM UTC-6, lbendlin wrote:

 The framebuffer has two screens worth of data, stacked vertically. You 
 can use Irfanview to look at the data and find the actual dimensions.

 On Thursday, November 15, 2012 4:14:12 PM UTC-5, bob wrote:

 I'm trying to figure out how to read screen data on Android:

 So, I did this on Google Nexus:

 cat /dev/graphics/fb0  hmm

 Then, I looked at the file hmm:

 -rw-rw-rw- root root  9437184 2012-11-15 15:05 hmm

 I was hoping the size would be something like 1280*800*4, or 4,096,000.

 But, it's 9,437,184.

 Groan.

 Any idea what format this could be in?

 Thanks.



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

[android-developers] Re: use monkeyrunner in windows7,the exception,[com.android.chimpchat.adb.AdbChimpDevice]java.net. SocketException: Software caused connection abort: recv failed

2012-11-07 Thread Diego Torres Milano
It looks like a bug...

On Wednesday, 7 November 2012 02:29:42 UTC-5, lincoln wrote:

 Sorry! I'm not sure the problem is a bug,so i post it here.

 You mean i should to add a new bug?

 Thank you!

 On Wednesday, November 7, 2012 3:04:38 PM UTC+8, Diego Torres Milano wrote:

 See http://source.android.com/source/life-of-a-bug.html



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

[android-developers] Re: use monkeyrunner in windows7,the exception,[com.android.chimpchat.adb.AdbChimpDevice]java.net. SocketException: Software caused connection abort: recv failed

2012-11-06 Thread Diego Torres Milano
See http://source.android.com/source/life-of-a-bug.html


On Tuesday, 6 November 2012 10:54:11 UTC-5, lincoln wrote:

 The running environment:win7,USB hub,monkeyrunner
 The problem details:Use monkeyrunner to run python scripts to control my 
 devices(the devices connected to computer through usb hub,the devices's 
 number is more than 5,one monkeyrunner process to control one device),after 
 a few hours later,there may be the 
 exception([com.android.chimpchat.adb.AdbChimpDevice]java.net. 
 SocketException: Software caused connection abort: recv failed).I have 
 checked the device's logcat log,sometimes when the exception,the log will 
 contain the information of /MonkeyStub():connection dropped.I'm sorry for 
 my poor english,but i need your help.

 Thank you!


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

[android-developers] Re: can adb server connect to adbd on the same device?

2012-10-29 Thread Diego Torres Milano
adb is already installed (at least in Jelly Bean).

*root@android:/ # type adb*
*adb is /system/bin/adb*


On Saturday, 27 October 2012 05:03:52 UTC-4, mylz wrote:

 In normal usage, adb works on host, like PC, and adbd works on device. 
 They communicate with each other by USB or TCP mode.
 Now my question is that I compiled the adb for arm,and push it into the 
 device, where adbd exists, how can adb communicates with adbd?

 many THANKS for anyone who can help me.:)
  


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

Re: [android-developers] Re: How to get a button id from an app(I don't have the source)

2012-10-17 Thread Diego Torres Milano
You mentioned you don't have the source, so we assume it's not your APK, 
then Instrumentation won't work because both packages must be signed by the 
same key otherwise you'll receive a SecurityException.
I don't know what do you want the id for, but using AndroidViewClient 
[https://github.com/dtmilano/AndroidViewClient] you can easily get the dump 
of the View tree and get Ids an other properties.


On Wednesday, 17 October 2012 06:48:47 UTC-4, srikanth wrote:

 Hi Kris, 
 How you will do/get these things via instrumentation? 

 On Wed, Oct 17, 2012 at 7:40 AM, Kristopher Micinski 
 krismi...@gmail.comjavascript:
  wrote:

 Umm

 slight disagree

 I do this all the time in instrumentation.

 kris

 On Tue, Oct 16, 2012 at 8:14 AM, Dhruv Kumar 
 dhru...@gmail.comjavascript: 
 wrote:
  Without Application you can't get the id . By the way you can get id e.g
  text = (TextView)findViewById(R.id.text); where id mention in xml file.
 
 
  On Tuesday, October 16, 2012 6:55:11 AM UTC-4, srikanth wrote:
 
  Hi,
 
  I want to get the element/button id in an app(I don't have the apk).. 
 can
  any one please tell me on how to get the id?
 
  Thanks
 
  --
  You received this message because you are subscribed to the Google
  Groups Android Developers group.
  To post to this group, send email to 
  android-d...@googlegroups.comjavascript:
  To unsubscribe from this group, send email to
  android-developers+unsubscr...@googlegroups.com 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 
 android-d...@googlegroups.comjavascript:
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com javascript:
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en




 -- 
 Thanks  Regards,
 M.Srikanth Kumar.
  

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

[android-developers] Re: Insert data using SQLite Database with Insert + Where Clause after already entered data in next colums!

2012-07-26 Thread Diego Torres Milano
Also  INSERT INTO+TABLE would not have the required whitespace (unless 
TABLE starts with a space)

On Thursday, 26 July 2012 07:30:08 UTC-4, RichardC wrote:

 http://www.sqlite.org/lang_insert.html 

 On Tuesday, July 24, 2012 2:06:50 PM UTC+1, vikalp patel wrote:

 I would like to Insert data in my next columns of TABLE with help of 
 Signup2Activity which has been already inserted by SIgnup1Activity.java. 
 HereBy i had attached all the necessary file to find the error.

 ERROR: Database: near Where: near INSERT INTO+TABLE+ ( +columns+) 
 VALUES (+first.getText().toString()+) WHERE +ID+ =+ id;

 how can we insert data in next columns of database with already entered 
 data in their first few columns??

 ANy help is most welcome!! 



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

[android-developers] Re: adb devices is showing the device as offline.what is reason? How can i switch the device from online - offline viceversa?

2012-07-23 Thread Diego Torres Milano
You can leave a shell open (which perhaps prevents being disconnected) in a 
window and then run the monkey scripts on another window.

On Wednesday, 18 July 2012 03:00:45 UTC-4, Sreedhar Reddy V wrote:

 Hi

 I connected My android ICS device to my windows PC using USB.

 I executed adb devices from my pc. 

 The output
 ---
 List of devices attached
 id   device
 ---


 After a long time of say 12 hours, i ran the same command adb devices 
 from my pc.

 The output
 ---
 List of devices attached
 id   offline
 ---

 I am not sure what went wrong. i did not even touch my pc, and my device.
 I made settings in my PC so that it will never sleep.
 I am running monkey scripts which wont make android device to lock as well.

 Many people said that ur device is offline because adbd deamon is not 
 running on android device. 
 But this is wrong, why because if adbd is not running then the device will 
 not be listed at all.


 I came across adbd deamon process which will be running on my android 
 device.
 For my device to get detected by adb(server on my pc)  adbd must be 
 running.

 I went to adb shell
 I stopped adbd using the command stop adbd
 This stopped my adbd deamon on android device.because adbd is stopped mt 
 adb(server on my pc will not detect my device)
 Now adbd is not running, I execute the adb devices command the output 
 is, list of devices with empty list.
 The output
 ---
 List of devices attached
 ---

 because the device it self is not detected i cannot log in to adb shell 
 again to start adbd  adbd deamon on my device.
 so I shutdown and rebooted my android device, this made my adbd deamon to 
 run again.

 Now when i executed adb devices on my PC
 The output
 ---
 List of devices attached
 id   device
 ---


 By seeing this output it is very clear that adbd deamon is running on 
 device, because if adbd is not running then the device will not be listed 
 at all.

 Now the question is?
 what is the reason for the device to go to offline? (i am very sure that 
 adbd deamon not running  is not at all a reason for this.)
 How can i switch the device from online - offline viceversa?

 I am very very thank full to any android expert who solve my confusion. 



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

[android-developers] Re: problem running Monkeyrunner script in ubuntu

2012-06-05 Thread Diego Torres Milano
You can do as Mark suggested or you can use a 
shebanghttp://en.wikipedia.org/wiki/Shebang_(Unix)line at the beginning  of 
your script, use either

#! /usr/bin/env monkeyrunner

or

#! /path/to/your/monkeyrunner

depending on whether PATH contains android tools directory or not.
Set the execution bit on your script

$ chmod +x your-script

and execute it

$ ./your-script



On Monday, 4 June 2012 06:17:40 UTC-4, Amey Bapat wrote:

 HELLO PEOPLE, 
  well i have wriiten a sample python script in my eclipse. 
 now i need to run it on my emulator. 
 this is whr i am getting stuck.. 
 dis is the blog i followed to make it work 
 http://goravsingal.hubpages.com/hub/Android-UI-Automation-with-Python 
 where dey say this is to be done.. 

 Open shell prompt (cmd.exe, or terminal) 

 - Type absolute path of monkeyrunner followed by path of python script 

 example: c:\\Program Files\\Android\\android-sdk\\tools\ 
 \monkeyrunner.bat C:\\sample.py 

 did not work out for me.. 
 i am using ubuntu.. 
 not sure what exactly is to be done..

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

[android-developers] Re: Testing with ActivityInstrumentationTestCase

2012-05-28 Thread Diego Torres Milano
Provide the intent to startActivity().

On Monday, 21 May 2012 16:23:25 UTC-4, Marco@worldcorp wrote:

 Hi all 
  i am trying to  write some tests for my Android Application 
 I have couple of tests which extends ActivityInstrumentationTestCase2 
 and runs just fine. 

 I wanted then to test one of my Activities in isolation.. 
 so i wrote a test which extends ActivityUnitTestCase 

 THis is my test 

 @MediumTest 
 public void testPrecondition() { 
 Bundle savedInstanceState = new Bundle(); 
 savedInstanceState.putSerializable(BudgetDbAdapter.TRIP_ID, 
 tripId); 
 
 savedInstanceState.putSerializable(BudgetDbAdapter.TRIP_AMOUNT, 

 tripAmount); 
 startActivity(null, savedInstanceState, null); 
 Assert.assertNotNull(getActivity()); 

 } 

 But i cannot manage to run it. 

 Whenever i run my test project as  Android JUnit Test, all the test 
 extending ActivityInstrumentationTestCase2 ran, while the one 
 extending ActivityUnitTestCase doesn't. 

 Could anyone explain me how can i run a test which extends 
 ActivityUnitTest? 

 Is it supposed to run in the emulator? 

 w/kindest regards 
marco 





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

Re: [android-developers] ICS don't give you a real multitasking.

2012-05-16 Thread Diego Torres Milano
But fortunately, because Linux and Android are Open Source Software, if you 
think they are wrong somewhere you can fix them.
Feel free to provide a better multitasking.

On Wednesday, 16 May 2012 13:38:56 UTC-4, Kristopher Micinski wrote:

 On Wed, May 16, 2012 at 8:39 AM, sblantipodi 
 perini.dav...@dpsoftware.org wrote: 
  As title. 
  After using more than one ICS device I'm convinced that the 
  multitasking offered by ICS is not a real multitasking. 
  
  I well know this graph: 
  http://developer.android.com/images/activity_lifecycle.png 
  
  This is good, but how this graph is implemented is horrible. 
  On a galaxy nexus with 1GB of RAM, you can't open four different fart 
  apps that the first one opened is restarted. 
  
  I can multitask many more apps on my older symbian with 128MB of RAM 
  than on my galaxy nexus with 1GB of RAM. 
  
  The system that manage memory in ICS is broken, I hope that google 
  will fix this problem soon. 
  

 Not real multitasking, huh? 

 That's funny... 

 I guess that few hundred of thousand lines of scheduling code in the 
 Linux kernel that Android is built atop has some major bugs, huh... 

 Hmm... I thought Linux had multitasking since 1990... But apparently 
 this is untrue. 


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

[android-developers] Re: Need Help with Android Monkey

2012-04-05 Thread Diego Torres Milano
It seems that monkey tries to log the events to scriptlog.txt in the 
external storage directory and it's not optional.

On Thursday, 5 April 2012 03:19:01 UTC-4, naieem.khan wrote:

 Hi, 

 I need help with android monkey. I am using sdk version 4.0.3, API 15. 

 I am getting the same error/warning in every section. The error is as 
 follows: 

 java.io.FileNotFoundException: /mnt/sdcard/scriptlog.txt: open failed: 
 EROFS (Read-only file system) 

 I don't have any sd card mounted, and infact the above mentioned 
 folders do not exist! I have no idea why the monkey is trying to read 
 file from that location. 

 I think there is a problem somewhere, can you tell me how to solve 
 this? 

 I am attaching the result for the following command, [our project 
 package is android.se1 and I executed for seed (2 in this case]. The 
 command is as follows: 

 adb shell monkey –p android.se1 -s 2 –v 500 

 The results: 

 :Monkey: seed=2 count=500 

 :AllowPackage: android.se1 

 :IncludeCategory: android.intent.category.LAUNCHER 

 :IncludeCategory: android.intent.category.MONKEY 

 // Event percentages: 

 //   0: 15.0% 

 //   1: 10.0% 

 //   2: 2.0% 

 //   3: 15.0% 

 //   4: 25.0% 

 //   5: 15.0% 

 //   6: 2.0% 

 //   7: 2.0% 

 //   8: 1.0% 

 //   9: 13.0% 

 :Switch: 
 #Intent;action=android.intent.action.MAIN;category=android.intent.category.LAUNCHER;launchFlags=0x1000;component=android.se1/.MavBulletinActivity;end
  


 // Allowing start of Intent { act=android.intent.action.MAIN 
 cat=[android.intent.category.LAUNCHER] 
 cmp=android.se1/.MavBulletinActivity } in package android.se1 

 java.io.FileNotFoundException: /mnt/sdcard/scriptlog.txt: open failed: 
 EROFS (Read-only file system) 

 java.io.FileNotFoundException: /mnt/sdcard/scriptlog.txt: open failed: 
 EROFS (Read-only file system) 

 java.io.FileNotFoundException: /mnt/sdcard/scriptlog.txt: open failed: 
 EROFS (Read-only file system) 

 :Sending Trackball (ACTION_MOVE): 0:(4.0,-2.0) 

 java.io.FileNotFoundException: /mnt/sdcard/scriptlog.txt: open failed: 
 EROFS (Read-only file system) 

 java.io.FileNotFoundException: /mnt/sdcard/scriptlog.txt: open failed: 
 EROFS (Read-only file system) 

 java.io.FileNotFoundException: /mnt/sdcard/scriptlog.txt: open failed: 
 EROFS (Read-only file system) 

 ... 

 In the end, 

 Events injected: 500 

 :Dropped: keys=2 pointers=3 trackballs=0 flips=0 

 ## Network stats: elapsed time=41123ms (41123ms mobile, 0ms wifi, 0ms 
 not connected) 

 // Monkey finished 


 I have attached the results for only one command, because rest of the 
 commands show the same exception like above. 

 Please give me some suggestions. I have an assignment due this monday. 

 Thanks

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

[android-developers] Re: Android instrumentation testing, how to start with clean database all the time

2012-03-22 Thread Diego Torres Milano
This may give you some 
ideas: http://dtmilano.blogspot.ca/2009/12/android-testing-contentprovider.html


On Wednesday, 21 March 2012 04:26:56 UTC-4, Dirk Vranckaert wrote:

 I'm testing my application with Android Instrumentation tests.

 So I have a test-class extending  ActivityInstrumentationTestCas​e2 which 
 contains multiple tests. The code looks like this: 
 http://pastebin.com/​0Di3Hwug http://pastebin.com/0Di3Hwug 

 So the activity which is under test has a list of projects. The list of 
 projects is retrieved from the database. And when no database is available, 
 so when the DB is created, I insert one default project.

 What I want it to do is to delete the database before every test is run 
 (that's why I have the delete in the setUp() method), and so  if there is 
 no database available the onCreate for the database should be called on 
 creation of my activity (when loading the list of projects).

 What it does, it deletes the DB, it creates the DB, then runs my first 
 test, then it deletes the DB, but does not create it, and runs the second 
 test.

 In the test that is first run, I create (add) a project to the DB. In the 
 second test, as I delete the DB, I don't want to see that project anymore 
 but it's there!! No idea how that can happen but it seems that the 
 instrumentation tests are keeping a DB instance in memory...
 Or even an instance of the activity? Because when I put a breakpoint in 
 the onCreate of my activity I only get there once for both the tests...

 For the maintaining the DB I use ORMLite. You can see my helper class 
 here: 
 http://code.google.com/​p/worktime/source/browse/​trunk/android-app/src/eu/​vranckaert/worktime/dao/utils/​DatabaseHelper.javahttp://code.google.com/p/worktime/source/browse/trunk/android-app/src/eu/vranckaert/worktime/dao/utils/DatabaseHelper.java

 So how can I work around this or is there another way to achieve what I 
 want?


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

[android-developers] Re: Possible to detect Menu key press, outside an activity?

2012-03-16 Thread Diego Torres Milano
The home screen is an Activity...
If you want to change how the MENU key is processed you can intercept it in 
PhoneWindowManager as it's done for HOME, but this is only possible if you 
write your own firmware.

On Wednesday, 14 March 2012 17:55:11 UTC-4, Olaf wrote:

 So, I know that the Menu key is going away in 3.0, but I have an optional 
 feature in mind for pre-3.0 devices.  It relies on detecting a press of the 
 Menu key, outside of my activities (from the home screen, for example).  
 I've searched far and wide for a solution, and it seems that the Menu key 
 can only be detected by using the KeyEvent methods within the Activity 
 class (onKeyDown, etc).  But those methods only function when the activity 
 is in focus.

 Before I give up on this feature, does anyone have ideas on how it can be 
 done?  Or let me know if it definitely can't.  Thanks!


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

[android-developers] Re: I can see created text file using adb shell but not in PC when mounted?

2012-03-16 Thread Diego Torres Milano
Because the sdcard is not mounted in /sdcard but in /mnt/sdcard, perhaps...

On Wednesday, 14 March 2012 05:38:18 UTC-4, perumal316 wrote:

 Hi All,


In my application, I will be creating a log file (text file) in the 
 /sdcard of the device.

 Using adb shell, if I navigate to the /sdcard directory, I could see the 
 created text file and by doing a cat I could read the contents 

 But if I mount the device and navigate to the drive, the file is not 
 visible there.

 Any idea why?

 Thanks In Advance, 

 Perumal 



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

[android-developers] Re: UML tool for Android?

2012-02-27 Thread Diego Torres Milano
No android specific by I have been using BOUML (http://www.bouml.fr/)
and it works.
However, if you want round trip integration, it might not be the tool.

On Feb 27, 4:50 am, sniper sniper260...@gmail.com wrote:
 Balsamiq Mockups has nothing to do with UML..

 On 27 Feb., 03:04, Li Qing study.qing...@gmail.com wrote:







  Balsamiq Mockups ,a good tool for ui design

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


[android-developers] Re: Help! Monkeyrunner Press and Touch event

2012-02-18 Thread Diego Torres Milano
I couldn't reproduce the problem with either 2.3 and 4.0 emulators.
Perhaps there's something in the part you removed from your code.
And move the line
   HV = D.getHierarchyViewer() 
outside of the loop.

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

[android-developers] Re: How to test Activity, which is run in the separate process (android.process=:process in the manifest file)

2012-01-17 Thread Diego Torres Milano
Just remove the process attribute from your manifest while testing and
re-enable it when exporting a production APK. Probably you have to
remove others as well (i.e. debuggable), so why bother.

On Jan 17, 2:03 am, Kristopher Micinski krismicin...@gmail.com
wrote:
 Just out of interest, what do you mean by 'test?'

 Do you mean, run in eclipse with the 'test' functionality in that IDE?
  Or perhaps you mean under something like monkeyrunner..

 Depending on what you want to test, I don't see what your problem is,
 which I suspect is why few people responded.

 True, if something is running in a separate process it's not as easy
 to debug it, you could always attack a debugger to the other process,
 but this isn't a bug in Android, per se.

 P.s., there have been so many people on this list lately with here,
 I've found an obvious bug in android that doesn't really make sense,
 please think deeply before you blame a highly trusted framework
 (/system/framework/etc...)

 On Tue, Jan 17, 2012 at 1:54 AM, Yahor Paulavets







 ypaulav...@agilefusion.com wrote:
  Anyone?

  On Tue, Jan 10, 2012 at 5:12 PM, Yahor Paulavets
  ypaulav...@agilefusion.com wrote:

  Hello,

  After the week of hard workaround I didn't find any possible solution to
  test Activity if it is run with specified android.process=:process param
  (private, isolated process).

  Please help to find any possible solution to understand how to test such
  Activities.

  Is it Android bug, that Activities in the separate process are not
  testable? :(

  Any help is highly appreciated.

  Best regards,
  Yahor

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

--
Have you read my blog ?
http://dtmilano.blogspot.com
android junit tests ui linux cult thin clients

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


[android-developers] Re: Android unit testing with ContentProviders and databases

2012-01-01 Thread Diego Torres Milano
The best solution is probably a RenamingDelegatingContext, that will
allow your tests to use a different database than your 'live' one.
There are examples of RenamingDelegatingContext and other mock
injections in Android Application Testing Guide [http://
www.packtpub.com/android-application-testing-guide/book].

On Dec 31 2011, 2:20 am, Stephan Wiesner testexpe...@googlemail.com
wrote:
 I guess you gave the obvious answer yourself: Don't hardcode the name.
 Use a variable, maybe a system setting or something from a config file
 that can be accessed by all your apps and put an if/else block in your
 provider

 Greetings from Berne,
 Stephan

 On 31 Dez., 01:05, barry barry.drinkwa...@gmail.com wrote:







  I have an app that uses a ContentProvider to serve data instead of
  directly accessing the database. The application is working as
  expected but I have a problem with unit tests: how can I force the
  ContentProvider to use a test database rather than a 'live' one? If I
  wasn't using a ContentProvider I could pass a different database name
  to the Constructor of my `SQLiteOpenHelper` sublass, but now the
  database is created with a call to onCreate() in my ContentProvider:

          @Override
          public boolean onCreate()
          {
                  UKMPGDataProvider.init(getContext(), 
  Constants.DATABASE_NAME);
                  return (UKMPGDataProvider.getWritableDatabase() == null) ? 
  false :
  true;
          }

  As you can see, the database name is hardcoded.

  Is there a way to pass a test name into the ContentProvider?

--
Have you read my blog ?
http://dtmilano.blogspot.com
android junit tests ui linux cult thin clients

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


[android-developers] Re: Android monkey feature ? : adb shell monkey -p com.asus.davinci.medianote -v 500 --hprof

2011-12-12 Thread Diego Torres Milano
See my answer at 
http://stackoverflow.com/questions/8351329/android-monkey-not-generating-hprof-dump/8433740#8433740
AFAIU, --hprof should be removed from monkey.

On Dec 5, 11:43 pm, MobileScorpio tsai.scor...@gmail.com wrote:
 Dear Android Developers,

 About Android Monkey 
 Feature:http://developer.android.com/guide/developing/tools/monkey.html
 ...
 Command Options Reference
 The table below lists all options you can include on the Monkey
 command line.
 Category        Option  Description
 ...
 Debugging --hprof      If set, this option will generate profiling
 reports immediately before and after the Monkey event sequence. This
 will generate large
                                (~5Mb) files in data/misc, so use with
 care. See Traceview for more information on trace files.

 When I type adb shell monkey -p com.asus.davinci.medianote -v 500 --
 hprof in Android 3.2 (Honeycomb), there is no any new file in  data/
 misc.
 But I configure the system root authority  and data/misc is world-
 writable by default.

 Is this feature monkey --hprof disabled ? If not,  what possible
 configuration problems ocurr ?

 BR,
 Benjamin
--
Have you read my blog ?
http://dtmilano.blogspot.com
android junit tests ui linux cult thin clients

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


[android-developers] Re: Is useful testing actually possible?

2011-12-05 Thread Diego Torres Milano
CTS (http://source.android.com/compatibility/cts-intro.html) features
thousands of tests (literally). I'm sure you will find the examples
you are looking for.

On Dec 4, 2:11 am, Doug beafd...@gmail.com wrote:
  I think this goes some way to explaining why there are many bad
  practices in the Android examples and the API itself.

 Care to share an example of bad practice from the Android core API?

  Are we going to start seeing some tests being provided with these
  example apps?

 Sample apps typically exist to demonstrate how to use an API, not how
 to use an API and then test it.  I've shipped SDKs with sample code
 but none with unit tests for the sample app itself, because it just
 isn't worthwhile.  The consumer can unit test their own stuff if they
 want.  The sample apps just show how to get work done, not how to
 prove that the scaffolding works as intended.

 Do you have a counter example of a sample app for any API that unit
 tests itself independently of the APIs that it demos?

 Have you investigated any literature or tutorials on Android unit
 testing?

 Doug

--
Have you read my blog ?
http://dtmilano.blogspot.com
android junit tests ui linux cult thin clients

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


[android-developers] Re: TFTP (Trivial File Transfer Protocol) support

2011-11-11 Thread Diego Torres Milano
Are you trying to network boot Android in a similar way as PXE/EFI
does ?
If this is the case you won't be using Android SDK.

On Nov 11, 12:12 am, petr.maza...@mautilus.com
petr.maza...@mautilus.com wrote:
 Well, good question actually!! I will check if this is available.

 The reason why I am asking for TFTP is that (according to
 specification) our client is used in the internal network only. It
 broadcast the DHCPINFORM (IETF extension to the legacy DHCP). The DHCP
 returns back the TFTP address for downloading the set of
 configurations. But it might be that the some http server is running
 there as well. The DHCPINFORM/TFTP is pretty standard way how the
 Linux OS boots from network, so the idea was to reuse this for other
 purposes. Not that normally we will use DNS, but it has limited
 configuration options, basically supports only domain name to port
 resolving and even port cannot be obtained this way as far as I know.

 Regards,
 STeN

 On Nov 9, 6:10 pm, Diego Torres Milano dtmil...@gmail.com wrote:







  Why don't you just use HTTP ?

  On Nov 9, 1:41 am, petr.maza...@mautilus.com

  petr.maza...@mautilus.com wrote:
   According to my information the SDK does not support directly the
   TFTP.

   Are the any other ways how to deal with the missing API? Was anybody
   tried to use org.apache.commons.net.tftp? Are there any experiences
   how difficult is to run this on Android?

   Any other GPL solutions for TFTP?

   Thanks, STeN

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


[android-developers] Re: TFTP (Trivial File Transfer Protocol) support

2011-11-09 Thread Diego Torres Milano
Why don't you just use HTTP ?

On Nov 9, 1:41 am, petr.maza...@mautilus.com
petr.maza...@mautilus.com wrote:
 According to my information the SDK does not support directly the
 TFTP.

 Are the any other ways how to deal with the missing API? Was anybody
 tried to use org.apache.commons.net.tftp? Are there any experiences
 how difficult is to run this on Android?

 Any other GPL solutions for TFTP?

 Thanks, STeN

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


[android-developers] Re: How to send DHCPINFORM request

2011-11-09 Thread Diego Torres Milano
Not from the SDK

On Nov 9, 12:28 am, petr.maza...@mautilus.com
petr.maza...@mautilus.com wrote:
 Is it possible to send manually the DHCPINFORM request? I was
 searching the SDK and I did not found any class that allows creating
 and broadcasting the DHCPINFORM (see RFC 2131) request.

 Might be there is some Java implementation, which can be ported to the
 Android.

 Kind Regards,
 STeN

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


[android-developers] Re: Using chimpchat

2011-11-09 Thread Diego Torres Milano
See 
http://stackoverflow.com/questions/8058822/can-i-write-java-code-that-uses-monkeyrunner/8075856#8075856


On Nov 8, 7:54 pm, Misha mshash...@gmail.com wrote:
 Did you ever figure out how to use this? I am trying to do the same.

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


[android-developers] Re: Play content of phone on PC browser

2011-11-03 Thread Diego Torres Milano
Mount the device using USB connector and the access the files using
file:// schema.

On Nov 3, 12:45 am, Sunil Mishra suniljmis...@gmail.com wrote:
 Hi Summers,

 I am trying to play the content of phone in PC's Web browser.

 I am able to list down the contents that are available on the phone,
 but the URI associated with those content is of content://  type. And
 PC's Web browser is unable to understand that protocol.

 On Nov 2, 5:47 pm, Summers Pittman ℝ second...@gmail.com wrote:







  Why is it urgent?

  When you ask about the web browser, are you referring to the phone's web
  browser or the web browser on a PC playing content off the phone?

  Why can't you play media from the application listing files?

  Summers Pittman

  Phone:912 293 2314
  Java is my crack.
  On Wed, Nov 2, 2011 at 6:11 AM, Sunil Mishra suniljmis...@gmail.com wrote:
   Hi,

   I have developed a app that lists all the available media files on the
   phone.

   But i am unable to play that content on web browser. Any way to do
   this?

   Please help, its urgent.

   --
   You received this message because you are subscribed to the Google
   Groups Android Developers group.
   To post to this group, send email to android-developers@googlegroups.com
   To unsubscribe from this group, send email to
   android-developers+unsubscr...@googlegroups.com
   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 android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: How to launch an instance of Android emulator with a specified URL?

2011-11-01 Thread Diego Torres Milano
From the command line you can use:

$ adb shell am start -W -a android.intent.action.VIEW -d 
http://dtmilano.blogspot.com

On Oct 30, 3:41 am, TreKing treking...@gmail.com wrote:
 On Wed, Oct 26, 2011 at 8:03 PM, JustAnotherDev 
 thaodoan00s...@gmail.comwrote:

  Do you know how I can start the Android emulator with a specified URL?

 Create a simple app that listens to the Boot complete action and starts a
 view intent on the URL.

 --- 
 --
 TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
 transit tracking app for Android-powered devices

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


[android-developers] Re: Android 4.0 Emulator crashing (emulator-arm.exe)

2011-10-20 Thread Diego Torres Milano
Disabling snapshots in your AVD definition usually helps.

On Oct 20, 4:37 am, Nico Balestra nicobales...@gmail.com wrote:
 Same here.. still haven't managed to run the emulator :'(

 2011/10/20 Emanuel Moecklin 1gravity...@gmail.com







  Hi there

  I updated to the lastest SDK (including SDK Tools r14) and tried to
  start an Android 4.0 emulator.
  The emulator doesn't start and the Windows event log shows the
  following error:

  Faulting application name: emulator-arm.exe, version: 0.0.0.0, time
  stamp: 0x4e9c7fa8
  Faulting module name: emulator-arm.exe, version: 0.0.0.0, time stamp:
  0x4e9c7fa8
  Exception code: 0x4015
  Fault offset: 0x0010f10e
  Faulting process id: 0xf90
  Faulting application start time: 0x01cc8ed70a55c24b
  Faulting application path: C:\Development\android-sdk-windows\tools
  \emulator-arm.exe
  Faulting module path: C:\Development\android-sdk-windows\tools
  \emulator-arm.exe
  Report Id: 49d59d0b-faca-11e0-9aa4-7071bcc13e13

  I tried to google the exception code but the results didn't explain
  the crash.

  Any ideas?

  Emanuel Moecklin

  --
  You received this message because you are subscribed to the Google
  Groups Android Developers group.
  To post to this group, send email to android-developers@googlegroups.com
  To unsubscribe from this group, send email to
  android-developers+unsubscr...@googlegroups.com
  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 android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Plain Unit Testing

2011-08-25 Thread Diego Torres Milano
Take a look at the presentation posted at
http://dtmilano.blogspot.com/2011/08/linuxcon-2011-north-america.html.
Slide 113 will answer your question but I recommend you follow the
complete example.

On Aug 25, 4:49 am, Ryan Huang ryan.p.hu...@gmail.com wrote:
 Hi All,
 I want to do some plain junit testing(using TestCase) for some utility
 classes. I followed the guide 
 inhttp://developer.android.com/resources/tutorials/testing/helloandroid...
 But the problem is, the test is a separate project, when I wrote
 TestCase I cannot import the utility class since it's in the target
 project. Any idea how to achieve this?
 Thanks!

 Best Regards,
 Ryan

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


[android-developers] Re: Realidad Aumentada Android

2011-08-18 Thread Diego Torres Milano
http://developer.android.com/guide/developing/devices/emulator.html
(see Emulator Limitations)

On Aug 17, 6:45 am, Jose_GD jose.gonzale...@gmail.com wrote:
 Como te dice Nick, vas a tener muchas más posibilidades de respuesta si
 escribes en inglés.

 Con respecto al emulador, no tiene acceso a la Webcam. Hay funcionalidades
 que no pueden probarse en el emulador, vas a necesitar indefectiblemente un
 smartphone para probarlas.

 Tengo entendido que existen herramientas para desarrolladores para realidad
 aumentada. Busca Layar en Google.

 Saludos

 José

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


[android-developers] Re: Applying different commands at different location

2011-08-11 Thread Diego Torres Milano
This is a bit more pythonic

#! /usr/bin/env python

from subprocess import Popen

# path: cmd
l = { 'd1':'./c1', 'd2':'./c2' }

for d, c in l.items():
Popen(c, cwd=d)



On Aug 11, 8:06 am, Ablaze androida...@gmail.com wrote:
 Hi guys,
 By little searching found out the following.
 The script for the problem statement can be written as follows.

 ===
     import os

     path='/local/mnt/myspace/sample1'
     os.chdir(path)
     os.system('cmd1')

     path='/local/mnt/myspace/sample2'
     os.chdir(path)
     os.system('cmd2')

     path='/local/mnt/myspace'
     os.chdir(path)
     os.system('cmd3')

 and so on...
 ===

 if anyone have the better way to do it. Kindly post.
 thanks in advance.

 On Aug 11, 11:54 am, Ablaze androida...@gmail.com wrote: Hi...
  Its more related to python but the commands which i will be applying
  is on android source code.

  I am working in Ubuntu. I have a bunch of commands (say 10 commands
  like cmd1, cmd2, cmd3..cmd10)
  I want to write a python script, which can achieve the following:

  It should traverse through the directory structure and apply a command
  at particular directory path.
  The location and the commands are already known to me.

  Here is how, I want the script to operate.

  /local/mnt/myspace/sample1$ cmd1
  /local/mnt/myspace/sample2$ cmd2
  /local/mnt/myspace$ cmd3
  /local/mnt$cmd4
  /local/mnt/myspace/sample9$ cmd 8
  /local/mnt/myspace/sample3$ dmd10

  can someone please help on this.

--
Have you read my blog ?
http://dtmilano.blogspot.com
android junit tests ui linux cult thin clients

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


[android-developers] Re: Test Case Error

2011-08-11 Thread Diego Torres Milano
Use:

sendKeys(SHIFT_LEFT T E S T SHIFT_LEFT T R I P);

instead of

           sendKeys(TestTrip);


On Aug 10, 5:39 pm, Ab Caballero a...@mac.com wrote:
 I have a fairly simple Test Project that tests the user interface of
 an activity. My problem is that it fails toward the end of the test
 and i don't know why.

 1) The preconditions for getActivity(), the buttons and view pass
 2) The test that the view is visible passes
 3) The test that the view is empty when presented to the user passes
 4) The test that text CAN be entered into the view FAILS.

 private static final String TRIP_RESULT = TestTrip;
 .
 .
 .
 mEditTextTripName = (EditText)
 mActivity.findViewById(R.id.EditTextTripName);
 .
 .
 .
 @SmallTest
         public void testViewFull(){
                 mEditTextTripName.clearComposingText();
                 TouchUtils.tapView(this, mEditTextTripName);
                 sendKeys(TestTrip);
                 String tripName = mEditTextTripName.getText().toString();
                 assertEquals(The trip name should be:, TRIP_RESULT, 
 tripName);

 }

 The test fails on assertEquals(), with the following error message:

 junit.framework.ComparisonFailure: The trip name should be:
 expected:TestTrip but was:

 Any thoughts are appreciated.

--
Have you read my blog ?
http://dtmilano.blogspot.com
android junit tests ui linux cult thin clients

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


[android-developers] Re: Test Project Question

2011-08-10 Thread Diego Torres Milano
This answer may get you started:
http://stackoverflow.com/questions/6961754/how-to-call-button-performclick-in-android-junit-test-case/6963033#6963033

On Aug 9, 6:09 pm, Ab Caballero a...@mac.com wrote:
 I want to test that when a button is pressed, that it always does the
 work it is supposed to do, in this case, start a service. Are there
 any built-in methods for a button press? I have looked through the
 documentation and seen a lot of stuff on spinners but not a whole lot
 on buttons.

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


[android-developers] Re: Error: Failed to generate emma coverage.

2011-07-13 Thread Diego Torres Milano
You build is probably not instrumented and thus why coverage
information is not generated.
Chapter 10 of Android Application Testing Guide (http://
www.packtpub.com/android-application-testing-guide/book) includes a
step-by-step guide of getting your build instrumented and generating
code coverage.
Hope this helps.

On Jul 12, 6:25 am, erinwon erin...@gmail.com wrote:
 Recently I am in a android development group and in charge of the test
 work.
 I do my test work automatically under the robotium framework. In order
 to get code coverage for my Robotium tests, I use ant to make this
 under the instruction 
 ofhttp://code.google.com/p/robotium/wiki/QuestionsAndAnswers#How_can_I_...
 andhttp://dev.10086.cn/cmdn/wiki/index.php?edition-view-5456-1.html
 (sorry, this page is in Chinese).

 Step by step, I passed the ant debug and ant run-tests
 successfully. I almost achieved the result ,yeh!
 However when I runned ant coverage and everything seems went
 smoothly, the tragedy happend finally.
 The hints as follows:

  [exec] Error: Failed to generate emma coverage.
  [echo] Downloading coverage file into project directory...
  [exec] remote object '/data/data/com.appleJuice/files/coverage.ec'
 does not exist

 PS: the test  are successfully passed and the test_rules.xml under the
 android sdk is no problem

 The information about the emma of android test is very limit in the
 Internet and I get no help
 Here is my last resort. Help!!!

--
Have you read my blog ?
http://dtmilano.blogspot.com
android junit tests ui linux cult thin clients

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


[android-developers] Re: how to press on a particular menu item using touch in monkeyrunner script?

2011-07-11 Thread Diego Torres Milano
Use its screen coordinates.

On Jul 11, 10:20 am, frank franklin.f2...@gmail.com wrote:
 how to press on a particular menu item using touch in monkeyrunner
 script?

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


[android-developers] Re: Not able to find MonkeyImage.java in android 2.3 SDK

2011-07-05 Thread Diego Torres Milano
monkeyrunner source is in the SDK project:
http://android.git.kernel.org/?p=platform/sdk.git;a=summary


On Jul 1, 3:41 am, Gaytri gaytri.ba...@gmail.com wrote:
 Hi All,

 I am stuck in very basic problem of monkeyrunner. I have android 2.3
 installed on my ubuntu machine. And I am working on monkeyrunner. My
 framework is like I have written shell scripts for clearing the sdcard
 and calling monkeyrunner python scripts. Now, I need to capture
 images. But in my this location android 2.3/development/tools/
 monkeyrunner/src/com/android/monkeyrunner only files existing are:
 MonkeyRecorder.java
 MonkeyRynner.java
 ScriptRunner.java

 I need to add sameAs and loadImageFromFile method in monkeyimage.java.
 But i did not find this file in my SDK.

 Please suggest me whether its the problem with SDK or where?
 In case I will download MonkeyImage.java from net and the where i need
 to make change because there will definitely be some dependencies. and
 then what steps i need to follow to resolve this problem.

 Any kind of help will be highly appreciated.

 Thanks  Regards,
 Gaytri

--
Have you read my blog ?
http://dtmilano.blogspot.com
android junit tests ui linux cult thin clients

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


[android-developers] Re: Want to know about Jython for Monkey runner

2011-05-29 Thread Diego Torres Milano
You only need monkeyrunner to run monkeyrunner scripts.

On May 25, 6:06 am, harry asir harryjoh...@gmail.com wrote:
 Hi,

 I am very new to monkey runner. Inorder to write code/scripts using
 monkey runner API, need Jython. I want to know whether Jython is
 opensource or licenced one. Also, need help in running monkey runner
 on android devices (focusing mainly on key storkes and screen shots).

 ThanksRegards,
 John

--
Have you read my blog ?
http://dtmilano.blogspot.com
android junit tests ui linux cult thin clients

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


[android-developers] Re: monkeyrunner - sending KEYCODE_ESCAPE

2011-05-26 Thread Diego Torres Milano
Heve you tried

device.press(KEYCODE_ESCAPE, DOWN_AND_UP)

?

On May 25, 8:55 am, isildur ashish.ab...@gmail.com wrote:
 hi

 I have written the following command to instruct MonkeyRunner to send an
 escape keyevent to the emulator
 
 device.press(111, DOWN_AND_UP)
 

 But the escape never happens on the intended app. Even if I send this event
 multiple times the escape never works.
 Following is what I see in the logs
 *** 
 ***
 05-25 17:52:54.887: DEBUG/MonkeyStub(577): translateCommand: press 111
 05-25 17:52:55.138: DEBUG/MonkeyStub(577): Quit requested
 05-25 17:52:55.316: INFO/AndroidRuntime(577): AndroidRuntime onExit calling
 exit(8)
 *** 
 *

 Emulator is : Android2.2 - API level8

 can anyone help me to sort this problem.

 thx
 isildur

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


[android-developers] Re: Junit error - INSTRUMENTATION_FAILED

2011-05-16 Thread Diego Torres Milano
This post may help you find if the instrumentation is present in your
emulator/device:
http://dtmilano.blogspot.com/2011/04/running-instrumentation-from.html


On May 16, 7:54 am, rashmi rashmi@gmail.com wrote:
 Hi,
 I am trying to execute junit test cases on froyo 2.2 source code, from
 command line with the following command.
 adb -d shell am instrument -w com.android.camera.tests/
 com.android.camera.CameraStressTestRunner

 And it is giving the error -

 INSTRUMENTATION_STATUS: id=ActivityManagerService
 INSTRUMENTATION_STATUS: Error=Unable to find instrumentation info for:
 ComponentInfo{com.android.camera.tests/
 com.android.camera.CameraStressTestRunner}
 INSTRUMENTATION_STATUS_CODE: -1
 android.util.AndroidException: INSTRUMENTATION_FAILED:
 com.android.camera.tests/com.android.camera.CameraStressTestRunner

 Please let me how to resolve this error.

 I tried to check installed tests with the command
 adb shell pm list instrumentation
 which results empty list.

 So please tell me how to set up the test environment before running
 test case from command line.

 Thank you,

--
Have you read my blog ?
http://dtmilano.blogspot.com
android junit tests ui linux cult thin clients

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


[android-developers] Re: Replay monkey execution

2011-05-08 Thread Diego Torres Milano

I haven't tried this but it seems possible.

Step #1: Increase monkey verbosity (-v -v -v)

Step #2: Run the script and collect the output

Step #3: Parse the output to regenerate a monkey script (optionally
you can modify monkey to spit a valid monkey script)

Step #4: Run the script


On May 7, 2:20 pm, Bob Kerns r...@acm.org wrote:
 True enough, but the difficulty generally comes between step #1 and step #2,
 in this sort of scenario of a rare, hard-to-reproduce crash.

 Often you have to figure out everything you need to know to do step #3 (fix
 the bug) before you can do step #2.

 Even so, do it in this order. Write the test case before fixing it, so you
 can do step #4 -- verify that you fixed it.

--
Have you read my blog ?
http://dtmilano.blogspot.com
android junit tests ui linux cult thin clients

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


[android-developers] Re: Batch Creation in Monkeyrunner

2011-04-26 Thread Diego Torres Milano
Well, in that case you don't need anything but a shell script invoking
them:

#! /bin/bash
script1
script2
...
script10

or, if they are exiting indicating errors

#! /bin/bash
script1  \
script2  \
...
script10


On Apr 26, 7:21 am, Gaytri Batra gaytri.ba...@gmail.com wrote:
 Can you please explain by taking an example for batch creation script.
 Suppose I am having scripts1-10 . How to call each script after completion
 of previous one.

 Thanks  Regards,
 Gayatri

 On Sat, Apr 23, 2011 at 1:27 AM, Diego Torres Milano 
 dtmil...@gmail.comwrote:







  You can create any kind of script you want in monkeyrunner as it is a
  python compiler.

  On Apr 21, 7:53 am, Gaytri gaytri.ba...@gmail.com wrote:
   Hello All,

   I want to create a batch(sequence of multiple scripts) in
   monkeyrunner. I have used this concept in other automation tools like
   QTP. Can anyone please suggest me how to create and then execute
   batches in monkeyrunner.

   Any kind of help will be highly appreciated.

   Thanks  Regards,
   Gayatri

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

--
Have you read my blog ?
http://dtmilano.blogspot.com
android junit tests ui linux cult thin clients

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


[android-developers] Re: Batch Creation in Monkeyrunner

2011-04-26 Thread Diego Torres Milano
I totally agree, but this applies more if you are creating test cases
using MonkeyRunner API than if you have already a several monkeyrunner
scripts as the OP suggested.

On Apr 26, 1:52 pm, Bill Napier nap...@android.com wrote:
 We use python's unittest module to run a series of commands like that (very
 useful if you're doing stuff like regression tests):

 http://docs.python.org/library/unittest.html

 On Tue, Apr 26, 2011 at 9:42 AM, Diego Torres Milano 
 dtmil...@gmail.comwrote:









  Well, in that case you don't need anything but a shell script invoking
  them:

  #! /bin/bash
  script1
  script2
  ...
  script10

  or, if they are exiting indicating errors

  #! /bin/bash
  script1  \
  script2  \
  ...
  script10

  On Apr 26, 7:21 am, Gaytri Batra gaytri.ba...@gmail.com wrote:
   Can you please explain by taking an example for batch creation script.
   Suppose I am having scripts1-10 . How to call each script after
  completion
   of previous one.

   Thanks  Regards,
   Gayatri

   On Sat, Apr 23, 2011 at 1:27 AM, Diego Torres Milano dtmil...@gmail.com
  wrote:

You can create any kind of script you want in monkeyrunner as it is a
python compiler.

On Apr 21, 7:53 am, Gaytri gaytri.ba...@gmail.com wrote:
 Hello All,

 I want to create a batch(sequence of multiple scripts) in
 monkeyrunner. I have used this concept in other automation tools like
 QTP. Can anyone please suggest me how to create and then execute
 batches in monkeyrunner.

 Any kind of help will be highly appreciated.

 Thanks  Regards,
 Gayatri

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

  --
  Have you read my blog ?
 http://dtmilano.blogspot.com
  android junit tests ui linux cult thin clients

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

 --
 Note: please don't send private questions to me, as I don't have time
 to provide private support.  All such questions should be posted on
 public forums, where I and others can see and answer them



--
Have you read my blog ?
http://dtmilano.blogspot.com
android junit tests ui linux cult thin clients

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


[android-developers] Re: How to send combination keys in functional testing

2011-04-25 Thread Diego Torres Milano
You can use something like this:

sendKeys(KeyEvent.KEYCODE_ALT_LEFT, KeyEvent.KEYCODE_9,
KeyEvent.KEYCODE_ALT_LEFT, KeyEvent.KEYCODE_0);
assertEquals((), mTV.getText().toString());

On Apr 25, 2:38 am, Rui kae...@gmail.com wrote:
 Hello,

 I am trying to test my application with
 ActivityInstrumentationTestCase2. My application is for a specific
 hardware, which has a hardware keyboard including ctrl and alt key,
 and has functions which are fired by combination keys, e.g., Ctrl +
 BackSpace, Ctrl + C, Ctrl + Right, and etc.

 Does anybody know how to send these combination keys to Android
 applications?

 Thank you for advance.
 -Rui

--
Have you read my blog ?
http://dtmilano.blogspot.com
android junit tests ui linux cult thin clients

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


[android-developers] Re: Web based Emulator

2011-04-22 Thread Diego Torres Milano
Strictly speaking you can launch an emulator from a remote machine
using some remote display protocol.
For example, you can 'ssh -CX user@server emulator' and if X11
forwarding is supported and your network connection has low latency
there's no noticeable difference from a local emulator. I use it on a
regular basis and works.
Any other remote application protocol (RDP, Citrix, 2X, SPICE, etc.)
would do and in some cases it would be easier to launch from the
browser.


On Apr 21, 4:38 pm, Igor Prilepov iprile...@gmail.com wrote:
 This is not an emulator but a marketing demo.
 Emulator should accurately represent the real device, for example you should
 be able to add a new record to the contacts list, open some page in the
 browser, etc. This is a development tool.
 The page you mentioned has different purpose - give some initial experience
 to a potential user (sort of try before buy). This is marketing tool.
 Different goals - different requirements - different implementations.
 If your original question was about such demo then this is a wrong place.

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


[android-developers] Re: Running Instrumentation Test on multiple emulator on desktop.

2011-04-22 Thread Diego Torres Milano
Use spawn=true in your ant script to run as background commands.

On Apr 21, 4:46 am, Isha Dalwadi isha.j.dalw...@gmail.com wrote:
 Hi,

 I have two emulators running on my machine. now with adb am instrument
 command i can run the instrumentation test on single emulator at a
 time. So, two run the instrumentation test on both the emulator i need
 to fire two commands separately like below:

 command prompt 1:  adb -s emulator-5554 shell am instrument -w
 test_package_name/runner_class
 command prompt 2:  adb -s emulator-5556 shell am instrument -w
 test_package_name/runner_class

 Is there any way to start the instrumentation test on both the
 emulators simultaneous with ONLY one command?

 Note that, I am using ANT to run the instrumentation test. Also,
 please suggest any other ways of doing so...

 Thanks,
 Isha

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


[android-developers] Re: Batch Creation in Monkeyrunner

2011-04-22 Thread Diego Torres Milano
You can create any kind of script you want in monkeyrunner as it is a
python compiler.

On Apr 21, 7:53 am, Gaytri gaytri.ba...@gmail.com wrote:
 Hello All,

 I want to create a batch(sequence of multiple scripts) in
 monkeyrunner. I have used this concept in other automation tools like
 QTP. Can anyone please suggest me how to create and then execute
 batches in monkeyrunner.

 Any kind of help will be highly appreciated.

 Thanks  Regards,
 Gayatri

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


[android-developers] Re: how do I change screen orientation from ADB or equivalent?

2011-04-17 Thread Diego Torres Milano
Flip command in monkey is expected to work only in emulator and Dream
(see MonkeyFlipEvent.java).

On Apr 15, 4:56 pm, Bill Napier nap...@android.com wrote:
 Then again, I just tried it with the Nexus S and it doesn't work.  It may
 work on devices with keyboards like Droid.  Here's how I tested it:

 $ adb shell monkey --port 
 $ adb forward tcp: tcp:
 $ telnet localhost 
 Connected to localhost.
 Escape character is '^]'.
 flip open
 OK
 flip close
 OK

 And nothing happened on my phone.  It may actually work on a device that has
 a flip out keyboard (G1 or droid for example), but I don't have one handy.









 On Fri, Apr 15, 2011 at 11:24 AM, Bill Napier nap...@android.com wrote:
  It looks like the flip command from the protocol that monkeyrunner uses
  may do it for you.  It looks like it never got added to MonkeyDevice to be
  exposed as part of the monkeyrunner API.

 http://android.git.kernel.org/?p=platform/development.git;a=blob;f=cm...

  On Thu, Apr 14, 2011 at 4:26 AM, lbendlin l...@bendlin.us wrote:

  Well, the monkey can do it (change orientation, that is)  so you might be
  able to learn how to do it from the monkey source code.

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

  --
  Note: please don't send private questions to me, as I don't have time
  to provide private support.  All such questions should be posted on
  public forums, where I and others can see and answer them

 --
 Note: please don't send private questions to me, as I don't have time
 to provide private support.  All such questions should be posted on
 public forums, where I and others can see and answer them

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


[android-developers] Re: Monkeyrunner not capturing screenshot correctly

2011-04-17 Thread Diego Torres Milano
You can use ImageMagick's compare to actually visualize the difference
as described in this post 
http://dtmilano.blogspot.com/2011/04/monkeyrunner-visual-image-comparison.html.


On Apr 16, 6:34 pm, lsim001 lim@gmail.com wrote:
 Hi guys,
 I've actually worked out how to solve the problem.  Well...the result
 of the problem.  i am not going to speculate why the screenshots are
 not correct.

 Anyway, what I've done is to just take 2 screenshots and compare them
 until they are the same.  This has worked well for me.  Here's how I'm
 doing it.  Although I only set the image comparison at 50% match the
 images usually turn out to be exactly the same to my eyes.

 Hope this helps.

 stableImage = False

     while stableImage == False:
         result = device.takeSnapshot()
         MonkeyRunner.sleep(1)
         result2 = device.takeSnapshot()
         stableImage = result2.sameAs(result, 0.5)
         print stableImage, ' -- image stabilizing...'

     MonkeyRunner.sleep(shortSleepInterval)
     result2.writeToFile(filename,'png')

 On Apr 4, 7:45 am, Diego Torres Milano dtmil...@gmail.com wrote:







  In some cases, after trial and error, I had to add up to 3 secs.

  On Apr 3, 2:28 pm, SJ boris.iva...@gmail.com wrote:

   Thanks Diego.
   (Actually Im using your approach with Eclipse but on MAC. Works well.
   But not manage on Win.)

   MonkeyRunner.sleep(1.0)
   result = device.takeSnapshot()
   MonkeyRunner.sleep(1.0)

   This made me perfect screenshot.

   On Apr 2, 10:43 pm, Diego Torres Milano dtmil...@gmail.com wrote:

Add more delay to see it this solves the problem.

On Apr 2, 1:56 pm, SJ boris.iva...@gmail.com wrote:

 I have also seen not 100% perfect screenshot.
 There is only one function in Monkeyrunner to take Snapshots:

 com.android.monkeyrunner.MonkeyDevice.takeSnapshot
 Gets the device's screen buffer, yielding a screen capture of the
 entire display.

 Which function have you mention?

 On Mar 31, 2:31 am, lbendlin l...@bendlin.us wrote:

  Are you taking the screenshots from the framebuffer? You may want 
  to use a
  more higher level function that will only execute when the whole 
  screen is
  blitted.

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


[android-developers] Re: Compare MonkeyImage

2011-04-11 Thread Diego Torres Milano
You may find this post containing an example useful too:
http://dtmilano.blogspot.com/2011/04/monkeyrunner-visual-image-comparison.html.
The example is using MonkeyImage.loadFromfile() which I added for the
reason you mentioned before.


On Apr 8, 9:51 pm, Peddi Kanumuri peddi.kanum...@gmail.com wrote:
 Thanks Bill !

 'loadImageFromFile' API is working good if I call it as a method of
 MonkeyRunner.

 Would not it be good to make this (loadImageFromFile) part of
 MonkeyImage as 'writeToFile' is part of MonkeyImage (point: both APIs
 would be part of same parent)?

 Nonethless, It is working like charm.

 -Peddi.

 On Apr 8, 5:13 pm, Bill Napier nap...@android.com wrote: Hi Peddi,

  Here's an example of the usage of loadImageFromFile:

  from com.android.monkeyrunner import MonkeyRunner
  img = MonkeyRunner.loadImageFromFile(path='/home/napier/logo.png')

  Since loadImageFromFile is something that can be done at any time and really
  has nothing to do with a device, it didn't make a whole lot of sense to me
  to add it as a method on MonkeyDevice.  If you've got a good argument as to
  why it should be there, I'll listen to it.

  Thanks,

  Bill

  On Fri, Apr 8, 2011 at 9:23 AM, Peddi Kanumuri 
  peddi.kanum...@gmail.comwrote:

   Please check this issue @
  http://code.google.com/p/android/issues/detail?id=16049

   -Peddi.

   On Apr 7, 4:59 pm, Peddi Kanumuri peddi.kanum...@gmail.com wrote:
Bill,

How to build just the monkeyrunner.jar with these changes?
We are in need of loadImageFromFile API.

-Peddi.

On Mar 7, 8:02 pm, Bill Napier nap...@android.com wrote:

https://review.source.android.com//#change,21478

 https://review.source.android.com//#change,21478Adds support for
   this
 change.  If you check the android source out and build monkeyrunner
   from
 that, you should be able to read images from the file system.  It will
   also
 eventually find its way into an SDK release, but checking it out and
 building it youself is the fastest way to get it.

 Bill

 On Fri, Feb 25, 2011 at 5:52 PM, Andrew W. Hill kj6...@gmail.com
   wrote:

  I know this is an old thread, but I was wondering if MonkeyRunner 
  has
  the capability to read screenshots from the file system yet.  I
  couldn't find any info on it.
  Cheers,
  Andrew

  On Feb 15, 4:11 pm, Bill Napier nap...@android.com wrote:
   Hi Christopher,

   Being able to load an image into MonkeyRunner from the filesystem
   makes a lot of sense, I don't see how I had missed that.  All the
   test's we've been using MonkeyRunner before only ever wanted to
   compare to subsequent snapshots (to see what has changed).  This
   looks
   pretty straight forward feature to add, but may take me a couple
   days
   to get to it.

   Bill

   On Mon, Feb 14, 2011 at 6:14 PM, Christopher M. Judd 
   javaj...@gmail.com
  wrote:

According to the monkeyrunner documentation, you can compare
screenshot output to known screenshot for regression testing. 
How
   do
you do this? I see the method sameAs on MonkeyImage but that
   takes a
MonkeyImage presumably one saved on disk for regression testing
   but
there appears to be no way to load one from disk.

--
You received this message because you are subscribed to the
   Google
Groups Android Developers group.
To post to this group, send email to
  android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
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
   android-developers@googlegroups.com
  To unsubscribe from this group, send email to
  android-developers+unsubscr...@googlegroups.com
  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 android-developers@googlegroups.com
   To unsubscribe from this group, send email to
   android-developers+unsubscr...@googlegroups.com
   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 android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Monkeyrunner not capturing screenshot correctly

2011-04-04 Thread Diego Torres Milano
In some cases, after trial and error, I had to add up to 3 secs.

On Apr 3, 2:28 pm, SJ boris.iva...@gmail.com wrote:
 Thanks Diego.
 (Actually Im using your approach with Eclipse but on MAC. Works well.
 But not manage on Win.)

 MonkeyRunner.sleep(1.0)
 result = device.takeSnapshot()
 MonkeyRunner.sleep(1.0)

 This made me perfect screenshot.

 On Apr 2, 10:43 pm, Diego Torres Milano dtmil...@gmail.com wrote:







  Add more delay to see it this solves the problem.

  On Apr 2, 1:56 pm, SJ boris.iva...@gmail.com wrote:

   I have also seen not 100% perfect screenshot.
   There is only one function in Monkeyrunner to take Snapshots:

   com.android.monkeyrunner.MonkeyDevice.takeSnapshot
   Gets the device's screen buffer, yielding a screen capture of the
   entire display.

   Which function have you mention?

   On Mar 31, 2:31 am, lbendlin l...@bendlin.us wrote:

Are you taking the screenshots from the framebuffer? You may want to 
use a
more higher level function that will only execute when the whole screen 
is
blitted.

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


[android-developers] Re: Monkeyrunner not capturing screenshot correctly

2011-04-02 Thread Diego Torres Milano
Add more delay to see it this solves the problem.

On Apr 2, 1:56 pm, SJ boris.iva...@gmail.com wrote:
 I have also seen not 100% perfect screenshot.
 There is only one function in Monkeyrunner to take Snapshots:

 com.android.monkeyrunner.MonkeyDevice.takeSnapshot
 Gets the device's screen buffer, yielding a screen capture of the
 entire display.

 Which function have you mention?

 On Mar 31, 2:31 am, lbendlin l...@bendlin.us wrote:







  Are you taking the screenshots from the framebuffer? You may want to use a
  more higher level function that will only execute when the whole screen is
  blitted.

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


[android-developers] Re: Running Monkeyrunner directly on Android tablet

2011-03-22 Thread Diego Torres Milano
If you have root you can run monkey from a shell, for example if you
monkey script is in /data/m.txt

# cat /data/m.txt
tap 100 180
type 123
tap 100 280

# monkey --port 1080 
# nc localhost 1080  /data/m.txt

may I ask why do you need this ?


On Mar 17, 5:43 am, raki rakeshkart...@gmail.com wrote:
 Hi Bill,

 Thanks for your reply.
 Could you please tell me if there is a way at least to run a Monkey
 script on the Android device directly?

 Thanks,
 Rakesh

 On Mar 17, 7:37 am, Bill Napier nap...@android.com wrote: Hi,

  This won't work.  MonkeyRunner will only work on a host computer, you can't
  run it from the device itself.

  Bill

  On Tue, Mar 15, 2011 at 5:15 AM, raki rakeshkart...@gmail.com wrote:
   Hi,

   I wanted to run a python script directly on an Android device through
   Monkeyrunner.
   I have installed the following applications on my Android device:
   SLA4, Python for Android.

   But when I try to run the script through Python interpretter, I get
   the error saying Import Error: No Module named
   com.android.monkeyrunner

   Are Monkeyrunner and Monkey tools not included along with the Android
   OS ?

   Could some one suggest, how to start creating scripts using
   Monkeyrunner API ?

   Appreciate any help.

   Thanks,
   Rakesh

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

--
Have you read my blog ?
http://dtmilano.blogspot.com
android junit tests ui linux cult thin clients

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


[android-developers] Re: Running Monkeyrunner directly on Android tablet

2011-03-18 Thread Diego Torres Milano
You are talking about opening the shell and run monkey.
The OP asks about monkeyrunner.

On Mar 17, 1:58 pm, lbendlin l...@bendlin.us wrote:
 connect device to computer. Open terminal window. adb shell monkey etc
 etc

 On Mar 17, 5:43 am, raki rakeshkart...@gmail.com wrote:







  Hi Bill,

  Thanks for your reply.
  Could you please tell me if there is a way at least to run a Monkey
  script on the Android device directly?

  Thanks,
  Rakesh

  On Mar 17, 7:37 am, Bill Napier nap...@android.com wrote:

   Hi,

   This won't work.  MonkeyRunner will only work on a host computer, you 
   can't
   run it from the device itself.

   Bill

   On Tue, Mar 15, 2011 at 5:15 AM, raki rakeshkart...@gmail.com wrote:
Hi,

I wanted to run a python script directly on an Android device through
Monkeyrunner.
I have installed the following applications on my Android device:
SLA4, Python for Android.

But when I try to run the script through Python interpretter, I get
the error saying Import Error: No Module named
com.android.monkeyrunner

Are Monkeyrunner and Monkey tools not included along with the Android
OS ?

Could some one suggest, how to start creating scripts using
Monkeyrunner API ?

Appreciate any help.

Thanks,
Rakesh

--
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
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 android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Using Eclipse write monkeyrunner

2011-03-13 Thread Diego Torres Milano
Some hints to use monkeyrunner from eclipse can be found at
http://dtmilano.blogspot.com/2011/03/using-android-monkeyrunner-from-eclipse.html

On Mar 11, 6:06 am, c j techandroid@gmail.com wrote:
 I need using monkeyrunner do some easy auto test but have some
 problem.

 Eclipse SDK 3.6.2 (Pydev 1.6.5 + Jython 2.5.2 + Python 2.7.1 +
 monkeyrunner.jar + google-collect-1.0-rc1.jar)
 jdk1.6.0_24
 android-sdk-windows

 i try this example in second line have wrong

 http://developer.android.com/guide/developing/tools/MonkeyRunner.html

 # Imports the monkeyrunner modules used by this program
 from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice

 # Connects to the current device, returning a MonkeyDevice object
 device = MonkeyRunner.waitForConnection()

 error msg

  device = MonkeyRunner.waitForConnection()
         at
 com.android.monkeyrunner.MonkeyRunner.waitForConnection(MonkeyRunner.java:
 74)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
 Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
 java.lang.NullPointerException: java.lang.NullPointerException

 Please tell know where setting wrong.
 thanks!

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


[android-developers] Re: Insrumentation testing in Android

2011-02-10 Thread Diego Torres Milano
If

$  adb shell pm list instrumentation

output is empty, then you don't have any test installed.
Install them first.

On Feb 9, 8:44 am, Oleg Popenov popenov.o...@gmail.com wrote:
 Hi,

 I've tried to run Instrumentation Tests on device from adb shell and I get a
 strange error, could you please help me?
 If I run tests for any internal android application (email for example) as
 it written in AndroidManifest.xml,

 * !--*
 * This declares that this app uses the instrumentation test runner targeting
 *
 * the package of com.android.email.  To run the tests use the command:*
 * adb shell am instrument -w
 com.android.email.tests/android.test.InstrumentationTestRunner*
 * --*

 then I get an error:

 *am instrument -w
 com.android.email.tests/android.test.InstrumentationTestRunner
 **INSTRUMENTATION_STATUS: id=ActivityManagerService
 **INSTRUMENTATION_STATUS: Error=Unable to find instrumentation info for:
 Component
 **Info{com.android.email.tests/android.test.InstrumentationTestRunner}
 **INSTRUMENTATION_STATUS_CODE: -1
 **android.util.AndroidException: INSTRUMENTATION_FAILED:
 com.android.email.tests/a*
 *ndroid.test.InstrumentationTestRunner*

  *
 *
 The result of the command *'pm list instrumentation' *is empty.
 How can I run tests?

 Thanks in advance!
 Most sincerely, Oleg

--
Have you read my blog ?
http://dtmilano.blogspot.com
android junit tests ui linux cult thin clients

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


[android-developers] Re: MonkeyImage.writeToFile error

2011-01-31 Thread Diego Torres Milano
The problem, which is also in Google documentation, is the missing
pair of parenthesis

18 result = device.takeSnapshot()
^^

otherwise, you are getting a reference to the method.

On Jan 30, 6:58 am, dan raaka danra...@gmail.com wrote:
 I am running this as ./monkeyrunner test.py

  17 # Takes a screenshot
  18 result = device.takeSnapshot
  19
  20 # Writes the screenshot to a file
  21 result.writeToFile('shot1.png','png')

 This throws an error as.. any thoughts ...

 mini@tools$./monkeyrunner test.py
 110130 03:47:34.316:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions]
 Script terminated due to an exception
 110130 03:47:34.316:S [main]
 [com.android.monkeyrunner.MonkeyRunnerOptions]Traceback (most recent call
 last):
   File /Users/dan/Android/android-sdk-mac_x86/tools/test.py, line 21, in
 module
     result.writeToFile('shot1.png','png')
 AttributeError: 'instancemethod' object has no attribute 'writeToFile'

 110130 03:47:34.316:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at
 org.python.core.PyException.fillInStackTrace(PyException.java:70)
 110130 03:47:34.316:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at
 java.lang.Throwable.init(Throwable.java:181)
 110130 03:47:34.316:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at
 java.lang.Exception.init(Exception.java:29)
 110130 03:47:34.316:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at
 java.lang.RuntimeException.init(RuntimeException.java:32)
 110130 03:47:34.316:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at
 org.python.core.PyException.init(PyException.java:46)
 110130 03:47:34.316:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at
 org.python.core.PyException.init(PyException.java:43)
 110130 03:47:34.316:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at
 org.python.core.PyException.init(PyException.java:61)
 110130 03:47:34.316:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at
 org.python.core.Py.AttributeError(Py.java:145)
 110130 03:47:34.316:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at
 org.python.core.PyObject.noAttributeError(PyObject.java:936)
 110130 03:47:34.316:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at
 org.python.core.PyObject.__getattr__(PyObject.java:931)
 110130 03:47:34.316:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at
 org.python.pycode._pyx0.f$0(/Users/dan/Android/android-sdk-mac_x86/tools/te 
 st.py:21)
 110130 03:47:34.316:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at
 org.python.pycode._pyx0.call_function(/Users/dan/Android/android-sdk-mac_x8 
 6/tools/test.py)
 110130 03:47:34.316:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at
 org.python.core.PyTableCode.call(PyTableCode.java:165)
 110130 03:47:34.316:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at
 org.python.core.PyCode.call(PyCode.java:18)
 110130 03:47:34.316:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at
 org.python.core.Py.runCode(Py.java:1197)
 110130 03:47:34.316:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at
 org.python.core.__builtin__.execfile_flags(__builtin__.java:538)
 110130 03:47:34.316:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at
 org.python.util.PythonInterpreter.execfile(PythonInterpreter.java:156)
 110130 03:47:34.316:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at
 com.android.monkeyrunner.ScriptRunner.run(ScriptRunner.java:116)
 110130 03:47:34.316:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at
 com.android.monkeyrunner.MonkeyRunnerStarter.run(MonkeyRunnerStarter.java:9 2)
 110130 03:47:34.316:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] at
 com.android.monkeyrunner.MonkeyRunnerStarter.main(MonkeyRunnerStarter.java: 
 203)
 mini@tools$

 -Dan

--
Have you read my blog ?
http://dtmilano.blogspot.com
android junit tests ui linux cult thin clients

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


[android-developers] Re: [ADB -install] How to install and application inside an emulator, if only the avd-name is known?

2011-01-14 Thread Diego Torres Milano
This may help you:
http://stackoverflow.com/questions/2214377/how-to-get-serial-number-or-id-of-android-emulator-after-it-runs

On Jan 14, 8:58 am, Kostya Vasilyev kmans...@gmail.com wrote:
 The emulator-xxx you're seeing in adb devices output is what you use
 with the adb -s switch.

 This works:

 adb -s emulator-5554 install path_to_apk

 -- Kostya

 2011/1/14 hobbykochma hobbykoc...@googlemail.com







  Dear group members,

  I have a question related to installing an APK file with the command
  adb -install:

  We have created via commandline a set of AVDs and we have started a
  set of devices which run in an emulator. For all of the devices we
  know the corresponding avd-name.

  The result of the command adb services is now something like [1].

  Now we would like to install an application inside the device
  belonging to avd-name.

  But having the avd-name the apk-file could not be installed. For
  this we need the serialnumber.

  How can we find the serialnumber, if we know the avd-name?

  Thanks for a hint.

  Best Regards

  Frank

  [1]

  $ adb devices
  List of devices attached
  emulator-5554  device
  emulator-5556  device
  emulator-5558  device
  ...

  --
  You received this message because you are subscribed to the Google
  Groups Android Developers group.
  To post to this group, send email to android-developers@googlegroups.com
  To unsubscribe from this group, send email to
  android-developers+unsubscr...@googlegroups.comandroid-developers%2Bunsubs 
  cr...@googlegroups.com
  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 android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: InstrumentationTestRunner with Annotation

2011-01-14 Thread Diego Torres Milano
If you want to provide a different behavior for the test runner just
create your own extending it:

public class MyTestRunner extends
android.test.InstrumentationTestRunner {
  // do wathever you want
}

To do whatever you want, use android.test.InstrumentationTestRunner
source as a an inspiration.


On Jan 13, 1:47 am, Aman Bhardwaj myama...@gmail.com wrote:
 Hi,
 I have some test cases with my own defined Annotations, but
 InstrumenationTestRunner doesn't runs tests based on annotation.
 However it works if I add annotations
 from android.test.suitebuilder.annotation.

 Is it only supposed to work with annotations
 in android.test.suitebuilder.annotation.Smoke?
 Any suggestions how to make it work with my own annotations.

 Thanks,
 ~Aman

--
Have you read my blog ?
http://dtmilano.blogspot.com
android junit tests ui linux cult thin clients

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


[android-developers] Re: Test case throws permission exception

2011-01-14 Thread Diego Torres Milano
You have to set the permission on the application's manifest not on
the tests' manifest.
That's what you usually do by having a main and a tests project.
Furthermore, your test should look more like:

public class AndroidDummyContactsTests extends InstrumentationTestCase
{

private static final String TESTUSER_NAME = Test User;
private static final String TESTUSER_NUMBER = 1234568909;
private Instrumentation mInstrumentation;
private ContentResolver mContentResolver;

public AndroidDummyContactsTests(String name) {
setName(name);
}

protected void setUp() throws Exception {
super.setUp();
mInstrumentation = getInstrumentation();
mContentResolver =
mInstrumentation.getTargetContext().getContentResolver();
}

protected void tearDown() throws Exception {
super.tearDown();
}

public final void testInsertContact() {
final ContentValues values = new ContentValues();
final Uri rawContact =
mContentResolver.insert(ContactsContract.RawContacts.CONTENT_URI,
values);
assertNotNull(rawContact);
final long rawContactId = ContentUris.parseId(rawContact);
assertTrue(rawContactId  0);

values.clear();
values.put(Data.RAW_CONTACT_ID, rawContactId);
values.put(Data.MIMETYPE, StructuredName.CONTENT_ITEM_TYPE);
values.put(StructuredName.DISPLAY_NAME, TESTUSER_NAME);
assertNotNull(mContentResolver.insert(Data.CONTENT_URI, 
values));

values.clear();
values.put(Data.RAW_CONTACT_ID, rawContactId);
values.put(Data.MIMETYPE, Phone.CONTENT_ITEM_TYPE);
values.put(Phone.NUMBER, TESTUSER_NUMBER);
assertNotNull(mContentResolver.insert(Data.CONTENT_URI, 
values));
}
}

and it works (remember that you need an app too where you grant the
permission), but as you are not using mock objects you will be
populating your contacts database with test data which is probably not
a very good idea.


On Jan 8, 2:37 pm, javaxmlsoapdev vika...@gmail.com wrote:
 I am writing a test case to for reading phone contact list

 public class ContactTest extends AndroidTestCase {

         static final String LOG_TAG = ContactTest;
     static final String TESTUSER_NAME = Test User;
     static final String TESTUSER_NUMBER = 1234568909;
     ContentResolver contentResolver;
     Uri newPerson;

     public void setUp() {
         contentResolver = getContext().getContentResolver();

         ContentValues person = new ContentValues();
         person.put(ContactsContract.Contacts.DISPLAY_NAME,
 TESTUSER_NAME );
         person.put(ContactsContract.CommonDataKinds.Phone.NUMBER,
 TESTUSER_NUMBER );

         newPerson =
 contentResolver.insert(ContactsContract.Contacts.CONTENT_URI,person);
     }

 In Manifest file I have following permissions defined
 uses-permission android:name=android.permission.WRITE_CONTACTS/
     uses-permission android:name=android.permission.READ_CONTACTS/

 But while running the test it keeps throwing following permission
 exception
 java.lang.SecurityException: Permission Denial: writing
 com.android.providers.contacts.ContactsProvider2 uri
 content://com.android.contacts/contacts from pid=343, uid=10036
 requires android.permission.WRITE_CONTACTS
 at android.os.Parcel.readException(Parcel.java:1247)
 at
 android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:
 160)
 at
 android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:
 114)
 at
 android.content.ContentProviderProxy.insert(ContentProviderNative.java:
 408)
 at android.content.ContentResolver.insert(ContentResolver.java:587)
 at com.aes.mobile.android.test.ContactTest.setUp(ContactTest.java:32)
 at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:169)
 at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:154)
 at
 android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.ja 
 va:
 520)
 at android.app.Instrumentation
 $InstrumentationThread.run(Instrumentation.java:1447)

 Any idea?

 Thanks,


--
Have you read my blog ?
http://dtmilano.blogspot.com
android junit tests ui linux cult thin clients

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


[android-developers] Re: change color of DatePickerDialog widget

2011-01-10 Thread Diego Torres Milano
I haven't tried DatePickerDialog but I think this could help:
http://dtmilano.blogspot.com/2010/01/android-ui-colored-dialogs.html


On Jan 10, 6:14 pm, Streets Of Boston flyingdutc...@gmail.com wrote:
 I tried to do this as well.

 The closest i came was to be able to 'skin' the AM/PM button of the
 TimeDialog picker... :(

 The 'Set' and 'Cancel' buttons, the 'up' and 'down' buttons seem not
 to be skinnable. But i could be wrong and just haven't found the right
 way to do it.

 On Jan 10, 4:28 pm, Kumar Bibek coomar@gmail.com wrote:







  From the documentation, I couldn't find an easy way to do this. The
  theme, will only change things, that it declares. So, to change the
  colors, you might have to dig deep into the DatePickerDialog source
  code.

  But, I think, an easier way to do this is to create your own
  DatePickerDialog by extending the Dialog class.

  On Jan 7, 11:02 am, pramod.deore deore.pramo...@gmail.com wrote:

   How to change the change color of DatePickerDialog widget? In docs
   there is one constructor which has theme field

   public  DatePickerDialog  (Context context, int theme,
   DatePickerDialog.OnDateSetListener callBack, int year, int
   monthOfYear, int dayOfMonth)

   But when I tried for different theme value then only size of
   DatePickerDialog  widget changes. If I want to change the color then
   how to do this?
   Thanks- Hide quoted text -

  - Show quoted text -

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


[android-developers] Re: help me understand: upper case characters in layout file names are disallowed

2010-11-23 Thread Diego Torres Milano
This limitation surely comes from supporting some filesystems on some
operating systems which are case insensitive.
BTW, you can name your View defineNewList but you cannot name your
layout, which is a filename, Main.
Leon Moreyn-Android Development wrote:
 It a language structure concept. You just have to build around it. Its
 kind of like saying why can i only pay with quarters into a vending
 machine if I have two dimes and a nickel. The structure of the machine
 is not designed to handle you dimes and nickels and this way the
 machine can process faster with less distractions.

 On Nov 21, 7:00 pm, Justin Collum jcol...@gmail.com wrote:
  I understand that these files map to R classes (generated). So I see
  why punctuation characters (most) are disallowed. But I can't for the
  life of me think of why main would be allowed but Main would not.
  Why not something like firstScreen?  Is there something about
  generated files that I'm missing? Do caps screw them up somehow? I'd
  like to make a view named defineNewList or something along those
  lines. Annoying to have to use underscores: define_new_list.

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


Re: [android-developers] Help getting screen number

2010-11-23 Thread Diego Torres Milano
But if the user is seeing any desktop is not in your application.
What's your intention ?

Kumar Bibek wrote:
 There is no such API.

 Kumar Bibek
 http://techdroid.kbeanie.com
 http://www.kbeanie.com



 On Sun, Nov 21, 2010 at 7:38 PM, Pedro Duque pmdu...@gmail.com wrote:

  Hi,
 
  I need to get the screen number a user is seeing and the total screens in
  home application. I can't find this info anywhere in the API.
 
  Can you help me?
 
  Thanks,
  Pedro Duque
 
  --
  You received this message because you are subscribed to the Google
  Groups Android Developers group.
  To post to this group, send email to android-developers@googlegroups.com
  To unsubscribe from this group, send email to
  android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com
  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 android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: using instrumentation testing framework if there is more than one activity

2010-10-19 Thread Diego Torres Milano
You should use Instrumentation.ActivityMonitor, that can be used to
look for the creation of an activity, which together with
Instrumentation.addMonitor() let you test that flow.

On Oct 18, 1:24 pm, A. Elk lancaster.dambust...@gmail.com wrote:
 The instrumentation testing framework is designed to do unit tests.
 It's not a replacement for a full testing framework; instead, it
 allows you to do true JUnit-style unit testing on Android component
 classes.

 Robotium is more of a functional/application-level testing framework.
 Within object-oriented programming (strictly speaking), a unit test
 tests an individual method by calling it in a controlled environment
 and evaluating its results. The structure of test cases that Robotium
 uses is similar to that of JUnit, but Robotium's level of work is a
 class (an Activity, for example), not a method. In that sense, it's a
 test harness for functional testing of a class.

 Automated functional testing is necessary, but so is unit testing. The
 latter is particularly important when you are modifying existing
 behavior. IMHO, unit testing is also better at identifying
 dependencies.

 Android itself has monkey, which is *a* tool for doing functional
 testing, but has limited applicability.

 On Oct 18, 12:18 am, Mathias Lin m...@mathiaslin.com wrote:



  Hi Andrei, not directly answering your question, but just want to
  point you towww.robotium.org, which is a testing framework and does
  tests across multiple activities.

  On Oct 18, 11:02 am, Andrei gml...@gmail.com wrote:

   How do I use instrumentation testing framework to test flow between
   activities?
   The example goog gives is for one activity only
   Thanks

--
Have you read my blog ?
http://dtmilano.blogspot.com
android junit tests ui linux cult thin clients

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


[android-developers] Re: Problem debugging Android Bootup Service

2010-10-06 Thread Diego Torres Milano
Try something like

   @Override
public void onReceive(Context context, Intent intent) {
 Debug..waitForDebugger();
 ...

and attach the dubugger once the Intent is received.

On Oct 1, 5:10 pm, Raj rnmalho...@gmail.com wrote:
 Android Experts,

     I have a simple Android Service, which should start on device
 bootup. However, I cannot debug this using Eclipse on Windows.

 The error I get from Logcat is

 10-01 21:06:30.788: DEBUG/AndroidRuntime(487): 
 AndroidRuntime START 
 10-01 21:06:30.788: DEBUG/AndroidRuntime(487): CheckJNI is ON
 10-01 21:06:31.008: DEBUG/AndroidRuntime(487): --- registering native
 functions ---
 10-01 21:06:32.008: DEBUG/AndroidRuntime(487): Shutting down VM
 10-01 21:06:32.008: DEBUG/dalvikvm(487): Debugger has detached; object
 registry had 1 entries
 10-01 21:06:32.038: INFO/AndroidRuntime(487): NOTE: attach of thread
 'Binder Thread #3' failed

 My manifest looks like

 ?xml version=1.0 encoding=utf-8?
 manifest xmlns:android=http://schemas.android.com/apk/res/android;
       package=com.preciseinc.DroidLocator
       android:versionCode=1
       android:versionName=1.0
         uses-permission
 android:name=android.permission.RECEIVE_BOOT_COMPLETED /
         uses-permission android:name=android.permission.INTERNET /
         uses-permission
 android:name=android.permission.ACCESS_FINE_LOCATION /
         uses-permission
 android:name=android.permission.ACCESS_NETWORK_STATE /
         uses-sdk android:minSdkVersion=8 /

     application android:icon=@drawable/icon android:label=@string/
 app_name android:debuggable=true
         service android:name=.DroidService
                 intent-filter
                         action 
 android:name=com.preciseinc.DroidLocator.DroidService /
                 /intent-filter
         /service
         receiver android:name=.ServiceAutoStarter
                 intent-filter
                 action
 android:name=android.intent.action.BOOT_COMPLETED/
                 /intent-filter
         /receiver
         /application
 /manifest

 I have a breakpoint in my ServiceAutoStarter code (below), which is
 never hit.

 public class ServiceAutoStarter extends BroadcastReceiver {

         @Override
         public void onReceive(Context context, Intent intent) {
                 Intent serviceIntent = new Intent();
                 serviceIntent.setComponent(new
 ComponentName(com.preciseinc.DroidLocator,
                                 com.preciseinc.DroidLocator.DroidService));
                 context.startService(serviceIntent);
         }

 }

 Appreciate any and all Help.

 Regards,

 Raj.

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


[android-developers] Re: Headless emulator

2010-10-04 Thread Diego Torres Milano
This post may contain useful information:
http://stackoverflow.com/questions/2461988/automated-testing-in-android-development

On Oct 4, 12:40 pm, Mark Murphy mmur...@commonsware.com wrote:
 On Mon, Oct 4, 2010 at 12:35 PM, kypriakos demet...@ece.neu.edu wrote:
  I didn't find much on this anywhere and I have a feeling it is not
  really possible but just in case - is there a way to launch the
  emulator remotely without the necessary GUI (I can do that
  using VNC etc. but it turns out to be too slow) and install/launch
  apps on it?

 Try -no-window on the emulator command:

 http://developer.android.com/guide/developing/tools/emulator.html#sta...

 I'm fairly sure this can be done, as I've seen others post here about
 operating in headless mode for continuous integration and test farms
 and such.

 --
 Mark Murphy (a Commons 
 Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy

 Android Training...At Your Office:http://commonsware.com/training

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


[android-developers] Re: How to configure SDK emulator to start with english instead of japanese?

2010-08-25 Thread Diego Torres Milano
This would help:
http://stackoverflow.com/questions/2417427/changing-the-android-emulator-locale-automatically

On Aug 25, 11:37 am, Kostya Vasilyev kmans...@gmail.com wrote:
   25.08.2010 19:28, { Devdroid } пишет: Hello all
    I'm new to Android development and have just startet playing with the 
   SDK.

    One thing that is annoying is that the emulator always start with 
   Japanese
    settings.
    I have found out how to fix this by going into settings and remove all 
   the
    Japanese stuff, but this is time consuming since I have to do it every 
   time
    I start the emulator.
  Simulator shall behave as regular OS and remember your settings. If you
  start if over, it will launch in the locale you configured last time (unless
  you doing something odd/wrong/tricky there)

 When you start the emulator, there is a check box labeled Wipe user data.

 As long as it's not set, the device settings persist from launch to
 launch. This way you only need to disable the Japanese IME once.

 --
 Kostya Vasilev -- WiFi Manager + pretty widget --http://kmansoft.wordpress.com

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


[android-developers] Re: ActivityInstrumentationTestCase2 issue

2010-03-11 Thread Diego Torres Milano
You have only one test in your class (testPlayMyMusic()), why are you
expecting results from two ?
OK (1 test) means your test succeeded.


On Mar 11, 10:28 am, perrot linca30...@gmail.com wrote:
 Hi,

 I am writing a Instrumnetation using the
 AvtivityInstrumnetationTestCase class and a test case about play
 music. When I execute the test case, it is work fine. But there the
 problem is the application play nothing. The Activity appear one
 moment then back to HOME screen.

 Reference my code:
 File: MainActivity.java

 -
 package  com.android.testapp;

 import android.app.Activity;
 import android.content.Context;
 import android.content.Intent;

 import android.os.Bundle;
 import android.util.Log;
 import android.media.AudioManager;
 import android.media.MediaPlayer;
 import android.media.MediaPlayer.OnCompletionListener;

 public class MainActivity extends Activity {

         /** Called when the activity is first created. */

         @Override

         public void onCreate(Bundle savedInstanceState) {

                 super.onCreate(savedInstanceState);
                 setContentView(R.layout.main);

         }

         public void PlayMyMusic(){
 //Pre set
                 AudioManager am=(AudioManager)
 getApplicationContext().getSystemService(AUDIO_SERVICE);
 try {
                         //Utility.PlayMusic(/storage/sample.mp3);

                         MediaPlayer mp = new MediaPlayer();
                         Log.e(debug,media player set data source...);
                         mp.setDataSource(/storage/sample.mp3);
                         Log.e(debug,media player set loop...);
                         mp.setLooping(true);

                         Log.e(debug,media player prepare...);
                         mp.prepare();
                         Log.e(debug,media player start...);
                         mp.start();
                         Log.e(debug,media player started...);
                         // i.e. react on the end of the music-file:
                         mp.setOnCompletionListener(new OnCompletionListener(){

                                 // @Override
                                 public void onCompletion(MediaPlayer arg0) {
                                         // File has ended !!!
                                 }
                         });
                 } catch (Exception e) {
                         Log.e(debug,media player error...+e.toString());
                         // TODO Auto-generated catch block
                         e.printStackTrace();
                 }

 }

 File:PlayMyMusic.java
 -
 package  test;

 import com.android.testapp.MainActivity;
 import android.test.ActivityInstrumentationTestCase2;
 import android.test.suitebuilder.annotation.MediumTest;

 public class PlayMyMusic extends
 ActivityInstrumentationTestCase2MainActivity {

         public PlayMyMusic() {

                 super(com.android.testapp, MainActivity.class);

         }

         public PlayMyMusic(String pkg, ClassMainActivity activityClass) {

                 super(pkg, activityClass);

         }

         @MediumTest

         public void testPlayMyMusic() throws Exception {

                 getActivity().PlayMyMusic();

         }

 }

 File:TestApp.Manifest
 -
 ?xml version=1.0 encoding=utf-8?
 manifest xmlns:android=http://schemas.android.com/apk/res/android;
         package=com.android.testapp android:versionCode=1
         android:versionName=1.0
         application android:icon=@drawable/icon android:label=@string/
 app_name
                 activity android:name=.MainActivity android:label=@string/
 app_name
                         intent-filter
                                 action 
 android:name=android.intent.action.MAIN /
                                 category 
 android:name=android.intent.category.LAUNCHER /
                         /intent-filter
                 /activity

                 uses-library android:name=android.test.runner /
         /application

         instrumentation android:targetPackage=com.android.testapp
                 android:name=android.test.InstrumentationTestRunner
 android:label=Test Unit Tests/instrumentation

         uses-permission android:name=android.permission.WRITE_SETTINGS/
 uses-permission
         uses-permission android:name=android.permission.INJECT_EVENT/
 uses-permission

         uses-permission android:name=android.permission.RESTART_PACKAGES/
 uses-permission
 /manifest
 -

 Type below command to run it.adb shell am instrument -e class 
 test.PlayMyMusic -w com.android.testapp/android.test.InstrumentationTestRunner

 -
 Command logcat to get the logadb logcat 

[android-developers] Re: edittext text with html formatting

2010-02-16 Thread Diego Torres Milano
This might be what you need: 
http://developer.android.com/intl/de/reference/android/text/util/Linkify.html

On Feb 16, 6:31 pm, Frank Weiss fewe...@gmail.com wrote:
 We see it. Since this is a volunteer mail list, you may not get an answer
 for hours or days. Chances are if the answer is plainly in the docs, no one
 may reply anyway...

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


[android-developers] Re: Where to correctly place xml containing data?

2010-02-01 Thread Diego Torres Milano
Place it undet /assets

On Jan 30, 10:22 pm, kaasinees cj.wijtm...@gmail.com wrote:
 Greetings humane, I come in peace.

 I have the following XML file which serves as database for my
 application.

 ?xml version=1.0 encoding=UTF-8?
 units
         category id=0 text=Length base=metre
                 unit name=metre ratio=1 /
                 unit name=mile ratio=0.0006213711922373339 /
         /category
         category id=1 text=Area
         /category
         category id=2 text=Volume
         /category
 /units

 I have placed this xml file under the src folder in my com package
 where my MainActivity resides.
 The compiler  however is giving me this following error:

 ERROR Invalid start tag units   units.xml       /univerter/src/com/shinyu/
 univerter       line 2  Android AAPT Problem

 My xml is not placed in the right place, i believe. Where can i
 correctly put it?

 Android 1.5, Java, Eclipse.

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


[android-developers] Re: unit testing

2010-01-25 Thread Diego Torres Milano
Hi Christine,
This presentation is very brief but could help:
http://www.slideshare.net/dtmilano/testing-on-android

On Jan 26, 12:44 am, Christine christine.kar...@gmail.com wrote:
 Thanks for the replies. Actually, I'm not stuck with testing, I use
 android unit testing and I'm quite satisfied with it. Right now I'm
 looking for a good intro on Android unit testing for a coworker.

 On Jan 26, 12:25 am, Fred Grott(Android 
 Expert,http://mobilebytes.wordpress.com)



 fred.gr...@gmail.com wrote:
  you can only use those mocks supplied by google Sdk..not mockkit..

  What areas are you getting stuck at?

  On Jan 25, 1:33 pm, ko5tik kpriblo...@yahoo.com wrote:

   On Jan 25, 5:38 pm, Christine christine.kar...@gmail.com wrote:

I need a reference to an introduction to Android unit testing for a
coworker, but the SDK docs don't seem to provide an introduction. I
myself used the apidemos and the api docs, but I was wondering if
there's a concise intro to Android unit testing?

   Well, there is at least some support for unit testing in IDEA plugin,
   but
   testing occurs only on device or emulator (sloow...)  - as
   libraries used
   to compile against contain merely stubs

   However,  you can employ mock frameworks ( I played around today )  -
   but you have to use something really powerfull ( I stuck with
   mockit ,
   as jmock has problems in mocking concrete final classes )

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


[android-developers] Re: creating activity-less packages

2010-01-21 Thread Diego Torres Milano
Both must be signed with the same signature.

On Jan 21, 5:40 pm, guiha...@gmail.com guiha...@gmail.com wrote:
 Well... Very strange that Android doesn't support the creation of
 application libraries...

 I putted this in the xml:

       android:sharedUserId=totalcross

 But when i run, i get INSTALL_PARSE_FAILED_BAD_SHARED_USER_ID

 Seems that it is not correctly formed... any tips of a valid shared
 user id?

 thanks

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

[android-developers] Re: Doc of java.util.Formatter. %$ available or not?

2010-01-21 Thread Diego Torres Milano
Use:

String.format(It is %d and %d again!, 10)


On Jan 21, 3:37 am, Farproc farp...@gmail.com wrote:
 http://d.android.com/reference/java/util/Formatter.html
 In the doc above there is The two characters $ immediately following
 the % sign indicate that the previous value should be used again
 instead of moving on to the next value argument.
 I tested it as String.format(It is %d and %$ again!, 10) but it
 throws. Any idea?
-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: integration testing with content provider

2009-12-22 Thread Diego Torres Milano
An alternative solution to the problem can be found at
http://dtmilano.blogspot.com/2009/12/android-testing-contentprovider.html.
Basically it creates a new class
ActivityAndContentProviderInstrumentationTestCase2T,P which
automates part of the process of writing integration tests of
Activities and ContentProviders using mock data.

Google Doc version can also be found at 
http://docs.google.com/View?id=ddwc44gs_221tm2kqmgp

On Dec 15, 4:58 am, tenacious fbeach...@gmail.com wrote:
 I've presented how I worked out a solution to this problem at my
 blog:  
 http://tenacious33.wordpress.com/2009/12/15/android-functional-testin...

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


[android-developers] Re: Select image resource dynamically

2009-12-19 Thread Diego Torres Milano
You can also use something like:

int rid = getResources().getIdentifier(fr, drawable, getPackageName
());

not the most efficient way but definitely something you can use.

On Dec 19, 6:16 pm, croco zeug...@gmail.com wrote:
 Hello Sergiu,

 I keep your hint in mind,

 for now i've  generated the mapping class. Maybe not the best way but
 it is sync with what i have in folder.

 Regards.

 Croco
 On Dec 19, 2:42 pm, Sergiu Dogaru creative.art@gmail.com wrote:



  you could try using Reflection, but that might be too complicated for
  what you need.
  What I would do is to place all of the images in the assets folder,
  where you can retrieve them by name.
  I think it's something like

  Bitmap bmp = BitmapFactory.decodeStream(getResources().getAssets
  ().openFile(fr.png));

  On Dec 19, 3:17 pm, croco zeug...@gmail.com wrote:

   Hi all,

   I'm facing a problem,

   I've added a folder of 350 images representing country flags in my
   project

   according the device country given by locale. Let's say fr for France

   I would like set an image with fr.png which is in the res/drawable
   folder. How to achieve this without maintaining an ugly map in the
   code saying fr = R.drawable.fr etc etc .

   Thank you for your help.

   Croco

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


[android-developers] Re: Problem running Android jUnit tests on Android project with multiple included auxiliary projects

2009-11-18 Thread Diego Torres Milano
You should create jars for your libraries and include them in
project's Properties - Java Build Path - Libraries.
Hope this helps.

--
Have you read my blog ?
http://dtmilano.blogspot.com
android junit tests ui linux cult thin clients

On Nov 18, 6:30 am, emitya dkolega...@gmail.com wrote:
 Hi,

 I have a question on the project set-up - this may be a bug in SDK.

 I cannot run android junit tests for classes sitting in main android
 project that implement interfaces that reside in other included
 projects. Depending on SDK version I get different errors: from Test
 run failed: on 1.5 and 1.6 and spurious process death to a more
 polite NoClassDefFoundError on SDK 2.0. This happens only on
 instantiation of classes that reside in the Android project and
 implement interfaces residing outside that android project. There is
 no problem instantiating classes that do not fall into this category
 (i.e. android only or library only classes).

 Android project by itself works fine with these classes - it is just
 the test set-up doesn't and project inclusion/classpath seems to be
 ok. Test project includes all projects that main project includes.
 NoClassDefFoundError makes little sense here given that the
 classloader can see and instantiate classes sitting right next to the
 ones that do not work.

 Did anyone else run into this or found a way to set-up android based
 tests in a multi-project set-up?

 Below is more detailed set-up and test explanation:

 1)
 Library project: FooLib
 public interface IFoo {
 ...}

 public class FooImpl implements IFoo {
 ...

 }

 2)
 Main project: AndroidFoo
 public class FooAndroidImpl implements IFoo {
 ...}

 public class Bar {
 ...

 }

 3)
 Test Project: AndroidFooTest
 public class FooTester extends AndroidTestCase  {

   // breaks
   void test1AndroidImplWithInterfaceInLibraryProject() {
      Object o = new FooAndroidImpl();   // Gets NoClassDefFoundError
 on SDK 2.0 and obscure Test run failed on 1.6 and 1.5
    }

   // works
   void test2AndroidOnly() {
      Object o = new Bar();   // works fine - no exceptions even
 though the class sits in the same package as the one that was throwing
 exceptions in case 1
    }

   // works
   void test3LibraryProjectOnly() {
      Object o = new FooImpl();   // works fine - no exceptions even
 though the class sits in the same package as interface of the test1
    }

 }

 Thanks in advance.

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


[android-developers] Re: installing Android 1.6+ on headless Linux server

2009-11-15 Thread Diego Torres Milano
It seems to be a bug in android command (sdkmanager) and sometimes
it's ignoring command line arguments:

+ exec java -Xmx256M -Djava.ext.dirs=/opt/android-sdk/tools/lib/x86:/
opt/android-sdk/tools/lib -Dcom.android.sdkmanager.toolsdir=/opt/
android-sdk/tools -jar /opt/android-sdk/tools/lib/sdkmanager.jar
update sdk
No command line parameters provided, launching UI.
See 'android --help' for operations from the command line.



On Nov 15, 2:32 am, azad azadbol...@bolour.com wrote:
 Hi,

 I am not sure how to install Android 1.6+ on a headless Linux server.
 Our continuous integration build machine is a headless server in the
 cloud.

 Following the instructions, I downloaded android-sdk_r3-linux.tgz,
 untarred it, added its location to my path, and tried to update. This
 what I got:

 
 r...@savendipity:/usr/local/share/android-sdk-linux/tools# android
 update sdk

 No command line parameters provided, launching UI.
 See 'android --help' for operations from the command line.

 Exception in thread main java.lang.UnsatisfiedLinkError: no swt-pi-
 gtk-3550 or swt-pi-gtk in swt.library.path, java.library.path or the
 jar file

 + stack trace
 

 I don't know whether this message means that it is not possible to
 update the SDK without a GUI, that my command line is wrong, or that
 my environment is missing something that would allow me to install
 from the command line.

 Would appreciate instructions on how to install 1.6+ on a headless
 linux server.

 Thanks in advance for your help.

 Azad

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


[android-developers] Re: how to know if it the emulator or device

2009-11-04 Thread Diego Torres Milano
As Dianne mentioned assuming that because there's no wifi you are
running on the emulator is a bit risky. There could be real phones
with no wifi and emulator emulating wifi.
Stick to any of the other methods.

On Nov 4, 6:19 am, Zhihong GUO gzhh...@gmail.com wrote:
 It can not work. There is no exception throws and the wifiManager returned
 can be used as wifiManager.isEnabled()

 2009/11/4 Dianne Hackborn hack...@android.com

  On Tue, Nov 3, 2009 at 11:10 AM, Roman ( T-Mobile USA) 
  roman.baumgaert...@t-mobile.com wrote:

  Furthermore the API call

   (WifiManager)mContext.getSystemService(mWifiService);

  gives you an exception on the Emulator which is an indication that
  Wifi radio is not supported.

  That's only because it doesn't happen to currently be implemented in the
  emulator.  This could very well change in the future.

  --
  Dianne Hackborn
  Android framework engineer
  hack...@android.com

  Note: please don't send private questions to me, as I don't have time to
  provide private support, and so won't reply to such e-mails.  All such
  questions should be posted on public forums, where I and others can see and
  answer them.

   --
  You received this message because you are subscribed to the Google
  Groups Android Developers group.
  To post to this group, send email to android-developers@googlegroups.com
  To unsubscribe from this group, send email to
  android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com
  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 android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Why do screenshot utilities require rooting?

2009-10-18 Thread Diego Torres Milano

Because /dev/graphics/fb0 is only readable by root and graphics group
for security reasons, you may read other apps screens otherwise.

On Oct 18, 12:01 pm, Paolo Amoroso paolo.amor...@gmail.com wrote:
 Why do Android screenshot utilities only work on rooted devices? Linux
 distributions and desktop environments provide user-space screen
 capture tools. Why can't Android? I wonder what are the technical
 issues, if any, that prevent this.

 The only user-space procedure I am aware of, i.e. installing about 1
 GB worth of development tools on a PC, hooking it to an Android device
 via USB, and disabling some of its funzionality (e.g. SD card access),
 is not user-friendly.

 Paolo Amoroso
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Sometimes the running emulator is not found from within Eclipse?!

2009-10-12 Thread Diego Torres Milano

+1 (Linux)

On Oct 12, 2:55 am, idoun idou...@gmail.com wrote:
 I have also same problem after upgrading the plugin to 0.9.3

 On Oct 10, 10:31 pm, Mariano Kamp mariano.k...@gmail.com wrote:

  Hi,

    when launching my app from within Eclipse, sometimes the running emulator
  is found and displayed in the launch dialog, sometimes it isn't?! Killing
  adb, the emulator and Eclipse usually helps ... until it happens again.

    Any idea why this is? I see this behavior since the launch of Android.

    I am running on Mac OS X. And it happened on Leopard as well as Snow
  Leopard.

  Cheers,
  Mariano


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



[android-developers] Re: **never ever** use Toasts with Activity context

2009-07-07 Thread Diego Torres Milano

This is fine. Thanks for the info.
However, I've been writing some tests using
ActivityInstrumentationTestCase2 and an Activity that depending on an
extra parameter displays the Toast or not, and the results seems to be
different.
If the Toast is displayed the instance count constantly increases but
if the Toast is not displayed it remains controlled.
Details and code can be found here:
http://dtmilano.blogspot.com/2009/07/android-testing-on-android-platform-is.html
Comments, suggestions and corrections are gladly welcome.


On Jul 7, 1:27 am, Romain Guy romain...@google.com wrote:
 There is no leak, I just verified myself. Your call to System.gc()
 does NOT guarantee that the GC will run. To check for leaks here is
 the procedure:

 - Run the app
 - Run adb shell dumpsys meminfo | grep -A 12 name.of.the.app.processs
 - Look at the count of Activities and ViewRoots
 - Run DDMS
 - Force a GC on the app's process
 - Force a GC on system_server
 - Force a GC on the app's process
 - Run adb shell dumpsys meminfo | grep -A 12 name.of.the.app.processs
 - Look at the count of Activities and ViewRoots
 (Repeat these steps)

 You will see that while the number of Activities/ViewRoot does
 increase temporarily, it always goes back down the normal numbers.



 On Mon, Jul 6, 2009 at 3:01 PM, skinkpsk...@gmail.com wrote:

  On Jul 6, 6:33 pm, skink psk...@gmail.com wrote:
  however i read Toast's api docs again and found that ctor and/or
  makeText can use Activity context... so now i'm a bit lost here: is it
  a bug in Toast or docs shoukd be updated?

  thanks
  pskink

  hi,

  is it possible that nobody uses Toasts?

  can i consider memory leaks when passing Activity ctx as a bug (and it
  will be fixed in some future release) or i have to change ctx to app
  context?

  thanks
  pskink

 --
 Romain Guy
 Android framework engineer
 romain...@android.com

 Note: please don't send private questions to me, as I don't have time
 to provide private support.  All such questions should be posted on
 public forums, where I and others can see and answer them
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: value @ /sys/class/lightsensor/switch_cmd/lightsensor_file_cmd is getting lost

2009-06-26 Thread Diego Torres Milano

/sys is a virtual filesystem, it doesn't persist reboots.

On Jun 26, 12:18 pm, Shang Hao sahilz...@gmail.com wrote:
 Hi,

 I am storing a byte stream @

 /sys/class/lightsensor/switch_cmd/lightsensor_file_cmd

 but on reboot, the value over here is getting lost. How do i
 recover

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



[android-developers] Re: Not getting more than one GPS fix on Android 1.5 emulator

2009-05-22 Thread Diego Torres Milano

I've seen this problem before however no clues about the cause.
As a workaround, you may load a KML file in DDMS and play it. If you
need to convert a KMZ to KML suitable for DDMS check
http://dtmilano.blogspot.com/2008/12/in-this-previous-post-we-reviewed.html.
I haven't had luck loading GPX either.
Hope that helps.

On May 21, 11:32 pm, Anshul aaj...@gmail.com wrote:
 I have a GPS app that gets the GPS fixes and prints it in the ADB
 logs. The app was working fine with 1.1 SDK. WIth 1.5 SDK emulator I
 see that the app does not  receive any location updates after
 receiveing the 1st location. I have LocationListener as well as
 GPSStatusListener aded to my code and none of the listeners gets
 called. SO my app kind of waits forever for the next location or an
 error.

 05-21 23:27:35.554: ERROR/fta_gps(740): gpsTest.java:
 438:onGpsStatusChanged, event 3
 05-21 23:27:36.564: INFO/fta_gps(740): gpsTest.java:
 294:onLocationChanged
 05-21 23:27:36.583: INFO/fta_gps(740): gpsTest.java:581:TimeStamp is:
 Dec 31, Wed
 05-21 23:27:36.593: INFO/fta_gps(740): gpsTest.java:551:DateStamp is:
 11:59:59pm 1969
 05-21 23:27:36.724: INFO/fta_gps(740): gpsTest.java:359:Location
 changed : Latitude: 38.99941 Longitude: -77.08595 Altitude: 0.0 Speed:
 0.0

 And then no more message related to the GPS.

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



[android-developers] Re: Accessing sdcard filesystem through dev machine filesystem - possible?

2009-05-10 Thread Diego Torres Milano



On May 10, 8:20 am, Raphael r...@android.com wrote:
 The original post is about an sdcard image, so I guess this is
 emulator related. An emulator sdcard is a FAT32 filesystem so you
 should be able to mount it using mount under linux if you have a fat32
 support module. Under Windows or Mac there are probably ways to do
 that too.

In Linux:

$ mkdir /tmp/sdcard; sudo mount -o loop sdcard.img /tmp/sdcard


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



[android-developers] Re: SDK 1.5, Unable to load XML wizard

2009-04-21 Thread Diego Torres Milano

I think that the problem is related with the menu New-Other...-
Android-Android XML File which gives the unable to load class...
message but not with the new Android XML wizard button in the toolbar
which works, at least in my case.

On Apr 20, 9:48 am, iceberg perfectotrave...@gmail.com wrote:
 I dont know why my previous post didnt appear. I have the same build
 as Raphael, but wizards dont work for me.

 Maybe good possibility is to release bundled Eclipse+ADT version. What
 do you think about this ?

 On Apr 15, 10:48 am, stefan.jau...@googlemail.com

 stefan.jau...@googlemail.com wrote:
  I have it also

  On 14 Apr., 15:43, Al alcapw...@googlemail.com wrote:

   I'm trying to make a new XML file and have selected New-Android XML
   File, but each time I get this message:

   The selected wizard could not be started.
   Plug-in com.android.ide.eclipse.adtwas unable to load class
   com.android.ide.eclipse.editors.wizards.NewXmlFileWizard.
   com.android.ide.eclipse.editors.wizards.NewXmlFileWizard

   The problem is only with the XML file creator, I can create a new
   Android Project fine. I'm usingADT0.9 Pre release and have installed
   it as per the instructions on the doc page.


--
Have you read my blog ?
http://dtmilano.blogspot.com
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: How to make a video of the emulator ?

2009-04-20 Thread Diego Torres Milano

I've recorded several videos for my blog (http://
dtmilano.blogspot.com) using xvidcap, which probably is in your
distribution's repositories too (I'm using ubuntu).
xvidcap supports all of these output formats:

 X11 Window Dump (.xwd)
 Portable Graymap File   (.pgm)
 Portable Anymap File(.ppm)
 Portable Network Graphics File  (.png)
 Joint Picture Expert Group  (.jpg, .jpeg)
 Microsoft Audio Video Interleaved File  (.avi)
 General AVI file (DIVX default) (.mpeg, .mpg)
 Microsoft Advanced Streaming Format (.asf)
 Macromedia Flash Video Stream   (.flv, .flv1)
 Macromedia Shockwave Flash File (.swf)
 DV Video Format (.dv)
 MPEG1 System Format (.m1v, .vcd)
 MPEG2 PS Format (.m2v, .svcd)
 Quicktime Format(.mov, .qt)

and it's very easy to use.

On Apr 20, 4:30 pm, Nanard bsegon...@free.fr wrote:
 Thanks

 On 20 avr, 16:21, Mark Murphy mmur...@commonsware.com wrote:





   I am using Linux (Mandriva).  How can I make a video (with sound) of
   the emulator ?

  You could try using Linux screencast software. Search on the following in
  your favorite search engine:

  linux screencast

  You will get many hits, talking about Istanbul, recordmydesktop, and many
  others. Some, if not most, of these should be able to record the Android
  emulator as seen on the Linux desktop.

  --
  Mark Murphy (a Commons Guy)http://commonsware.com
  _The Busy Coder's Guide to Android Development_ Version 2.0 Available!


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



[android-developers] Re: Access the environment variable in java layer

2009-03-27 Thread Diego Torres Milano



On Mar 27, 4:07 pm, Michael MacDonald googlec...@antlersoft.com
wrote:
 Environmentvariables will only be visible in processes descending from
 the process that sets them.  Since the app processes in android aren't
 spawned from your daemon, you won't be able to see theenvironment
 variables there.

 Charles Lu wrote:
  Hi,

      I wish to get theenvironmentvariable which is set by a daemon in
  native but failed. Some details:
  in the daemon, which is started by root
  setenv(MY_NAME, name, 1);

  in java code, which is started by system
  String name = System.getenv(MY_NAME);

    Could anybody give some suggestion?

Using daemon's PID you can do

Process pr = Runtime.getRuntime().exec(cat /proc/ + pid + /
environ);

and obtain the environment in pr.getInputStream().

  Thanks
  Charles


--
Have you read my blog ?
http://dtmilano.blogspot.com
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: can not call a java method from javascript using addJavascriptInterface()

2009-03-17 Thread Diego Torres Milano

You should call window.test.incr(100) instead.


--
Have you read my blog ?
http://dtmilano.blogspot.com


On Mar 17, 4:28 am, sherwin huang sherwin@gmail.com wrote:
 hi
 I'm trying to call a java method from javascript using
 addJavascriptInterface();
 but seems does not work, it always  display failure;
  java code:
  public class WebTest extends Activity {
     /** Called when the activity is first created. */
     @Override
     public void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);

         WebView webview = new WebView(this);
         webview.getSettings().setJavaScriptEnabled(true);

  webview.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);
         webview.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);
         webview.setClickable(true);
         TestJs ts = new TestJs();
         webview.addJavascriptInterface(ts, test);

         webview.loadUrl(file:///data/1.html);

         setContentView(webview);

     }}

  public class TestJs {

 public int incr(int num){
 return num+1;

 }
 }

 html:
 html
 head
 script type=text/javascript
 function loader() {
 document.write(begin);
 document.write(p);
 document.write(window.test);
 document.write(p);
  if(window.test){
 document.write(success);
 document.write(p);
 document.write(test.incr(100));}else{

 document.write(failure);
 document.write(p);

 }
 }

 /script
 /head
 body onload=loader()
 /body
 /html

  Thanks in advance for your help!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Repo Client init problem ubuntu 8.10

2009-03-16 Thread Diego Torres Milano

repo should check for git.
Try applying this patch.

diff -up ./repo.ORI ./repo
--- ./repo.ORI  2009-03-16 13:09:46.0 +0100
+++ ./repo  2009-03-16 13:15:50.0 +0100
@@ -202,7 +202,11 @@ def _Init(args):

 def _CheckGitVersion():
   cmd = [GIT, '--version']
-  proc = subprocess.Popen(cmd, stdout=subprocess.PIPE)
+  try:
+ proc = subprocess.Popen(cmd, stdout=subprocess.PIPE)
+  except OSError, ex:
+ print sys.stderr, 'fatal: %s running %s' % (ex,  .join
(cmd))
+ sys.exit(1)
   ver_str = proc.stdout.read().strip()
   proc.stdout.close()
   proc.wait()



On Mar 15, 6:30 am, Jean-Baptiste Queru j...@android.com wrote:
 Sounds like you don't have git installed on your system.

 JBQ



 On Wed, Mar 11, 2009 at 7:03 PM, doubleslash doublesl...@gmail.com wrote:

  I have the same problem. I tried curl and verified indeed the whole
  python script was downloaded. I installed libreadline5-dev instead of
  lib32readline5.dev because my computer could not find the latter. I
  cannot initilize repo. Can someone help?

  On Jan 30, 5:15 am, Bernhard wst.lordf...@gmail.com wrote:
  Same Problem here:
  i flowed the instrcutions 
  at:http://docs.google.com/View?docid=ajdmx8kfg357_81cmpr56f6
  VMware with Ubuntu 8.10
  ---
  m...@desktop:~/eee$ repo init -u 
  git://android.git.kernel.org/platform/manifest.git
  Traceback (most recent call last):
    File /bin/repo, line 590, in module
      main(sys.argv[1:])
    File /bin/repo, line 557, in main
      _Init(args)
    File /bin/repo, line 176, in _Init
      _CheckGitVersion()
    File /bin/repo, line 205, in _CheckGitVersion
      proc = subprocess.Popen(cmd, stdout=subprocess.PIPE)
    File /usr/lib/python2.5/subprocess.py, line 594, in __init__
      errread, errwrite)
    File /usr/lib/python2.5/subprocess.py, line 1153, in
  _execute_child
      raise child_exception
  OSError: [Errno 2] No such file or directory
  ---

 --
 Jean-Baptiste M. JBQ Queru
 Android Engineer, Google.

 Questions sent directly to me that have no reason for being private
 will likely get ignored or forwarded to a public forum with no further
 warning.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Does android support Google Gear?

2009-03-12 Thread Diego Torres Milano



On Mar 10, 9:34 pm, Mark Murphy mmur...@commonsware.com wrote:
 ying lcs wrote:
  By dumping the content, I mean displaying what are the database
  column, database row content.

  Is that possible on the emulator?   by opening a shell to it and run
  some commands?
It's possible.
For example, after running Gears Database Demo and entering some
values into it opn the emulator and
# cd /data/data/com.android.browser/gears/code.google.com/http_80
# # sqlite3 'database-demo#database' !
 select * from Demo;
 !
Heel|1236894032405
This is|1236894036105
Gears|1236894040152


 The sqlite3 command is built into the emulator, and you can use it and
 .dump to dump a database's contents. Please refer to the SQLite
 documentation for details on sqlite3:

 http://sqlite.org

 --
 Mark Murphy (a Commons Guy)http://commonsware.com
 _The Busy Coder's Guide to Android Development_ Version 2.0 Published!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Need help in running the android junit test case for andriod APIDemo in eclipse

2009-01-29 Thread Diego Torres Milano

This may help you 
http://dtmilano.blogspot.com/2008/11/android-testing-on-android-platf.html


On Jan 29, 1:55 am, ying...@gmail.com ying...@gmail.com wrote:
 Hi,

 I am trying to run Junit test case for the android APIDemo project
 under eclipse.

 I create an eclipse project from the APIDemo source, it compiles fine
 and then I did:
 1. Debug-Run as Junit tests

 But I get this error:
 'Lanuching AllTests' has encountered a problem.
 Cannot connect to VM.

 And I find this in the .log file in eclipse:
 !ENTRY org.eclipse.core.net 1 0 2009-01-28 15:03:52.799
 !MESSAGE System property http.nonProxyHosts has been set to
 local|*.local|169.25
 4/16|*.169.254/16 by an external source. This value will be
 overwritten
 using th
 e values from the preferences

 !ENTRY org.eclipse.jdt.launching 4 120 2009-01-28 15:04:03.269
 !MESSAGE Cannot connect to VM
 !STACK 0
 java.net.SocketException: Socket closed
         at java.net.PlainSocketImpl.socketAccept(Native Method)
         at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:384)
         at java.net.ServerSocket.implAccept(ServerSocket.java:450)
         at java.net.ServerSocket.accept(ServerSocket.java:421)
         at
 org.eclipse.jdi.internal.connect.SocketTransportService.accept(Socket
 TransportService.java:95)
         at
 org.eclipse.jdi.internal.connect.SocketTransportImpl.accept(SocketTra
 nsportImpl.java:56)
         at
 org.eclipse.jdi.internal.connect.SocketListeningConnectorImpl.accept(
 SocketListeningConnectorImpl.java:135)
         at
 org.eclipse.jdt.internal.launching.StandardVMDebugger$ConnectRunnable
 run(StandardVMDebugger.java:107)
         at java.lang.Thread.run(Thread.java:613)

 !ENTRY org.eclipse.jdt.launching 4 120 2009-01-28 15:23:53.932
 !MESSAGE Cannot connect to VM
 !STACK 0
 java.net.SocketException: Socket closed
         at java.net.PlainSocketImpl.socketAccept(Native Method)
         at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:384)
         at java.net.ServerSocket.implAccept(ServerSocket.java:450)
         at java.net.ServerSocket.accept(ServerSocket.java:421)
         at
 org.eclipse.jdi.internal.connect.SocketTransportService.accept(Socket
 TransportService.java:95)
         at
 org.eclipse.jdi.internal.connect.SocketTransportImpl.accept(SocketTra
 nsportImpl.java:56)
         at
 org.eclipse.jdi.internal.connect.SocketListeningConnectorImpl.accept(
 SocketListeningConnectorImpl.java:135)
         at
 org.eclipse.jdt.internal.launching.StandardVMDebugger$ConnectRunnable
 run(StandardVMDebugger.java:107)
         at java.lang.Thread.run(Thread.java:613)

 Thank you for any help.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: How to build test apk

2008-12-02 Thread Diego Torres Milano

This may help you
http://dtmilano.blogspot.com/2008/11/android-testing-on-android-platf.html

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
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
-~--~~~~--~~--~--~---



[android-developers] Mobile Dev Camp

2008-11-24 Thread Diego Torres Milano

I was kindly invited by Bubble Foundry's Peter Robinett to give a
workshop on Android at Mobile Dev Camp this 29th November 2008 in
Amsterdam.
We will be introducing the Android platform and how to start
developing applications keeping an eye on Test Driven Development.
More information and registration can be found at http://www.mobiledevcamp.nl
and http://dtmilano.blogspot.com

Looking forward to seeing you.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
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
-~--~~~~--~~--~--~---



[android-developers] Re: Referencing an entry from colors.xml?

2008-11-19 Thread Diego Torres Milano



On Nov 19, 2:14 am, Dianne Hackbod [EMAIL PROTECTED] wrote:
 Don't do the '+'.  Just reference it with '@colors/clr_edit_hilite'.

AFAIK is color (singular) not colors (plural) what you have to use


 On Tue, Nov 18, 2008 at 3:30 PM, Diego Torres Milano [EMAIL PROTECTED]wrote:





  On Nov 18, 4:00 pm, Mark Wyszomierski [EMAIL PROTECTED] wrote:
   Hi,

   I  defined a colors.xml file in my values folder, with the following
   contents:

       resources
           color name=clr_edit_hilite#FFD9FF77/color
       /resources

   How do I reference it from a layout.xml file?

       TextView android:id=@+id/test
                   android:textColor=@+colors/clr_edit_hilite
  android:textColor=@color/clr_edit_hilite
                   /

   Is that the right way?

   Thanks

 --
 Dianne Hackborn
 [EMAIL PROTECTED]
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
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
-~--~~~~--~~--~--~---



  1   2   >