我正在使用Sencha Touch 2.3.1开发跨平台应用程序并将其部署到我使用Cordova 3.3.0的本机平台
我按照 本教程.在本教程之后,我能够在模拟器中运行.apk文件.现在我想在我的设备上运行该应用程序.即使我使用USB将设备连接到笔记本电脑,我也无法在设备上运行该应用程序.任何帮助将不胜感激.
我需要将一个Json String转换为Lua中的表数据结构.我使用以下代码.
local json = require "json"
local t = {
["name1"] = "value1",
["name2"] = { 1, false, true, 23.54, "a \021 string" },
name3 = json.null
}
local encode = json.encode (t)
print (encode) --> {"name1":"value1","name3":null,"name2":[1,false,true,23.54,"a \u0015 string"]}
local decode = json.decode( encode )
Run Code Online (Sandbox Code Playgroud)
但是当我运行脚本时,我收到以下错误,
no field package.preload['json']
no file '/usr/local/share/lua/5.2/json.lua'
no file '/usr/local/share/lua/5.2/json/init.lua'
no file '/usr/local/lib/lua/5.2/json.lua'
no file '/usr/local/lib/lua/5.2/json/init.lua'
no file './json.lua'
no file '/usr/local/lib/lua/5.2/json.so'
no file '/usr/local/lib/lua/5.2/loadall.so'
no file './json.so'
Run Code Online (Sandbox Code Playgroud)
那么如何将我的json字符串转换为lua表?
我使用java正则表达式将我的字符串拆分为每个2个字符的子字符串.我使用以下代码.
import java.util.*;
import java.util.regex.Pattern;
import java.util.regex.Matcher;
public class HelloWorld{
public static void main(String []args)
{
String str = "admins";
String delimiters = "([a-z]{2})";
String[] tokensVal = str.split(delimiters);
System.out.println("Count of tokens = " + tokensVal.length);
System.out.println(Arrays.toString(tokensVal));
}
}
Run Code Online (Sandbox Code Playgroud)
但是运行以下代码会将count的值打印为零并打印一个空数组.
我正在开发支持Android 14及更高版本的Android应用程序.我已针对Android 21版编译了我的应用程序.我使用过Google Play Services 7.0.0.该应用程序在Android 21上正常运行.但是当我在Android版本19上运行该应用程序时,它会抛出以下异常
Google Play服务已过期.需要7095000但找到6183036
所以,我想知道应该在我的应用程序中包含哪些Google Play版本,以便在Android 14及更高版本上正常运行.