kuri65536 / sl4a Goto Github PK
View Code? Open in Web Editor NEWThis project forked from damonkohler/sl4a
Scripting environment for Android platform
License: Apache License 2.0
This project forked from damonkohler/sl4a
Scripting environment for Android platform
License: Apache License 2.0
I am trying to run testusbserial.py on my Android 4 smartphone running sl4a via the QPython app.
The script runs fine until line 63, then a permission dialog shows up and after i confirm it keeps looping "waiting for connect...".
(I have a CH340 Arduino Nano connected to the USB OTG port, so i changed the lines 45 and 53 with the correct IDs.)
Barometer(3.0?), Step counter (4.4?) or else
Not sure if this is necessary with the current facades but in order to target higher sdks (and possible new facades) we need this in order for SL4A not to break when target sdks are higher than api 17 in the gradle config file. I will be working on this for my SL4A embedded apk project. ( https://github.com/ainsophical/droid-python ) Maybe i can merge this when i get it working.
Memo: CameraFacade was terminated in logcat.
Continues discussion at Twitter:
There is a very active chat room for the Julia language, here!
I am using the SL4a 5x04 and Python 2.7.9 onn my Nexus 7 (android 5.1) and am trying to access the USB with the example script given here: https://github.com/kuri65536/sl4a/blob/master/android/USBHostSerialFacade/samplescripts/testpl2303.py
However, android.usbserialGetDeviceList() gives an error saying that the RPC is not recognized. The exact error is:
Result(id=1, result=None, error=u'com.googlecode.android_scripting.rpc.RpcError: Unknown RPC.')
I used the latest releases for both SL4A and Python available on GitHub.
Any hints?
from py4a: kuri65536/python-for-android#87
Is it possible?
When I try to run this on an Android 6.0 x86 Android emulator, I get the following error in Android Studio.
The currently selected variant "arm-debug" uses split APKs, but none of the 1 split apks are compatible with the current device with density "-1" and ABIs "x86".
The project builds fine, but it won't run on the Android emulator. Attempting to install the generated APK via adb to the same emulator results in INSTALL_FAILED_NO_MATCHING_ABIS
.
Hi . i have limited device memory and sl4a is automatically installed and lives on internal momery ! is there a way to install it on the sd card instead? thank you
From google group
Hello
I installed the sl4ar6 apk from kuri65536. I tried to show html from
www.Google.com or any website. But it looks like webViewShow only works with local files.
Someone forked sl4a from kuri65536, and claims to have made great
improvements in UIFacade, including the ability to show html pages
from web sites. But that fork has not been compiled into apk.
https://github.com/miguelpalacio/sl4a
Is it possible for kuri65536 to merge those improvements?
I think fixing webViewShow would be a major step forward for sl4a.
Bye
Since Android is Linux Kernel, and bionic is forked from BSD libc, it should be possible to run python / Perl / lua etc.. official binaries with little modifications, instead of reinventing the wheel.
please help me turn on gps setting on and off without bothering the user
Hi,
I was trying to run with numpy, but my file does not show any output.
my code:
import android
import numpy as np
droid = android.Android()
droid.makeToast('Hello Android!')
Without import numpy as np
, it shows toast message as Hello Android!
But with numpy, i don't get any output.
Please show some light on it. Thanks.
I used be an avid SL4A user, and am really interested in using this fork, but it's not clear what the project status is, or how to install this version.
In any case, the README should be replaced immediately with a few lines that are at least correct. Even just...
An active fork of Scripting Layer for Android.
...would be better than a ton of incorrect information.
Whenever someone who knows about the project has time, they can add a project status, and some installation instructions etc. If more people are able use the app, we can help document things :)
Feature request from kuri65536/python-for-android#72
This error occurs often when building the APK with android studio and systematically when building the APK for the first time. Building with 'gradle assembleDebug' gives more details:
:transformClassesWithDexForArmDebug
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Multiple dex files define Lcom/google/common/annotations/Beta;
at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:596)
at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:554)
at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:535)
at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:171)
at com.android.dx.merge.DexMerger.merge(DexMerger.java:189)
at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:454)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:303)
at com.android.dx.command.dexer.Main.run(Main.java:246)
at com.android.dx.command.dexer.Main.main(Main.java:215)
at com.android.dx.command.Main.main(Main.java:106)
FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':transformClassesWithDexForArmDebug'.
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/usr/lib/jvm/java-8-jdk/bin/java'' finished with non-zero exit value 2
compile files('libs/guava-r06.jar')
statement in the Common build script seems to fix the problem and the APK are built without error the first time now. This would be a regression in gradle since there is nothing wrong with the commented out statement.With a fresh android studio install on archlinux:
1 - The following error occurs when making the project:
Error:Execution failed for task ':TextToSpeechFacade:processDebugAndroidTestManifest'.
> java.lang.RuntimeException: Manifest merger failed : uses-sdk:minSdkVersion 3 cannot be smaller than version 4 declared in library [ScriptingLayerForAndroid:Common:unspecified] /home/xavier/src/sl4a/android/TextToSpeechFacade/build/intermediates/exploded-aar/ScriptingLayerForAndroid/Common/unspecified/AndroidManifest.xml
Suggestion: use tools:overrideLibrary="com.googlecode.android_scripting.common" to force usage
This can be fixed by updating all subprojects build.gradle files with 'minSdkVersion 4'
Another way is to move the subprojects 'android' script block in the root build.gradle file so that minSdkVersion is only defined once. The build.gradle file below (sorry, could not find a way to attach it to the issue) does that and all the subprojects build.gradle files only contain in this case the 'apply' statement and the 'dependencies' script block.
2 - Once this is fixed, another error occurs when building the APK:
/home/xavier/src/sl4a/android/ScriptingLayerForAndroid/res/drawable/atari_small_notice.txt
Error:Error: The file name must end with .xml or .png
:mergeArmDebugResources FAILED
3 - Once this file has been removed, another error occurs when building the APK:
Error:Execution failed for task ':transformClassesWithDexForArmDebug'.
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/usr/lib/jvm/java-7-openjdk/bin/java'' finished with non-zero exit value 2
But this must be some bug in the ide or gradle since after selecting [Clean Project], [Rebuild Project] or [Build APK] not sure what is the right sequence, then the APK files are built and this error does not appear anymore.
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.5.0'
}
}
apply plugin: 'com.android.application'
dependencies {
compile project(':Common')
compile project(':Utils')
compile project(':QuickAction')
compile project(':BluetoothFacade')
compile project(':SignalStrengthFacade')
compile project(':TextToSpeechFacade')
compile project(':WebCamFacade')
compile project(':USBHostSerialFacade')
compile project(':ScriptingLayer')
compile project(':InterpreterForAndroid')
compile('com.android.support:support-v4:21.0.3') {
force = true
}
compile files('libs/locale_platform.jar')
}
/* rootProject properties (see gradle ExtraPropertiesExtension). */
ext {
build_tools_version = "21.1.2"
compile_sdk_version = 21
min_sdk_version = 4
target_sdk_version = 4
com_android_tools_build_gradle = 'com.android.tools.build:gradle:1.5.0'
}
android {
buildToolsVersion project.build_tools_version
compileSdkVersion project.compile_sdk_version
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
jni.srcDirs = [] // Please build NDK modules outside gradle.
jniLibs.srcDirs = ['libs']
}
instrumentTest.setRoot('tests')
}
defaultConfig {
minSdkVersion project.min_sdk_version
targetSdkVersion project.target_sdk_version
versionCode 611
versionName '6.1.1'
}
productFlavors {
x86 {
ndk {
abiFilter "x86"
}
}
mips {
ndk {
abiFilter "mips"
}
}
armv7 {
ndk {
abiFilter "armeabi-v7a"
}
}
arm {
ndk {
abiFilters "armeabi"
}
}
}
productFlavors {
}
dexOptions {
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_6
targetCompatibility JavaVersion.VERSION_1_7
}
applicationVariants.all { variant ->
variant.outputs.each { output ->
def file = output.outputFile
if (file != null && file.name.endsWith('.apk')) {
def newName = file.name.replace(
"ScriptingLayerForAndroid",
"sl4a-r" + defaultConfig.versionName)
output.outputFile = new File(file.parent, newName)
}
}
}
}
subprojects { subproject ->
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath rootProject.com_android_tools_build_gradle
}
}
afterEvaluate{
if((subproject.plugins.hasPlugin('android') ||
subproject.plugins.hasPlugin('android-library'))) {
android {
buildToolsVersion rootProject.build_tools_version
compileSdkVersion rootProject.compile_sdk_version
defaultConfig {
minSdkVersion rootProject.min_sdk_version
targetSdkVersion rootProject.target_sdk_version
}
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
instrumentTest.setRoot('tests')
}
}
}
}
}
A number of people have requested sl4a be included in f-droid, a FLOSS repo of software for Android. There are a few questions to be answered before the software can be included, perhaps you could assist?
https://gitlab.com/fdroid/rfp/issues/200
Cheers
I am trying to figure out how to install this on my Android system. I am currently using Android version 9.
Forgive me if this has been addressed somewhere - I was unable to find it, either in the issues here or in the Google Group.
I'm currently unable to install interpreters - Rhino is the main one I've tried. When trying to install from the SL4A app (using the latest, non-pre-release apk), it tries to open the old Google Code site, so of course it's not going to find anything. I have a version of the Rhino apk I downloaded a long time ago from the Google Code site; trying to run it and install from there simply fails. I've deleted the com.googlecode.rhinoforandroid folder (from my sd card) before each time I try to run the Rhino apk, and it still fails. I tried manually creating the folder on my sd card and adding the rhino jar, scripts zip, and extras zip (from the lang-rhino branch on here), and SL4A doesn't recognize it.
Please help - I absolutely loved SL4A, and was really disappointed to see it die. This seems to be the only active fork of it, and I really don't know where else I can get it set up from. Thanks!
just link to them.
kuri65536/python-for-android#63
SCAN_RESULT_BYTES is not bytes array in python.
def _rpc(self, method, *args):
data = {'id': self.id,
'method': method,
'params': args}
request = json.dumps(data)
self.client.write(request+'\n')
self.client.flush()
response = self.client.readline()
self.id += 1
result = json.loads(response)
if result['error'] is not None:
In self.client.readline(), response is already contains the converted string 'SCAN_RESULT_BYTES'.
Dear Project Members,
Developping a lot around Bluetooth Low Energy, Bluetooth Facade offcially registred in sl4a does not include the BLE Facade to access a BLE Gatt Client / Server. I have seen .java file but it is still unknown by the RPC interpreter.
I would like to ask you two questions:
@rpc(description = "Get Memory Statistics By Type")
public float getMemoryStat(@RpcParameter(name = "type") String type) throws InterruptedException {
ActivityManager.MemoryInfo mi = new ActivityManager.MemoryInfo();
ActivityManager activityManager = (ActivityManager) getSystemService(ACTIVITY_SERVICE);
activityManager.getMemoryInfo(mi);
long availableMegs = mi.availMem / 1048576L; // returns percentages
long percentAvail = mi.availMem / mi.totalMem; // returns percentages
if (type == "avail") {
return mi.availMem;
} else {
return mi.totalMem;
}
Cant pass variables to tasker
Please provide any additional information below.
Custom doclet can not be compile with gradle...
for FTDI devices, We need to ignore to head 2 bytes in buffer of bulkTransfer.
I had been looking for a way to do this for a little while without producing any notifications or UI. Basically, I'd like to control SL4A's API server solely via intents, start a private server on a predetermined port as I was looking to do some script integration between my debian chroot and Android. If there's another way to do so with the current version (control the SL4A private server via intents and set a specific port), I'd be open to that too.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.