如何应用所有数据库的通用设计?(How to apply the common design for all database?)
我有三十个笔记数据库。 每个数据库大约有20多个表单和50个视图。 我们计划进行设计更改[表格样式,操作栏,视图,表格等]。 我们设计了一种通用样式并应用于数据库。 现在他们无论如何直接将设计应用于所有数据库?
I am having a thirty of notes databases. Each database has more than 20 forms and fifty views approximately. We planned for design change [Style of form, Action bar, View, tables and etc.,]. We designed a common style and applied to a database. Now Is their anyway to apply the design directly for all database?
原文:https://stackoverflow.com/questions/11112741
最满意答案
Android SDK提供
JSONObject
。 这可以通过导入org.json.JSONObject
来使用。JSONObject的文档在这里 。
任何其他变体将来自库或链接的项目。 cricket_007给出的例子是来自Gson库的
JsonObject
。 这可以通过导入com.google.gson.JsonObject
来使用。JsonObject的文档在这里 。
请注意
JSONObject
和JsonObject
import语句的区别 - 它们是不同包中的不同类。 它们可以有不同的方法和功能,采用不同的参数等,但最终它们会做相同或相似的事情(持有Json对象的内容)。 这取决于您使用的。 每个JavaDoc都会介绍如何使用它,每个网站都有大量的资源。The Android SDK provides
JSONObject
. This can be used by importingorg.json.JSONObject
.The documentation for JSONObject is here.
Any other variant will be from a library or linked project. The exmaple given by cricket_007 is
JsonObject
from the Gson libraries. This can be used by importingcom.google.gson.JsonObject
.The documentation for JsonObject is here.
Note the difference in import statement for
JSONObject
andJsonObject
- they are different classes in different packages. They can have different methods and functionality, take different parameters etc, but ultimately they will do the same or similar thing (holding a Json Object's contents). It is up to you which you use. The JavaDoc for each will describe how to use it, and there are plenty of resources online for each.
相关问答
更多-
using System.Json;添加using System.Json; 到你的文件的顶部。 编辑 似乎Windows Phone 7不支持System.Json命名空间,因此您不能这样做。 粗略搜索后,您似乎必须使用此 MSDN视频/源代码中所示的DataContractJsonSerializer类。 您可能还想考虑使用Json.NET ,它看起来比DataContractJsonSerializer更有效。 Add using System.Json; to the top of your fil ...
-
您可以通过首先访问迭代对象来访问找到的数组json对象; 你不要覆盖jsonObject来访问你想要的对象: for (Object aJsonArray : arr) { JSONObject foundJsonObject = (JSONObject) aJsonArray; JSONArray postsArr = (JSONArray) foundJsonObject.get("posts"); for (Object bJsonArray : p ...
-
JSONObject异常(JSONObject exceptions)[2022-10-03]
System.out.println((String) obj); 听起来就像你没有有效的JSON数据,如果你有'未定义'的话。 未定义的Javascript就像Java中的'null'一样。 System.out.println((String) obj); Sounds like you don't have valid JSON data in there in the first place if you have 'undefined' in it. Javascript undefined ... -
Singleton设计模式限制实例化,并确保JVM中只存在该类的一个实例。 换句话说,当您实现Singleton时,目的是确保每次调用getInstance()方法时都使用相同的实例。 关于你的代码,条件if (instance == null)是无用的,你的getInstance()方法相当于: public static JSONObject getInstance() { return instance; } Singleton design pattern restricts the ...
-
那么你可以尝试将它作为String处理,只需将新对象插入父对象中即可。 private static JSONObject insertObj(JSONObject parent, JSONObject child){ String parentStr = parent.toString(); parentStr = parentStr.substring(1);//remove the opening curly bracket { String childStr = ch ...
-
我想你正在使用org.json。 JSONArray array = new JSONArray(s); int length = array.length(); for (int i = 0; i < length; i++) { JSONObject o = array.getJSONObject(i); System.out.println(o); } 其中s是你的String 。 I suppose you are using org.json for that. JSONArra ...
-
您的响应结构是: JSONObject key:value JSONObject (key: "Matches") JSONArray (key: "A") JSONObject, key:value, key:value, etc... JSONObject 要访问A ,请按照以下步骤操作: 从您的响应中创建JSONObject: JSONObject jsonResponseObj = ne ...
-
Android SDK提供JSONObject 。 这可以通过导入org.json.JSONObject来使用。 JSONObject的文档在这里 。 任何其他变体将来自库或链接的项目。 cricket_007给出的例子是来自Gson库的JsonObject 。 这可以通过导入com.google.gson.JsonObject来使用。 JsonObject的文档在这里 。 请注意JSONObject和JsonObject import语句的区别 - 它们是不同包中的不同类。 它们可以有不同的方法和功能,采 ...
-
如何解码JSONObject(How to decode JSONObject)[2022-03-15]
它不是JSONObject ,而是JSONArray 从你的问题: { "nameservice": [ { "id": 7413, "name": "ask" }, { "id": 7414, "name": "josn" }, { "id": 7415, "name": "john" }, { "id": 7418, "name": "RjhjhjR" } ] } [在nameservice键后面告诉你它是一个数组。 它需要是一个{来表示一个对象,但事实并非如此 因此,更改您的代码以将其用作JSONA ... -
错误“不是JSONObject”(Error “is not a JSONObject”)[2021-11-05]
{表示JSONObject, [表示JSONArray 在你的json产品中代表JSONArray而不是Object 这样做是为了获得名称字符串。 JSONObject nodeRoot = new JSONObject(line); JSONArray nodeStats = nodeRoot.getJSONArray("products"); for(int i=0; i < nodeStats.length();i++){ String sSDR = nodeStats.getJSONObject ...