小编Hel*_*ndz的帖子

如何在SQLite中存储JSON

我遇到了将JSON数据存储到sqlite的问题.这是我正在尝试实施的代码.JSON数据不是特别大,只有40行.

主要活动是:

public class DatabaseActivity extends Activity {
/** Called when the activity is first created. */

public DBAdapter
DBAdapter =new DBAdapter(this);

TextView txt;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
// Create a crude view - this should really be set via the layout resources  
// but since its an example saves declaring them in the XML.  
LinearLayout rootLayout = new LinearLayout(getApplicationContext());  
txt = new TextView(getApplicationContext());  
rootLayout.addView(txt);  
setContentView(rootLayout);  

// Set the text and call the connect function.  
txt.setText("Connecting..."); …
Run Code Online (Sandbox Code Playgroud)

database sqlite parsing android json

6
推荐指数
1
解决办法
1万
查看次数

标签 统计

android ×1

database ×1

json ×1

parsing ×1

sqlite ×1