Dear All
I am using the DBUtils to display data from my database in a webview. Doing so, I get an error on my T3 which is ...
dbutils_executehtml (B4A line: 42)
sb.Append("<a href='http://").Append(i).Append(".")
java.lang.OutOfMemoryError
at java.lang.AbstractStringBuilder.enlargeBuffer(AbstractStringBuilder.java:94)
at java.lang.AbstractStringBuilder.append0(AbstractStringBuilder.java:145)
at java.lang.StringBuilder.append(StringBuilder.java:216)
at anywheresoftware.b4a.keywords.StringBuilderWrapper.Append(StringBuilderWrapper.java:50)
at b4a.estartliste.dbutils._executehtml(dbutils.java:367)
at b4a.estartliste.liste._fillwebview(liste.java:358)
at b4a.estartliste.liste._activity_create(liste.java:262)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:169)
at b4a.estartliste.liste.afterFirstLayout(liste.java:89)
at b4a.estartliste.liste.access$100(liste.java:16)
at b4a.estartliste.liste$WaitForLayout.run(liste.java:74)
at android.os.Handler.handleCallback(Handler.java:615)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4949)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1043)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:810)
at dalvik.system.NativeStart.main(Native Method)
There are currently appr. 1000 datasets in the database with 24 different collumns. Usually the error appears after 130 datasets are appended in the stringbuilder.
Any idea what I could do to overcome this issue? Any help is highly appreciated since this is a real threat to my app. Is there any alternative to the stringbuilder like creating the string in a text file? Is the webview object suitable to show a bigger number of datasets? There is much more to come than the 1000 datasets I have at the moment.
Thanks a lot in advance for your help.
Kind regards from sunny Germany.
René
I am using the DBUtils to display data from my database in a webview. Doing so, I get an error on my T3 which is ...
dbutils_executehtml (B4A line: 42)
sb.Append("<a href='http://").Append(i).Append(".")
java.lang.OutOfMemoryError
at java.lang.AbstractStringBuilder.enlargeBuffer(AbstractStringBuilder.java:94)
at java.lang.AbstractStringBuilder.append0(AbstractStringBuilder.java:145)
at java.lang.StringBuilder.append(StringBuilder.java:216)
at anywheresoftware.b4a.keywords.StringBuilderWrapper.Append(StringBuilderWrapper.java:50)
at b4a.estartliste.dbutils._executehtml(dbutils.java:367)
at b4a.estartliste.liste._fillwebview(liste.java:358)
at b4a.estartliste.liste._activity_create(liste.java:262)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:169)
at b4a.estartliste.liste.afterFirstLayout(liste.java:89)
at b4a.estartliste.liste.access$100(liste.java:16)
at b4a.estartliste.liste$WaitForLayout.run(liste.java:74)
at android.os.Handler.handleCallback(Handler.java:615)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4949)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1043)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:810)
at dalvik.system.NativeStart.main(Native Method)
There are currently appr. 1000 datasets in the database with 24 different collumns. Usually the error appears after 130 datasets are appended in the stringbuilder.
Any idea what I could do to overcome this issue? Any help is highly appreciated since this is a real threat to my app. Is there any alternative to the stringbuilder like creating the string in a text file? Is the webview object suitable to show a bigger number of datasets? There is much more to come than the 1000 datasets I have at the moment.
Thanks a lot in advance for your help.
Kind regards from sunny Germany.
René