Comment on fullscreenwrapper2 in python-for-android

321 views
Skip to first unread message

python-fo...@googlecode.com

unread,
Aug 5, 2012, 2:30:59 AM8/5/12
to python-fo...@googlegroups.com
Comment by chs200...@gmail.com:

Will this work in python 3 yet?

For more information:
http://code.google.com/p/python-for-android/wiki/fullscreenwrapper2

python-fo...@googlecode.com

unread,
Aug 5, 2012, 12:40:48 PM8/5/12
to python-fo...@googlegroups.com
Comment by srina...@gmail.com:

based on some quick testing... not quite there yet. However, i did keep
Python 3 support in mind while writing this & so it already uses new style
classes, iter access to dicts instead of lists etc... so hopefully can iron
out the compatibility issues & release a py3 supporting version shortly.

python-fo...@googlecode.com

unread,
Aug 5, 2012, 12:43:08 PM8/5/12
to python-fo...@googlegroups.com
Comment by srinathd...@gmail.com:

based on some quick testing... not quite there yet. However, I did keep
Python3 support in mind while building this and so it already uses new
style classes, iters to loop over dict vs. lists etc needed in python 3...
So hopefully can iron out the remaining compatibility issues & release py3

python-fo...@googlecode.com

unread,
Aug 5, 2012, 1:44:44 PM8/5/12
to python-fo...@googlegroups.com
Comment by srinathd...@gmail.com:

Update: a
[http://python-for-android.googlecode.com/hg/sl4atools/fullscreenwrapper2/py3/fullscreenwrapper2_py3.py
working Python3 compatible version] of FullScreenWrapper2 is now available.
The Python3 compatible module name is *fullscreenwrapper2_py3*

I have tested the example scripts fullscreenwrapper2demo.py &
gyro_sl4a_test.py with this version on Python 3 for R6 and found them
working properly. The port could do with more testing however - pls do test
& share feedback/issues if any.

python-fo...@googlecode.com

unread,
Aug 11, 2012, 1:31:59 AM8/11/12
to python-fo...@googlegroups.com
Comment by radical....@gmail.com:

I've been waiting for something like this for a long, long time. Noticed
that the sample apps don't use native GUI elements, though, like buttons.
Will this change in the future?

For more information:
https://code.google.com/p/python-for-android/wiki/fullscreenwrapper2

python-fo...@googlecode.com

unread,
Aug 11, 2012, 2:30:36 AM8/11/12
to python-fo...@googlegroups.com
Comment by srinathd...@gmail.com:

Thanks! BTW, the apps DO use native android elements exclusively (Button,
TextView, ListView etc.)... that's the purpose of FullScreenUI functions in
SL4A and you can find these in the XML layout strings (you should be able
to take layouts from Android java apps use them with minimal modification -
eg. hard coding strings)

It's just that given SL4A's architecture based on socket communication, you
cannot really have the *same* programmatic/object access. What
FullScreenWrapper2 tries to do is to give you an emulated intuitive
programmatic/object-like access to your Views and event handling to
simplify programming so you don't need to directly deal with SL4A event and
full screen functions. The limitation of SL4A's FullScreenUI architecture
is that you can create your views only through loading XML layouts and not
programmatically at any time.

anthony prieur

unread,
Aug 11, 2012, 4:45:04 AM8/11/12
to python-fo...@googlegroups.com
> It's just that given SL4A's architecture based on socket communication

I was wonderding, what mechanism is used between Webview and
JavaScriptInterface, AIDL ?

python-fo...@googlecode.com

unread,
Sep 4, 2012, 7:22:42 PM9/4/12
to python-fo...@googlegroups.com
Comment by aod...@gmail.com:

Cool! Is there a perl version?

python-fo...@googlecode.com

unread,
Sep 5, 2012, 10:31:55 AM9/5/12
to python-fo...@googlegroups.com
Comment by srinathd...@gmail.com:

would be very nice to have :-)
my personal skills in perl are zero however... I'm more than willing to
actively help etc if someone's interested & willing to port this to perl.
The framework is not very complicated.

Robbie Matthews

unread,
Sep 13, 2012, 7:18:31 PM9/13/12
to python-fo...@googlegroups.com
See here:
http://code.google.com/p/android-scripting/wiki/FullScreenUI#Images

You need to use a fully qualified file url, ie:
droid.fullSetProperty("imageView1","src","file:///sdcard/download/panda72.png")

Robbie

On Wed, Sep 12, 2012 at 5:05 PM, Michael Stover <hakug...@gmail.com> wrote:
I am fairly new to programming anything for Android so I am not 100% sure if I'm doing this correctly or just simply missing something.
What I am trying to do is add a .png to a button as a background, I assumed I could put the .png in the same folder as the main python file and change:

android:background="#ff66a3d2"  to  android:background="@<image>.png"

To my dismay it seems my logic is missing something crucial with this, and due to my lack of experience with attempting an interface using xml, and especially xml on Android through sl4a/Python for Android.



--

Beginning Android Tablet Programming

  • Publication Date: November 2, 2011
  • ISBN13: 978-1-4302-3783-9

Robbie Matthews gives a full, no-holds barred introduction to Android  programming for tablets. No previous experience required! Learn More …

Beginning Android Tablet Programming


python-fo...@googlecode.com

unread,
Sep 27, 2012, 8:36:19 PM9/27/12
to python-fo...@googlegroups.com
Comment by slez...@dosalinfinito.com.ar:

Wonderful!, I'm using it on my last project and it is very simple, it is
possible to assemble a view without xml and adding controls
programmatically, only with code?. Thanks for share this great project!

python-fo...@googlecode.com

unread,
Nov 27, 2012, 2:25:50 AM11/27/12
to python-fo...@googlegroups.com
Comment by Tennis1...@gmail.com:

Sorry to bother, but I am a beginner programmer (freshman in college with
intermediate experience in python and xml) and I am not entirely sure how
to create multiple layouts. I have my main screen, but when I hit a button
on this screen, I wish to load a new layout screen (with a return button to
the original screen). Would you be able to advise me on how this is done.

Robbie Matthews

unread,
Nov 27, 2012, 6:14:42 PM11/27/12
to Py4A
Using fullscreen, just load up a different xml layout.
Is the question about how to load up a different xml, or how to react to the button ?

Hariharan Srinath

unread,
Nov 28, 2012, 10:01:11 PM11/28/12
to python-fo...@googlegroups.com

Hi,

As an example take a look @ the code here... http://code.google.com/p/python-for-android/source/browse/sl4atools/fullscreenwrapper2/examples/calcount2_example.zip

It loads a new layout for taking user input on clicking a button in the main screen and then goes back once input is complete.

Best regards
Srinath

python-fo...@googlecode.com

unread,
Jan 27, 2013, 10:22:10 AM1/27/13
to python-fo...@googlegroups.com
Comment by arunelis...@gmail.com:

Does it support xml styles and themes? because i was not able to change
button background color of the button.

python-fo...@googlecode.com

unread,
May 8, 2013, 8:56:16 AM5/8/13
to python-fo...@googlegroups.com
Comment by ipods...@126.com:

A GUI Framework developing full screen apps using FullScreenUI API in SL4A

Source(s): http://downloadranking.com/support.php

python-fo...@googlecode.com

unread,
May 22, 2013, 10:11:24 AM5/22/13
to python-fo...@googlegroups.com
Comment by xenosen...@gmail.com:

The calcount2_example.zip on the repository seems corrupted. Would you have
a valid one that I could get somewhere ?
Thanks

chris clark

unread,
May 22, 2013, 11:21:33 PM5/22/13
to python-fo...@googlegroups.com, codesite...@google.com, python-fo...@googlecode.com

http://code.google.com/p/python-for-android/source/browse/sl4atools/fullscreenwrapper2/examples/calcount2_example.zip tests OK for me:
~/Downloads$ 7z t calcount2_example.zip

7-Zip 9.20  Copyright (c) 1999-2010 Igor Pavlov  2010-11-18
p7zip Version 9.20 (locale=en_US.UTF-8,Utf16=on,HugeFiles=on,2 CPUs)

Processing archive: calcount2_example.zip

Testing     calcount2_example
Testing     calcount2_example/calcount2.py
Testing     calcount2_example/caloriesdb.py
Testing     calcount2_example/data
Testing     calcount2_example/data/caloriesdb.db3
Testing     calcount2_example/datetimehelpers.py
Testing     calcount2_example/fullscreenwrapper2.py
Testing     calcount2_example/pathhelpers.py
Testing     calcount2_example/peewee.py
Testing     calcount2_example/res
Testing     calcount2_example/res/drawable
Testing     calcount2_example/res/drawable/0.png
Testing     calcount2_example/res/drawable/10.png
Testing     calcount2_example/res/drawable/100.png
Testing     calcount2_example/res/drawable/110.png
Testing     calcount2_example/res/drawable/120.png
Testing     calcount2_example/res/drawable/130.png
Testing     calcount2_example/res/drawable/140.png
Testing     calcount2_example/res/drawable/150.png
Testing     calcount2_example/res/drawable/160.png
Testing     calcount2_example/res/drawable/170.png
Testing     calcount2_example/res/drawable/180.png
Testing     calcount2_example/res/drawable/190.png
Testing     calcount2_example/res/drawable/20.png
Testing     calcount2_example/res/drawable/200.png
Testing     calcount2_example/res/drawable/30.png
Testing     calcount2_example/res/drawable/40.png
Testing     calcount2_example/res/drawable/50.png
Testing     calcount2_example/res/drawable/60.png
Testing     calcount2_example/res/drawable/70.png
Testing     calcount2_example/res/drawable/80.png
Testing     calcount2_example/res/drawable/90.png
Testing     calcount2_example/res/drawable/logo.png
Testing     calcount2_example/res/layout
Testing     calcount2_example/res/layout/addmealscreen.xml
Testing     calcount2_example/res/layout/main.xml
Testing     calcount2_example/srinath_path_utils.py

Everything is Ok

Folders: 5
Files: 32
Size:       234663
Compressed: 123106

I downloaded using Firefox.
 

python-fo...@googlecode.com

unread,
Sep 24, 2013, 11:00:04 AM9/24/13
to python-fo...@googlegroups.com
Comment by wrsau...@gmail.com:

If you are trying to download the zip file of everything, try this link
instead of the provided one (it includes a working calcount example):
http://python-for-android.googlecode.com/hg/sl4atools/fullscreenwrapper2/fullscreenwrapper2_everything.zip

python-fo...@googlecode.com

unread,
Feb 1, 2014, 4:36:23 PM2/1/14
to python-fo...@googlegroups.com
Comment by shi...@uklinux.net:

I've got really confused about the events. What I want to do is fire an
event every time the value in an EditText changes, so I can change the
values in a list (it's a sort of self-refining search).
How do I add an event to do that?

python-fo...@googlecode.com

unread,
Feb 5, 2014, 5:50:32 PM2/5/14
to python-fo...@googlegroups.com
Comment by said.ran...@gmail.com:

I've a problem... I would like to use a EditText with Action Done and i
wrote in my xml:
<EditText
android:id="@+id/widget35"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="EditText"
android:textSize="18sp"
android:singleLine="true"
android:imeOptions="actionDone" />
I would like to get text when on the keyboard is pressed "Done" button.
I tried with add_event_handler(full_screen_ui_wrapper.EVENT_SNIFFER,
self.GetText)
but does not work!!!
can someone help me?

Hariharan Srinath

unread,
Feb 5, 2014, 11:03:56 PM2/5/14
to python-fo...@googlegroups.com

Hmmm I don't know if actiondone event is captured in sl4a code currently... so you may not see it.

In this case you could simply add a separate click handler to your done button.

Regards
Srinath

--
You received this message because you are subscribed to the Google Groups "Py4A" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python-for-android+unsub...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

python-fo...@googlecode.com

unread,
Mar 29, 2014, 12:20:53 PM3/29/14
to python-fo...@googlegroups.com
Comment by matteo...@gmail.com:

Thanks!

python-fo...@googlecode.com

unread,
Feb 19, 2015, 2:30:03 AM2/19/15
to python-fo...@googlegroups.com
Comment by TWHill6...@gmail.com:

Thanks for a cool project. I have had much success using this for a few
simple projects. I am currently trying to implement a simple 'Seekbar'. Is
this possible with fullscreenwrapper2? I have sample code but I cannot seem
to make it work. Does this makes sense when I am adding the event?

<SeekBar
android:id="@+id/sbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:max="510"
android:progress="256"
android:padding="30dip"
/>

self.views.sbar.add_event(itemclick_EventHandler(self.views.sbar,
handler_function=self.onBar))

Any feedback would be much appreciated. My app runs, but the function onBar
is never called.

python-fo...@googlecode.com

unread,
Feb 20, 2015, 2:41:57 PM2/20/15
to python-fo...@googlegroups.com
Comment by TWHill6...@gmail.com:

Ok, I know that last post didn't make much sense. So I deleted it. All I
want is to use a 'seekbar' with fullscreenwrapper2. Here is the code that I
am working on. It runs and everything works except the seekbar. The bar
shows up, it even slides back and forth, but the handler function 'on_bar'
never executes. Does anyone see any obvious reason for this?

<code language="python">
<import sys, time, android
from fullscreenwrapper2 import *

xmldata = """<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<TextView
android:layout_width="fill_parent"
android:layout_height="0px"
android:background="#ff000000"
android:id="@+id/titlebox"
android:text="Seek Bar Test!"
android:textSize="20dp"
android:layout_weight="10"
android:gravity="center"/>

<SeekBar
android:id="@+id/sbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:max="510"
android:progress="256"/>

<Button
android:id="@+id/but_test"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Test"/>

<Button
android:id="@+id/but_quit"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Quit"/>
</LinearLayout>"""

class SeekBarLayout(Layout):
def __init__(self):
super(SeekBarLayout, self).__init__(xmldata, "Seek Bar Test")

def on_show(self):

self.add_event(key_EventHandler(handler_function=self.close_app))

self.views.sbar.add_event(itemclick_EventHandler(self.views.sbar,
handler_function=self.on_bar))


self.views.but_test.add_event(click_EventHandler(self.views.but_test,
self.on_but))

self.views.but_quit.add_event(click_EventHandler(self.views.but_quit,
self.close_app))
print 'on_show test'

def on_but(self, view, event):
print 'on_but test'

def on_bar(self, view, event):
print 'on_bar test'

def close_app(self,view,event):
FullScreenWrapper2App.exit_FullScreenWrapper2App()

def on_close(self):
pass

if __name__ == '__main__':
droid = android.Android()

FullScreenWrapper2App.initialize(droid)
FullScreenWrapper2App.show_layout(SeekBarLayout())
FullScreenWrapper2App.eventloop()
/>
</code>

python-fo...@googlecode.com

unread,
Feb 20, 2015, 2:42:57 PM2/20/15
to python-fo...@googlegroups.com
Comment by TWHill6...@gmail.com:

this is a code block test

<code language="xml">
<hello target="world"/>

python-fo...@googlecode.com

unread,
Feb 20, 2015, 2:57:36 PM2/20/15
to python-fo...@googlegroups.com
Comment by TWHill6...@gmail.com:

I have had much success with this project, but I have run into a problem. I
would like to use a 'seekbar' with fullscreenwrapper2. I have stripped my
code down to a very simple example so i could post it here (I tried
using 'wiki syntax' code block....).

Basically the seekbar shows up in the app and it moves when you slide it.
However the Handler function never executes. Does anyone see an obvious
error in my code?

import sys, time, android
from fullscreenwrapper2 import *

xmldata = """<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<TextView
android:layout_width="fill_parent"
android:layout_height="0px"
android:background="#ff000000"
android:id="@+id/titlebox"
android:text="Seek Bar Test!"
android:textSize="20dp"
android:layout_weight="10"
android:gravity="center"/>
<SeekBar
android:id="@+id/sbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:max="510"
android:progress="256"/>
<Button
android:id="@+id/but_quit"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Quit"/>
</LinearLayout>"""

class SeekBarLayout(Layout):
def __init__(self):
super(SeekBarLayout, self).__init__(xmldata, "Seek Bar Test")

def on_show(self):

self.add_event(key_EventHandler(handler_function=self.close_app))
self.views.sbar.add_event(itemclick_EventHandler(self.views.sbar,
handler_function=self.on_bar))

self.views.but_quit.add_event(click_EventHandler(self.views.but_quit,
self.close_app))

def on_bar(self, view, event):
print 'on_bar test'

def close_app(self,view,event):
FullScreenWrapper2App.exit_FullScreenWrapper2App()

def on_close(self):
pass

if __name__ == '__main__':
droid = android.Android()

FullScreenWrapper2App.initialize(droid)
FullScreenWrapper2App.show_layout(SeekBarLayout())
FullScreenWrapper2App.eventloop()

I know thats hard to read sorry. Any feedback would be greatly appreciated.

python-fo...@googlecode.com

unread,
Feb 20, 2015, 3:04:08 PM2/20/15
to python-fo...@googlegroups.com
Comment by TWHill6...@gmail.com:

I have had much success using this project. Now I want to use a 'seekbar'
in fullscreenwrapper2. I have followed an example but I cannot make it work.

Basically the seekbar shows up and moves when you slide it, but the handler
function never executes.

{{{

python-fo...@googlecode.com

unread,
Feb 20, 2015, 3:06:00 PM2/20/15
to python-fo...@googlegroups.com
Comment by TWHill6...@gmail.com:

Can anyone see any obvious errors in the script above? I have been trying
to make it work for 2 days and I feel that it must be something simple. Any
help/feedback would be greatly appreciated.

python-fo...@googlecode.com

unread,
Feb 20, 2015, 11:11:50 PM2/20/15
to python-fo...@googlegroups.com
Comment by sinkuri...@gmail.com:

I suppose SL4A is not listen the Seekbar event.
You can add event listener and re-compile/install the customized SL4A.
Customized SL4A will make your code to work.

I have patch code for SL4A but I forget details... (I made it three years
ago...)

||patch||
https://bitbucket.org/kuri65536/usbhostserialfacade/raw/c68c03cea69b23aa87aa31a21b6a71cf63cd4bc2/sl4a_1235_to_1236.diff.SeekBarSupport.txt
||
||sl4a version||
https://github.com/damonkohler/sl4a/commit/41a454997dcc5236030cad6ebc49b7b380d868c6
||
||work video|| http://www.youtube.com/watch?v=Y78pcW4uGe4 ||
Reply all
Reply to author
Forward
0 new messages