Note that there are some explanatory texts on larger screens.

plurals
  1. POMy android database application not working in android 2.x
    text
    copied!<p>I have an application that runs smoothly in android 4.x but not in android 2.x.<br> What I'm trying to do is to get some information from a web service and store in the database. what should I do? This is the code that produce error:</p> <pre><code>public String CallMethod(String methodName,ArrayList&lt;ServiceParam&gt; paramList) { String result = "default"; SoapObject request = new SoapObject(namespace, methodName); PropertyInfo pi = new PropertyInfo(); for(int i=0;i&lt;paramList.size();i++){ ServiceParam serviceParam; serviceParam = paramList.get(i); pi = new PropertyInfo(); pi.setName(serviceParam.name); pi.setValue(serviceParam.value); pi.setType(serviceParam.type); request.addProperty(pi); } SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); envelope.dotNet = true; envelope.setOutputSoapObject(request); HttpTransportSE androidHttpTransport = new HttpTransportSE(url); try { androidHttpTransport.call(namespace+methodName, envelope); SoapPrimitive response = (SoapPrimitive) envelope.getResponse(); result= response.toString(); output = result; } catch (Exception e) { Log.d("Ehsan", e.getMessage()); Log.d("Ehsan", e.getLocalizedMessage()); e.printStackTrace(); } return result; } </code></pre> <p>the line that produces the error is this:</p> <pre><code>SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); </code></pre> <p>this is my log cat:</p> <pre><code>11-26 11:26:02.666: W/SQLiteCompiledSql(12820): Releasing statement in a finalizer. Please ensure that you explicitly call close() on your cursor: SELECT * FROM settings WHERE name='PersonId' 11-26 11:26:02.666: W/SQLiteCompiledSql(12820): android.database.sqlite.DatabaseObjectNotClosedException: Application did not close the cursor or database object that was opened here 11-26 11:26:02.666: W/SQLiteCompiledSql(12820): at android.database.sqlite.SQLiteCompiledSql.&lt;init&gt;(SQLiteCompiledSql.java:62) 11-26 11:26:02.666: W/SQLiteCompiledSql(12820): at android.database.sqlite.SQLiteProgram.&lt;init&gt;(SQLiteProgram.java:80) 11-26 11:26:02.666: W/SQLiteCompiledSql(12820): at android.database.sqlite.SQLiteQuery.&lt;init&gt;(SQLiteQuery.java:46) 11-26 11:26:02.666: W/SQLiteCompiledSql(12820): at android.database.sqlite.SQLiteDirectCursorDriver.query(SQLiteDirectCursorDriver.java:42) 11-26 11:26:02.666: W/SQLiteCompiledSql(12820): at android.database.sqlite.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java:1345) 11-26 11:26:02.666: W/SQLiteCompiledSql(12820): at android.database.sqlite.SQLiteDatabase.rawQuery(SQLiteDatabase.java:1315) 11-26 11:26:02.666: W/SQLiteCompiledSql(12820): at ClassLibrary.DbHelper.select(DbHelper.java:105) 11-26 11:26:02.666: W/SQLiteCompiledSql(12820): at com.example.shareholders.entities.Settings.select(Settings.java:93) 11-26 11:26:02.666: W/SQLiteCompiledSql(12820): at com.example.shareholders.entities.Settings.getValue(Settings.java:56) 11-26 11:26:02.666: W/SQLiteCompiledSql(12820): at com.example.shareholders.Login.onCreate(Login.java:24) 11-26 11:26:02.666: W/SQLiteCompiledSql(12820): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) 11-26 11:26:02.666: W/SQLiteCompiledSql(12820): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627) 11-26 11:26:02.666: W/SQLiteCompiledSql(12820): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679) 11-26 11:26:02.666: W/SQLiteCompiledSql(12820): at android.app.ActivityThread.access$2300(ActivityThread.java:125) 11-26 11:26:02.666: W/SQLiteCompiledSql(12820): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033) 11-26 11:26:02.666: W/SQLiteCompiledSql(12820): at android.os.Handler.dispatchMessage(Handler.java:99) 11-26 11:26:02.666: W/SQLiteCompiledSql(12820): at android.os.Looper.loop(Looper.java:123) 11-26 11:26:02.666: W/SQLiteCompiledSql(12820): at android.app.ActivityThread.main(ActivityThread.java:4627) 11-26 11:26:02.666: W/SQLiteCompiledSql(12820): at java.lang.reflect.Method.invokeNative(Native Method) 11-26 11:26:02.666: W/SQLiteCompiledSql(12820): at java.lang.reflect.Method.invoke(Method.java:521) 11-26 11:26:02.666: W/SQLiteCompiledSql(12820): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868) 11-26 11:26:02.666: W/SQLiteCompiledSql(12820): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626) 11-26 11:26:02.666: W/SQLiteCompiledSql(12820): at dalvik.system.NativeStart.main(Native Method) 11-26 11:26:02.736: E/Database(12820): close() was never explicitly called on database '/data/data/com.example.shareholders/databases/shareholders.db' 11-26 11:26:02.736: E/Database(12820): android.database.sqlite.DatabaseObjectNotClosedException: Application did not close the cursor or database object that was opened here 11-26 11:26:02.736: E/Database(12820): at android.database.sqlite.SQLiteDatabase.&lt;init&gt;(SQLiteDatabase.java:1810) 11-26 11:26:02.736: E/Database(12820): at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:817) 11-26 11:26:02.736: E/Database(12820): at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:851) 11-26 11:26:02.736: E/Database(12820): at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:844) 11-26 11:26:02.736: E/Database(12820): at android.app.ContextImpl.openOrCreateDatabase(ContextImpl.java:540) 11-26 11:26:02.736: E/Database(12820): at android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:203) 11-26 11:26:02.736: E/Database(12820): at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:98) 11-26 11:26:02.736: E/Database(12820): at android.database.sqlite.SQLiteOpenHelper.getReadableDatabase(SQLiteOpenHelper.java:158) 11-26 11:26:02.736: E/Database(12820): at ClassLibrary.DbHelper.select(DbHelper.java:99) 11-26 11:26:02.736: E/Database(12820): at com.example.shareholders.entities.Settings.select(Settings.java:93) 11-26 11:26:02.736: E/Database(12820): at com.example.shareholders.entities.Settings.getValue(Settings.java:56) 11-26 11:26:02.736: E/Database(12820): at com.example.shareholders.Login.onCreate(Login.java:24) 11-26 11:26:02.736: E/Database(12820): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) 11-26 11:26:02.736: E/Database(12820): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627) 11-26 11:26:02.736: E/Database(12820): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679) 11-26 11:26:02.736: E/Database(12820): at android.app.ActivityThread.access$2300(ActivityThread.java:125) 11-26 11:26:02.736: E/Database(12820): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033) 11-26 11:26:02.736: E/Database(12820): at android.os.Handler.dispatchMessage(Handler.java:99) 11-26 11:26:02.736: E/Database(12820): at android.os.Looper.loop(Looper.java:123) 11-26 11:26:02.736: E/Database(12820): at android.app.ActivityThread.main(ActivityThread.java:4627) 11-26 11:26:02.736: E/Database(12820): at java.lang.reflect.Method.invokeNative(Native Method) 11-26 11:26:02.736: E/Database(12820): at java.lang.reflect.Method.invoke(Method.java:521) 11-26 11:26:02.736: E/Database(12820): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868) 11-26 11:26:02.736: E/Database(12820): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626) 11-26 11:26:02.736: E/Database(12820): at dalvik.system.NativeStart.main(Native Method) </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload