Starting an AndroidService from a kivy app

721 views
Skip to first unread message

ingo....@googlemail.com

unread,
Sep 21, 2014, 11:24:14 PM9/21/14
to kivy-...@googlegroups.com
Dear Kivy users,

I'm trying to run an AndroidService from a kivy app. The first steps went quite well and I can successfully start the service. Yet, it seems that there are some problems with the communication. I followed the example on kivy planet (http://kivy.org/planet/2014/01/building-a-background-application-on-android-with-kivy/), but I can't even get the example to run. I have never used buildozer before and have no clue what to edit in the buildozer.spec file (in fact, buildozer reinstalled ant although I already had it installed). So buildozer didn't work at all yet. I'm just plainly compiling my python4android using distribute.py and then build using

build.py ./build.py --dir path/to/my/app --package org.test.MyApp --name "MyApp" --orientation portrait --version 1.1.0 debug installd

My app doesn't really start. I see a short flash on the phone's screen and then the service is started and I see the respective icon in the task bar, but the app has crashed. My kivy-logfile .kivy/logs/kivy_14_09_21_2.txt ends with

[WARNING] stderr: File "/home/ingo/Hacking/python-for-android/build/python-install/lib/python2.7/socket.py", line 187, in __init__
[WARNING] stderr: socket.error: [Errno 13] Permission denied

The above mentioned kivy planet article points out that when modifying the buildozer.spec file I should not forget "to add the NETWORK permission". Yet, the same error remains if I request the NETWORK permission with

build.py ./build.py --dir path/to/my/app --package org.test.MyApp --name "MyApp" --orientation portrait --permission NETWORK --version 1.1.0 debug installd

Notably,

adb shell pm list permissions

doesn't list a NETWORK permission in this form, so I feel that I might just have to request the right permission.

How do I correctly get kivy.lib.osc to work? Which permission should I ask for? I feel that I'm asking totally useless questions and I would appreciate any help.

Thanks a lot in advance,

Ingo

Ben Rousch

unread,
Sep 22, 2014, 6:19:49 AM9/22/14
to kivy-...@googlegroups.com
Try the INTERNET permission instead of NETWORK. http://developer.android.com/reference/android/Manifest.permission.html

--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
 Ben Rousch
   bro...@gmail.com
   http://clusterbleep.net/

knappador

unread,
Sep 23, 2014, 5:49:44 AM9/23/14
to kivy-...@googlegroups.com
Yeah, it's just network.  As a side-note, I have used file-sockets before on Android and they work.  The app permissions protect the socket in that case.  It's better for serious stuff than taking up TCP/IP resources I think.

ingo....@googlemail.com

unread,
Sep 23, 2014, 10:56:55 AM9/23/14
to kivy-...@googlegroups.com
Thanks Ben,

Try the INTERNET permission instead of NETWORK. http://developer.android.com/reference/android/Manifest.permission.html
I had tried INTERNET instead of NETWORK before, without success. However, it worked this time. So I guess, it was a good thing to be encouraged to try again. Other things are not yet working, though... I might have to write another mail to this list once I have abetter idea what it is.

ingo....@googlemail.com

unread,
Sep 23, 2014, 11:00:55 AM9/23/14
to kivy-...@googlegroups.com

On Tuesday, September 23, 2014 5:49:44 AM UTC-4, knappador wrote:
Yeah, it's just network.  As a side-note, I have used file-sockets before on Android and they work.  The app permissions protect the socket in that case.  It's better for serious stuff than taking up TCP/IP resources I think.
That sounds interesting. Are you suggesting that file-sockets should work without network permissions? But isn't the kivy.lib.osc based on python socket? And wouldn't that be file-sockets?
Reply all
Reply to author
Forward
0 new messages