HI Erel I'm try to solve splitting the JsonString in more parts
in this case the JP.NextArray work fine.
but i have the problem pushing data in List when list.Size is about more of 200000
note that i don't read JSonString from file but i get it from a webserver
Json string is fine and i write it on file of my device but the problem is where id pushing it in a list
My procedure download data from a web server and pushing data into SQLLITE DB of device.
I do this step
Download data from WS into JsonString
Convert it to List
Scan the list and INSERT or UPDATE SQLite DB
normally this process work fine but the problem is initialization db when the data to syncronize is big
can you have any suggestion form me
thank's
the following is log
------------------------
Logger connesso a: Daishin DS9
--------- beginning of /dev/log/main
Copying updated assets files (1)
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = true **
** Activity (user_logon) Create, isFirst = true **
** Activity (user_logon) Resume **
** Activity (user_logon) Pause, UserClosed = true **
** Activity (home_2019) Create, isFirst = true **
mobile data state: DISCONNECTED wifi_on: 1 server ip: 192.168.0.37
wifi ip: 192.168.0.37
** Activity (home_2019) Resume **
mobile data state: DISCONNECTED wifi_on: 1 server ip: 192.168.0.37
wifi ip: 192.168.0.37
** Activity (home_2019) Pause, UserClosed = false **
** Activity (impostazioni) Create, isFirst = true **
** Activity (impostazioni) Resume **
** Activity (impostazioni) Pause, UserClosed = true **
** Activity (home_2019) Resume **
mobile data state: DISCONNECTED wifi_on: 1 server ip: 192.168.0.37
wifi ip: 192.168.0.37
** Activity (home_2019) Pause, UserClosed = false **
** Activity (impostazioni) Create, isFirst = false **
** Activity (impostazioni) Resume **
** Activity (impostazioni) Pause, UserClosed = true **
** Activity (home_2019) Resume **
mobile data state: DISCONNECTED wifi_on: 1 server ip: 192.168.0.37
wifi ip: 192.168.0.37
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = true **
** Activity (user_logon) Create, isFirst = true **
** Activity (user_logon) Resume **
** Activity (user_logon) Pause, UserClosed = true **
** Activity (home_2019) Create, isFirst = true **
mobile data state: DISCONNECTED wifi_on: 1 server ip: 192.168.0.37
wifi ip: 192.168.0.37
** Activity (home_2019) Resume **
mobile data state: DISCONNECTED wifi_on: 1 server ip: 192.168.0.37
wifi ip: 192.168.0.37
** Activity (home_2019) Pause, UserClosed = false **
** Activity (sincro_dati) Create, isFirst = true **
** Activity (sincro_dati) Resume **
*** Service (httputils2service) Create ***
** Service (httputils2service) Start **
A 11:12:57
A 11:18:17
A 11:21:21
A 11:26:48
java.lang.OutOfMemoryError: [memory exhausted]
at dalvik.system.NativeStart.main(Native Method)
** Activity (sincro_dati) Pause, UserClosed = true **
** Activity (home_2019) Resume **
** Activity (home_2019) Pause, UserClosed = true **
Copying updated assets files (1)
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = true **
** Activity (user_logon) Create, isFirst = true **
** Activity (user_logon) Resume **
** Activity (user_logon) Pause, UserClosed = true **
** Activity (home_2019) Create, isFirst = true **
mobile data state: DISCONNECTED wifi_on: 1 server ip: 192.168.0.37
wifi ip: 192.168.0.37
** Activity (home_2019) Resume **
mobile data state: DISCONNECTED wifi_on: 1 server ip: 192.168.0.37
wifi ip: 192.168.0.37
** Activity (home_2019) Pause, UserClosed = false **
** Activity (sincro_dati) Create, isFirst = true **
** Activity (sincro_dati) Resume **
*** Service (httputils2service) Create ***
** Service (httputils2service) Start **
A 11:39:14
java.lang.OutOfMemoryError
at java.lang.AbstractStringBuilder.<init>(AbstractStringBuilder.java:88)
at java.lang.StringBuilder.<init>(StringBuilder.java:95)
at anywheresoftware.b4a.debug.RDebugUtils.concat(RDebugUtils.java:100)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:735)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:357)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:260)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:175)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:171)
at anywheresoftware.b4a.shell.DebugResumableSub$RemoteResumableSub.resume(DebugResumableSub.java:22)
at anywheresoftware.b4a.keywords.Common$13.run(Common.java:1680)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5017)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
at dalvik.system.NativeStart.main(Native Method)
** Activity (sincro_dati) Pause, UserClosed = false **
Error occurred on line: 1030 (globale)
java.lang.NullPointerException
at org.json.JSONTokener.nextCleanInternal(JSONTokener.java:116)
at org.json.JSONTokener.nextValue(JSONTokener.java:94)
at anywheresoftware.b4a.objects.collections.JSONParser.NextArray(JSONParser.java:60)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:735)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:357)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:260)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
at it.techservice.tpick.sincro_dati.onPause(sincro_dati.java:271)
at android.app.Activity.performPause(Activity.java:5335)
at android.app.Instrumentation.callActivityOnPause(Instrumentation.java:1233)
at android.app.ActivityThread.performPauseActivity(ActivityThread.java:3048)
at android.app.ActivityThread.performPauseActivity(ActivityThread.java:3017)
at android.app.ActivityThread.handlePauseActivity(ActivityThread.java:2995)
at android.app.ActivityThread.access$1000(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1207)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5017)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
at dalvik.system.NativeStart.main(Native Method)
An error occurred:
(Line: 1032) For x = 0 To partialLS.Size - 1
java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Integer