【问题标题】:android program doesn t work in mobile but it works correctly in tablet and emulatorandroid 程序在移动设备上无法运行,但在平板电脑和模拟器中可以正常运行
【发布时间】:2012-11-17 11:09:35
【问题描述】:

我使用 SQLite 在 Eclipse 中编写了一个程序。

当我运行它时,它在模拟器(API 7)中正常工作,当我在安卓 2.2 版的平板电脑上运行它时也能正常工作。

但是当我尝试在 android 版本 2.3 的移动设备上运行它时,它不起作用并给我这个错误:

编译时出错:String query = "SELECT Cart_ID from Tbl order by Cart_ID DESC limit 1"

我的主要代码:

public void insertQuote(String Quote,int Price1,int Count1,int GoodIDEnter ) 
{
              String query = "SELECT Cart_ID from Tbl_Cart order by Cart_ID DESC limit 1";
              Cursor c = db.rawQuery(query, null);
               if (c != null && c.moveToFirst()) 
               {
                   goodid = c.getLong(0); 

               }
}

我该怎么办?

【问题讨论】:

  • sqlite3_open_v2("/data/data/com.example.test/databases/NFC.sqlite", &handle, 2, NULL) 失败
  • “失败”?显示实际的错误消息。

标签: android sqlite mobile emulation


【解决方案1】:
<uses-sdk android:minSdkVersion="7" />

在清单文件中添加/修改它。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-03-31
    • 1970-01-01
    • 2018-10-29
    • 2016-07-02
    • 1970-01-01
    相关资源
    最近更新 更多