资源简介
Google官方博客介绍了Android Scripting Environment(ASE、SL4A),将脚本语言带入Android,允许用户编辑和执行脚本,直接在Android设备上运行交互式解释器。脚本将能大幅度简化任务界面,用户能在交互式终端中使用脚本。ASE目前支持Python,Lua和 BeanShell,未来将加入对Ruby和JavaScript的支持。示例代码require "android"android.startSensing()android.sleep(1) --Give the sensors a moment to come online.silent = falsewhile true do s = android.readSensors() facedown = s.result and s.result.zforce and s.result.zforce > 9 if facedown and not silent then android.vibrate() --A short vibration to indicate we are in silent mode. android.setRingerSilent(true) silent = true elseif not facedown and silent then android.setRingerSilent(false) silent = false end android.sleep(1)end
标签:SL4A
标签:SL4A
代码片段和文件信息
/*
* Copyright (C) 2009 Google Inc.
*
* Licensed under the Apache License Version 2.0 (the “License“); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing software
* distributed under the License is distributed on an “AS IS“ BASIS WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
package com.googlecode.bshforandroid;
import android.content.Context;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;
import com.googlecode.android_scripting.Log;
import com.googlecode.android_scripting.interpreter.InterpreterConstants;
import com.googlecode.android_scripting.interpreter.Sl4aHostedInterpreter;
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class BshDescriptor extends Sl4aHostedInterpreter {
private final static String BSH_JAR = “bsh-2.0b4-dx.jar“;
private static final String ENV_DATA = “ANDROID_DATA“;
public String getExtension() {
return “.bsh“;
}
public String getName() {
return “bsh“;
}
public String getNiceName() {
return “BeanShell 2.0b4“;
}
public boolean hasInterpreterArchive() {
return false;
}
public boolean hasExtrasArchive() {
return true;
}
public boolean hasscriptsArchive() {
return true;
}
public int getVersion() {
return 3;
}
@Override
public File getBinary(Context context) {
return new File(DALVIKVM);
}
@Override
public List getArguments(Context context) {
String absolutePathToJar = new File(getExtrasPath(context) BSH_JAR).getAbsolutePath();
List result =
new ArrayList(Arrays.asList(“-classpath“ absolutePathToJar
“com.android.internal.util.Withframework“ “bsh.Interpreter“));
try {
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context);
if (preferences != null) {
int heapsize = Integer.parseInt(preferences.getString(“heapsize“ “0“) 10);
if (heapsize > 0) {
result.add(0 “-Xmx“ + heapsize + “m“);
}
}
} catch (Exception e) {
Log.e(e);
}
return result;
}
@Override
public Map getEnvironmentVariables(Context unused) {
Map values = new HashMap();
values.put(ENV_DATA InterpreterConstants.SDCARD_ROOT + getClass().getPackage().getName());
return values;
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2015-06-14 06:58 sl4a-master\
文件 486 2015-06-14 06:58 sl4a-master\.hgignore
文件 11358 2015-06-14 06:58 sl4a-master\LICENSE
文件 1698 2015-06-14 06:58 sl4a-master\README.md
目录 0 2015-06-14 06:58 sl4a-master\android\
目录 0 2015-06-14 06:58 sl4a-master\android\.settings\
文件 21916 2015-06-14 06:58 sl4a-master\android\.settings\org.eclipse.jdt.core.prefs
文件 114 2015-06-14 06:58 sl4a-master\android\.settings\org.eclipse.jdt.ui.prefs
目录 0 2015-06-14 06:58 sl4a-master\android\BeanShellForAndroid\
文件 540 2015-06-14 06:58 sl4a-master\android\BeanShellForAndroid\.classpath
文件 822 2015-06-14 06:58 sl4a-master\android\BeanShellForAndroid\.project
目录 0 2015-06-14 06:58 sl4a-master\android\BeanShellForAndroid\.settings\
文件 21916 2015-06-14 06:58 sl4a-master\android\BeanShellForAndroid\.settings\org.eclipse.jdt.core.prefs
文件 5193 2015-06-14 06:58 sl4a-master\android\BeanShellForAndroid\.settings\org.eclipse.jdt.ui.prefs
文件 1305 2015-06-14 06:58 sl4a-master\android\BeanShellForAndroid\AndroidManifest.xm
文件 445 2015-06-14 06:58 sl4a-master\android\BeanShellForAndroid\project.properties
目录 0 2015-06-14 06:58 sl4a-master\android\BeanShellForAndroid\res\
目录 0 2015-06-14 06:58 sl4a-master\android\BeanShellForAndroid\res\drawable\
文件 2233 2015-06-14 06:58 sl4a-master\android\BeanShellForAndroid\res\drawable\bsh_icon.png
目录 0 2015-06-14 06:58 sl4a-master\android\BeanShellForAndroid\res\layout\
文件 393 2015-06-14 06:58 sl4a-master\android\BeanShellForAndroid\res\layout\main.xm
目录 0 2015-06-14 06:58 sl4a-master\android\BeanShellForAndroid\res\values\
文件 123 2015-06-14 06:58 sl4a-master\android\BeanShellForAndroid\res\values\strings.xm
目录 0 2015-06-14 06:58 sl4a-master\android\BeanShellForAndroid\res\xm
文件 383 2015-06-14 06:58 sl4a-master\android\BeanShellForAndroid\res\xm
目录 0 2015-06-14 06:58 sl4a-master\android\BeanShellForAndroid\src\
目录 0 2015-06-14 06:58 sl4a-master\android\BeanShellForAndroid\src\com\
目录 0 2015-06-14 06:58 sl4a-master\android\BeanShellForAndroid\src\com\googlecode\
目录 0 2015-06-14 06:58 sl4a-master\android\BeanShellForAndroid\src\com\googlecode\bshforandroid\
文件 2772 2015-06-14 06:58 sl4a-master\android\BeanShellForAndroid\src\com\googlecode\bshforandroid\BshDesc
文件 1079 2015-06-14 06:58 sl4a-master\android\BeanShellForAndroid\src\com\googlecode\bshforandroid\BshInstaller.java
............此处省略14824个文件信息
相关资源
- android开源项目源码,完整商城项目源
- android开源项目源码,完整商城项目源
- GitHub上最火的40个Android开源项目源码
- pc远控android开源项目
- graphhopper使用OpenStreetMap的开源路线规
- Android系统的交互工具fb-adb.zip
- AndroidIdChangerxposed模块,用于更改and
- Xiaomi_Kernel_OpenSource小米内核开源:c
- Android-用Kotlin进行Android开发的开源库
- 图像处理单机版java-一个开源项目
- android-smart-image-view-master
- Amazed开源项目工程
- Android rtmp rtsp 推流客户端.zip
- 类似 LBE平行空间 的项目,实现App多开
- 手机视频会议视频教学平台ovmeet.zip
- fullcalendar-2.2.3.zip
- java web开源项目在线考试系统
- 京东开放平台.NET版SDKJdSdk.NET.zip
- JAVA上百以及开源项目源代码
- JAVA上百以及开源项目
- jnitrace一个Frida模块,跟踪Android应用程
- Android开发QQ开源项目代码
评论
共有 条评论