0

i'm currently reading through head first python and upon reaching chapter 8 I got stuck. The book wants me to download SL4A from the link http://code.google.com/p.android-scripting however that link no longer works. So I did some searching and found the file on github. My real problem is when I try to download it on the emulated device it just says waiting for data connection and it never downloads. I am wondering if there is a way to fix this. Any help is appreciated thanks!

EDIT: to get it to work I downloaded both files from here https://github.com/kuri65536/python-for-android/blob/master/README.md then I copied the files to the folder

C:\Users\lucas\android-sdks\platform-tools

then I opened CMD and cd to the path above.

then use the command:

adb install (filepath)

for both files and they appeared on the emulated device.

3 Answers3

0

Download to your pc and push through ADB.

Mistic92
  • 120
  • 3
  • 12
0

Download files and adb install worked for me in my installation (Windows 10, android studio 2.1.1) with minor differences:

1) adb command is located in: C:\Users\MyUser\AppData\Local\Android\Mysdk\platform-tools Need to add to path

2) Needed release sl4a-r6.1.1-x86-debug.apk. Downloaded it from release pages

RBT
  • 24,161
  • 21
  • 159
  • 240
Manlufo
  • 1
  • 1
0

I'm also reading through HeadFirstPython and got stuck at this stage (with the error: app not installed). I tried the abs method above and ended up with yet another problem: install_failed_no_matching_abis. After a lot of research, I got to understand that the "native libraries" of the sl4a.apk were not matching the system architecture of my emulated android. In other words, if one wants a faster emulator in android studio, he ought to use an x86 architecture android; but the problem with that is scripting layer for android is programmed to work on ARM architectures hence the 'install_failed_no_matching_abis' error.

The solution that worked for me was to go back to AVD in Android Studio, delete the downloaded emulator (which was of x80 cpu/abi) and download one with armeabiv7 cpu, recommended level=24. It took a lot of trial and error to get to this choice as other android cpu/abi were either too slow or just wouldn't allow me to install the required apps.

Edited: In the end, I was directed to use GenyMotion as that performed better in terms of speed. I was reluctant at first but, to my surprise that really is the case (It is super faster than ARM android studio alternative). Not only is it a great emulator, it also has this ARM translation tools that allows one to easily install ARM sl4a.apk on the x86 devices.