[android-developers] Problems to access to Android Screenshot Library from an IntentService

2015-03-12 Thread Jonathan Chacón Barbero
Hello,



I am still developing an App to take screenshots from a service in background. 
I decided to install Android Screenshot library from ADB.
But now the problem is this:

When I try to connect to Android Screenshot library (AsL) from an IntentService 
using this code I get a null pointer exception:
try {
bindService (new Intent(pl.polidea.asl.ScreenshotService.BIND), aslServiceConn, 
Context.BIND_AUTO_CREATE);
} catch (Exception e) {
Log.e(TAG, e.toString());
}

How can I access to a Bind service from an Intent service?

Regards
Jonathan Chacón
Jonathan Chacón
Accesibilidad tecnológica, estudios e I+D+i
Investigador
Tel: 91 121 03 30
Email: jcha...@consultoria.ilunion.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
--- 
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.


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

2015-03-12 Thread Jonathan Chacón Barbero
Thank you. I'll check it

 El 11/3/2015, a las 16:25, Diego Torres Milano dtmil...@gmail.com escribió:
 
 If you can do it from a computer with AndroidViewClient/culebra 
 (https://github.com/dtmilano/AndroidViewClient 
 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 
 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 
 mailto:android-developers+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout 
 https://groups.google.com/d/optout.

-- 
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.