SQLite学习笔记20150714-2

前端之家收集整理的这篇文章主要介绍了SQLite学习笔记20150714-2前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

【搭建Android Junit Test】


public class TESTPerson extends AndroidTestCase {

public void testCreateDB()
{
DBOpenHelper dbOpenHelper = new DBOpenHelper(getContext());
dbOpenHelper.getWritableDatabase();
Person person = new Person();
new PersonService(getContext()).save(person);
System.out.println("-----------dsdfsdfsdfsd");
}
}

--------------------------------------------------------------------------------------------------------------------------------------------

//AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.ws.person"
android:versionCode="1"
android:versionName="1.0" >

<instrumentation
android:name="android.test.InstrumentationTestRunner"
android:targetPackage="com.ws.person"></instrumentation>

<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="14" />


<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<uses-library android:name="android.test.runner" /> <activity android:name="com.ws.person.AndroidClientActivity" android:label="@string/app_name" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> </manifest> 原文链接:https://www.f2er.com/sqlite/199485.html

猜你在找的Sqlite相关文章