加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

SQLite学习笔记20150714-2

发布时间:2020-12-12 19:41:53 所属栏目:百科 来源:网络整理
导读:【搭建Android Junit Test】 public class TESTPerson extends AndroidTestCase { public void testCreateDB() { DBOpenHelper dbOpenHelper = new DBOpenHelper(getContext()); dbOpenHelper.getWritableDatabase(); Person person = new Person(); new Per

【搭建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>

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读