PostgreSQL JDBC connection does not work on Android 4.0

Does anyone know what I can do to make the JDBC connection work on Android 4.0. It works fine on Android 1.6-2.3. I am using the Dave Cramer build: http://groups.google.com/group/pgandroid/browse_thread/thread/d8b400f039f66d5f/f77b2e2a99370a36?lnk=raot#f77b2e2a99370a36

Logcat says:

06-10 17:35:51.043: E/AndroidRuntime(798): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.belonogov.connectjdbc/com.belonogov.connectjdbc.ConnectJDBCActivity}: java.lang.NullPointerException 06-10 17:35:51.043: E/AndroidRuntime(798): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1956) 06-10 17:35:51.043: E/AndroidRuntime(798): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981) 06-10 17:35:51.043: E/AndroidRuntime(798): at android.app.ActivityThread.access$600(ActivityThread.java:123) 06-10 17:35:51.043: E/AndroidRuntime(798): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147) 06-10 17:35:51.043: E/AndroidRuntime(798): at android.os.Handler.dispatchMessage(Handler.java:99) 06-10 17:35:51.043: E/AndroidRuntime(798): at android.os.Looper.loop(Looper.java:137) 06-10 17:35:51.043: E/AndroidRuntime(798): at android.app.ActivityThread.main(ActivityThread.java:4424) 06-10 17:35:51.043: E/AndroidRuntime(798): at java.lang.reflect.Method.invokeNative(Native Method) 06-10 17:35:51.043: E/AndroidRuntime(798): at java.lang.reflect.Method.invoke(Method.java:511) 06-10 17:35:51.043: E/AndroidRuntime(798): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784) 06-10 17:35:51.043: E/AndroidRuntime(798): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551) 06-10 17:35:51.043: E/AndroidRuntime(798): at dalvik.system.NativeStart.main(Native Method) 06-10 17:35:51.043: E/AndroidRuntime(798): Caused by: java.lang.NullPointerException 06-10 17:35:51.043: E/AndroidRuntime(798): at com.belonogov.connectjdbc.ConnectJDBCActivity$CustomDrawableView.<init>(ConnectJDBCActivity.java:81) 06-10 17:35:51.043: E/AndroidRuntime(798): at com.belonogov.connectjdbc.ConnectJDBCActivity.onCreate(ConnectJDBCActivity.java:27) 06-10 17:35:51.043: E/AndroidRuntime(798): at android.app.Activity.performCreate(Activity.java:4465) 06-10 17:35:51.043: E/AndroidRuntime(798): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049) 06-10 17:35:51.043: E/AndroidRuntime(798): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920) 06-10 17:35:51.043: E/AndroidRuntime(798): ... 11 more 

It is just an application that connects to a database.

+4
source share
2 answers

If at all possible, consider abandoning direct JDBC on your Android device. It is inefficient in terms of mutual travel, etc., and is not reliable in the face of unreliable connections.

See How can I (indirectly) query the postgresql database in android? .

+2
source

You will most likely find the answer here:

 06-10 17:35:51.043: E/AndroidRuntime(798): Caused by: java.lang.NullPointerException 06-10 17:35:51.043: E/AndroidRuntime(798): at com.belonogov.connectjdbc.ConnectJDBCActivity$CustomDrawableView.<init>(ConnectJDBCActivity.java:81) 06-10 17:35:51.043: E/AndroidRuntime(798): at com.belonogov.connectjdbc.ConnectJDBCActivity.onCreate(ConnectJDBCActivity.java:27) 

This means: Look at the ConnectJDBCActivity.java class, line 81, and see which link may be null .

0
source

Source: https://habr.com/ru/post/926811/


All Articles