3

Is there any way to make widgets with Python on Android?

I mean, that I know only Python, HTML, DOM, JS, maybe jQuery and nothing more (not C, Java or something).

Maybe it's simple?

I honestly searched stackoverflow but search returned no answers :(

Help me, please. Give me a hope.

asked Oct 3, 2011 at 14:56
1
  • And javascript isn't enough? You can use w3c widgets then I think... Commented Oct 3, 2011 at 15:01

4 Answers 4

2

Personally I wrote a google app engine app in python to collect and display the data, and then used an app called "meta widget" that allows you to turn a website's content into a widget. The app pulls the content from my GAE website and shows it in a widget on the android homescreen.

You might be able to do something completely local if you can make something to serve HTTP requests in sl4a python, then have meta widget go to a local http address.

answered Dec 2, 2012 at 19:11
Sign up to request clarification or add additional context in comments.

1 Comment

Hmm, I think that's the best solution at this time. Thank you! Also I've found that Py4A now supports generic ui layouts.
2

I don't think this could be done.

I've done a quick search in SL4A documentation and there is no API to register broadcast receiver. And Android widgets are just a bunch of Views and code in BroadcastReceiver.

And as far as I know, SL4A is the only way to use Python on Android with UI interaction.

answered Oct 3, 2011 at 15:06

Comments

2

Please check this links:

Remember that there is a Python implementation on the JVM called Jython.

Edit: In terms of Android development i should say Jythonroid.

answered Oct 3, 2011 at 15:09

3 Comments

As I understand Jython works by compiling Python source to JVM byte-code on the fly. But Android does not have JVM, it has different VM implementation called Dalvik (dalvikvm.com). And Dalvik is not byte-code compatible with JVM, so this generated code could not be executed.
You are right. There are some things that the Dalvik cant do, or cant do equally. But just like you say Jython is converted to Java bytecodes, and this can be then converted to Dalvik. See this link
okay, I understand. But how it can looks like in practice? Maybe, simple widget's code example? please..
0

Pyjamas perhaps? Maybe not exactly what you're looking for but it would allow you to at least write some of your code in Python (and compile to JavaScript).

answered Oct 3, 2011 at 16:23

3 Comments

I can use JS to make desktop widgets on Android?!
@Крайст - sorry, missed the part about wanting to do desktop widgets; I thought you were looking for a way to get a Python-based app going.
ammm... I want to know, how can I make/write home screen widgets for android. In Python or maybe in js (Opera makes this possible, as I know)

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.