I am trying to create a service in which i want to upload image to server in background but when try to execute it in the emulator ti runs perfectly but when i try to run the same in device it gives sqlite lite error. The code is return in the phonegap but the service code is return in native.
here is the logacat Error:
02-24 13:04:21.988: I/System.out(1160): call after 2 minutes
02-24 13:04:21.992: I/System.out(1160): Your connection succeed
02-24 13:04:21.992: I/System.out(1160): Check Database Exist or not?
02-24 13:04:21.992: I/(1160): database exists
02-24 13:04:21.996: I/System.out(1160): my path in db helper data/data/com.sacpl.nesso`/app_database/file__0/0000000000000001.db
02-24 13:04:21.996: I/System.out(1160): path of the database: /data/data/com.sacpl.nesso/databases/0000000000000001.db
02-24 13:04:21.996: I/System.out(1160): Database already Exist
02-24 13:04:21.996: I/(1160): --------------------Call get master `Entry----------------------
02-24 13:04:22.000: I/Database(1160): sqlite returned: error code = 1, msg = no such table: android_metadata
02-24 13:04:22.000: E/Database(1160): SELECT locale FROM android_metadata failed
02-24 13:04:22.007: E/Database(1160): Failed to setLocale() when constructing, closing the database
02-24 13:04:22.007: E/Database(1160): android.database.sqlite.SQLiteException: no such table: android_metadata
02-24 13:04:22.007: E/Database(1160): at android.database.sqlite.SQLiteDatabase.native_setLocale(Native Method)
02-24 13:04:22.007: E/Database(1160): at android.database.sqlite.SQLiteDatabase.setLocale(SQLiteDatabase.java:1987)
02-24 13:04:22.007: E/Database(1160): at android.database.sqlite.SQLiteDatabase.<init>(SQLiteDatabase.java:1855)
02-24 13:04:22.007: E/Database(1160): at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:820)
02-24 13:04:22.007: E/Database(1160): at com.sacpl.nesso.MyService.getNewMasterEntry(MyService.java:441)
02-24 13:04:22.007: E/Database(1160): at com.sacpl.nesso.MyService.onStartCommand(MyService.java:111)
02-24 13:04:22.007: E/Database(1160): at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2043)
02-24 13:04:22.007: E/Database(1160): at android.app.ActivityThread.access$2800(ActivityThread.java:117)
02-24 13:04:22.007: E/Database(1160): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:998)
02-24 13:04:22.007: E/Database(1160): at android.os.Handler.dispatchMessage(Handler.java:99)
02-24 13:04:22.007: E/Database(1160): at android.os.Looper.loop(Looper.java:123)
02-24 13:04:22.007: E/Database(1160): at android.app.ActivityThread.main(ActivityThread.java:3687)
02-24 13:04:22.007: E/Database(1160): at java.lang.reflect.Method.invokeNative(Native Method)
02-24 13:04:22.007: E/Database(1160): at java.lang.reflect.Method.invoke(Method.java:507)
02-24 13:04:22.007: E/Database(1160): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:842)
02-24 13:04:22.007: E/Database(1160): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
02-24 13:04:22.007: E/Database(1160): at dalvik.system.NativeStart.main(Native Method)
02-24 13:04:22.007: W/System.err(1160): android.database.sqlite.SQLiteException: no such table: android_metadata
02-24 13:04:22.007: W/System.err(1160): at android.database.sqlite.SQLiteDatabase.native_setLocale(Native Method)
02-24 13:04:22.007: W/System.err(1160): at android.database.sqlite.SQLiteDatabase.setLocale(SQLiteDatabase.java:1987)
02-24 13:04:22.007: W/System.err(1160): at android.database.sqlite.SQLiteDatabase.<init>(SQLiteDatabase.java:1855)
02-24 13:04:22.007: W/System.err(1160): at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:820)
02-24 13:04:22.007: W/System.err(1160): at com.sacpl.nesso.MyService.getNewMasterEntry(MyService.java:441)
02-24 13:04:22.007: W/System.err(1160): at com.sacpl.nesso.MyService.onStartCommand(MyService.java:111)
02-24 13:04:22.007: W/System.err(1160): at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2043)
02-24 13:04:22.007: W/System.err(1160): at android.app.ActivityThread.access$2800(ActivityThread.java:117)
02-24 13:04:22.007: W/System.err(1160): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:998)
02-24 13:04:22.007: W/System.err(1160): at android.os.Handler.dispatchMessage(Handler.java:99)
02-24 13:04:22.007: W/System.err(1160): at android.os.Looper.loop(Looper.java:123)
02-24 13:04:22.007: W/System.err(1160): at android.app.ActivityThread.main(ActivityThread.java:3687)
02-24 13:04:22.007: W/System.err(1160): at java.lang.reflect.Method.invokeNative(Native Method)
02-24 13:04:22.007: W/System.err(1160): at java.lang.reflect.Method.invoke(Method.java:507)
02-24 13:04:22.007: W/System.err(1160): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:842)
02-24 13:04:22.015: W/System.err(1160): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
02-24 13:04:22.015: W/System.err(1160): at dalvik.system.NativeStart.main(Native Method)
Any Idea is appreciated
thanks in advance
Related
I'm trying to process camera image on opencv(2.4.8) and record video together on android.
In the middle of just camera preview, video record is done successfully, however, after starting
image process on opencv, there is EXCEPTION like below. It is not functional videowriter API in opnecv on android, so I used MediaRecorder that is android API to record video.
Is there any way I can solve the problems were occurred by when trying to process image and video record at the same time?
Thanks!
02-24 16:38:50.071: E/AndroidRuntime(8117): FATAL EXCEPTION: main
02-24 16:38:50.071: E/AndroidRuntime(8117): java.lang.RuntimeException: Method called after release()
02-24 16:38:50.071: E/AndroidRuntime(8117): at android.hardware.Camera.setHasPreviewCallback(Native Method)
02-24 16:38:50.071: E/AndroidRuntime(8117): at android.hardware.Camera.access$600(Camera.java:133)
02-24 16:38:50.071: E/AndroidRuntime(8117): at android.hardware.Camera$EventHandler.handleMessage(Camera.java:815)
02-24 16:38:50.071: E/AndroidRuntime(8117): at android.os.Handler.dispatchMessage(Handler.java:99)
02-24 16:38:50.071: E/AndroidRuntime(8117): at android.os.Looper.loop(Looper.java:137)
02-24 16:38:50.071: E/AndroidRuntime(8117): at android.app.ActivityThread.main(ActivityThread.java:4961)
02-24 16:38:50.071: E/AndroidRuntime(8117): at java.lang.reflect.Method.invokeNative(Native Method)
02-24 16:38:50.071: E/AndroidRuntime(8117): at java.lang.reflect.Method.invoke(Method.java:511)
02-24 16:38:50.071: E/AndroidRuntime(8117): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1004)
02-24 16:38:50.071: E/AndroidRuntime(8117): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:771)
02-24 16:38:50.071: E/AndroidRuntime(8117): at dalvik.system.NativeStart.main(Native Method)
This is what I am doing, Firstly into the constructor of Customadapter, I have initilize image cache and image loader
imageCache = new BitmapLruCache();
mImageLoader = new ImageLoader(newRequestQueue(context), imageCache);
then into the getView() method I have done...
String url = imgs[position];
image.setImageUrl(url, mImageLoader);
image.setDefaultImageResId(R.drawable.no_image);
image.setErrorImageResId(R.drawable.error_image);
Where imgs is the array for bitmaps url and image is the object of NetworkImageView. When I execute it, I got error of OutOfMemory. This is my logcat o/p :-
02-24 12:08:08.845: E/dalvikvm-heap(6288): Out of memory on a 144636048-byte allocation.
02-24 12:08:08.845: I/dalvikvm(6288): "main" prio=5 tid=1 RUNNABLE
02-24 12:08:08.845: I/dalvikvm(6288): | group="main" sCount=0 dsCount=0 obj=0x41767b50 self=0x417571d0
02-24 12:08:08.845: I/dalvikvm(6288): | sysTid=6288 nice=0 sched=0/0 cgrp=apps handle=1075191004
02-24 12:08:08.845: I/dalvikvm(6288): | state=R schedstat=( 0 0 0 ) utm=116 stm=35 core=1
02-24 12:08:08.845: I/dalvikvm(6288): at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
02-24 12:08:08.855: I/dalvikvm(6288): at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:502)
02-24 12:08:08.855: I/dalvikvm(6288): at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:355)
02-24 12:08:08.855: I/dalvikvm(6288): at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:815)
02-24 12:08:08.855: I/dalvikvm(6288): at android.content.res.Resources.loadDrawable(Resources.java:1992)
02-24 12:08:08.855: I/dalvikvm(6288): at android.content.res.Resources.getDrawable(Resources.java:666)
02-24 12:08:08.855: I/dalvikvm(6288): at android.widget.ImageView.resolveUri(ImageView.java:616)
02-24 12:08:08.855: I/dalvikvm(6288): at android.widget.ImageView.setImageResource(ImageView.java:349)
02-24 12:08:08.855: I/dalvikvm(6288): at com.android.volley.toolbox.NetworkImageView$1.onResponse(NetworkImageView.java:177)
02-24 12:08:08.855: I/dalvikvm(6288): at com.android.volley.toolbox.NetworkImageView$1$1.run(NetworkImageView.java:168)
02-24 12:08:08.855: I/dalvikvm(6288): at android.os.Handler.handleCallback(Handler.java:725)
02-24 12:08:08.855: I/dalvikvm(6288): at android.os.Handler.dispatchMessage(Handler.java:92)
02-24 12:08:08.855: I/dalvikvm(6288): at android.os.Looper.loop(Looper.java:137)
02-24 12:08:08.855: I/dalvikvm(6288): at android.app.ActivityThread.main(ActivityThread.java:5099)
02-24 12:08:08.855: I/dalvikvm(6288): at java.lang.reflect.Method.invokeNative(Native Method)
02-24 12:08:08.865: I/dalvikvm(6288): at java.lang.reflect.Method.invoke(Method.java:511)
02-24 12:08:08.865: I/dalvikvm(6288): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:803)
02-24 12:08:08.865: I/dalvikvm(6288): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:570)
02-24 12:08:08.865: I/dalvikvm(6288): at dalvik.system.NativeStart.main(Native Method)
02-24 12:08:08.865: D/skia(6288): --- decoder->decode returned false
02-24 12:08:08.865: D/AndroidRuntime(6288): Shutting down VM
02-24 12:08:08.865: W/dalvikvm(6288): threadid=1: thread exiting with uncaught exception (group=0x41766ae0)
02-24 12:08:08.875: E/AndroidRuntime(6288): FATAL EXCEPTION: main
02-24 12:08:08.875: E/AndroidRuntime(6288): java.lang.OutOfMemoryError
02-24 12:08:08.875: E/AndroidRuntime(6288): at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
02-24 12:08:08.875: E/AndroidRuntime(6288): at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:502)
02-24 12:08:08.875: E/AndroidRuntime(6288): at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:355)
02-24 12:08:08.875: E/AndroidRuntime(6288): at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:815)
02-24 12:08:08.875: E/AndroidRuntime(6288): at android.content.res.Resources.loadDrawable(Resources.java:1992)
02-24 12:08:08.875: E/AndroidRuntime(6288): at android.content.res.Resources.getDrawable(Resources.java:666)
02-24 12:08:08.875: E/AndroidRuntime(6288): at android.widget.ImageView.resolveUri(ImageView.java:616)
02-24 12:08:08.875: E/AndroidRuntime(6288): at android.widget.ImageView.setImageResource(ImageView.java:349)
02-24 12:08:08.875: E/AndroidRuntime(6288): at com.android.volley.toolbox.NetworkImageView$1.onResponse(NetworkImageView.java:177)
02-24 12:08:08.875: E/AndroidRuntime(6288): at com.android.volley.toolbox.NetworkImageView$1$1.run(NetworkImageView.java:168)
02-24 12:08:08.875: E/AndroidRuntime(6288): at android.os.Handler.handleCallback(Handler.java:725)
02-24 12:08:08.875: E/AndroidRuntime(6288): at android.os.Handler.dispatchMessage(Handler.java:92)
02-24 12:08:08.875: E/AndroidRuntime(6288): at android.os.Looper.loop(Looper.java:137)
02-24 12:08:08.875: E/AndroidRuntime(6288): at android.app.ActivityThread.main(ActivityThread.java:5099)
02-24 12:08:08.875: E/AndroidRuntime(6288): at java.lang.reflect.Method.invokeNative(Native Method)
02-24 12:08:08.875: E/AndroidRuntime(6288): at java.lang.reflect.Method.invoke(Method.java:511)
02-24 12:08:08.875: E/AndroidRuntime(6288): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:803)
02-24 12:08:08.875: E/AndroidRuntime(6288): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:570)
02-24 12:08:08.875: E/AndroidRuntime(6288): at dalvik.system.NativeStart.main(Native Method)
I cant find any solution that will work for me, So What should I do...
Thanks to Mr. Itai Hanski,
After your suggestion about OOM that OOM doesn't have to do with the network components, I had looked out on any other cause, Finally I found solution :
It was from layout file of listview item, I had set the android:src="" into the Imageview.
When I remove this xml attribute from ImageView, The OOM problem resolve out.
But one thing I still not found that when I set a image for error or loading condition the error again comes out, still I cant uderstand what the real cause of it.
Bitmaps are a real issue in android.
First off - I really recommend you read this post on the developer site.
How is your BitmapLruCache implemented? Here are a few pointers (you can use only some of them):
Limit the number of bitmaps the cache can hold.
Limit the size of the cache itself. The Android guys provide a nice algorithm to decide how large to make it in the linked article.
When possible, call bitmap.recycle().
Use weak / soft references to the Bitmaps in your cache instead of strong one.
Check out this SO answer to a similar question (shameless self plug, but relevant).
You probably don't need to implement all of these at the same time. Choose the ones that work for you.
I am using this project as a reference : The code is avaiable at http://roman10.net/src/affmpeg.zip.
I am trying to compile this project with ffmpeg with different configuration than the project suggests.
I've compiled a new libffmpeg.so and added it to the project.
However, now i'm getting an "UnsatisfiedLinkError"
02-24 11:05:45.644: D/dalvikvm(11363): Trying to load lib /data/data/roman10.media.ffmpeg/lib/libffmpeg.so 0x47b0ec70
02-24 11:05:45.680: D/dalvikvm(11363): Added shared lib /data/data/roman10.media.ffmpeg/lib/libffmpeg.so 0x47b0ec70
02-24 11:05:45.680: D/dalvikvm(11363): No JNI_OnLoad found in /data/data/roman10.media.ffmpeg/lib/libffmpeg.so 0x47b0ec70, skipping init
02-24 11:05:45.684: D/dalvikvm(11363): Trying to load lib /data/data/roman10.media.ffmpeg/lib/libconverter.so 0x47b0ec70
02-24 11:05:45.687: I/dalvikvm(11363): Unable to dlopen(/data/data/roman10.media.ffmpeg/lib/libconverter.so): Cannot load library: link_image[1995]: failed to link libconverter.so
02-24 11:05:45.687: W/dalvikvm(11363): Exception Ljava/lang/UnsatisfiedLinkError; thrown during Lroman10/media/ffmpeg/ffmpegService;.<clinit>
02-24 11:05:45.687: W/dalvikvm(11363): Class init failed in newInstance call (Lroman10/media/ffmpeg/ffmpegService;)
02-24 11:05:45.687: D/AndroidRuntime(11363): Shutting down VM
02-24 11:05:45.687: W/dalvikvm(11363): threadid=1: thread exiting with uncaught exception (group=0x4001d7d0)
02-24 11:05:45.695: E/AndroidRuntime(11363): FATAL EXCEPTION: main
02-24 11:05:45.695: E/AndroidRuntime(11363): java.lang.ExceptionInInitializerError
02-24 11:05:45.695: E/AndroidRuntime(11363): at java.lang.Class.newInstanceImpl(Native Method)
02-24 11:05:45.695: E/AndroidRuntime(11363): at java.lang.Class.newInstance(Class.java:1429)
02-24 11:05:45.695: E/AndroidRuntime(11363): at android.app.ActivityThread.handleCreateService(ActivityThread.java:2940)
02-24 11:05:45.695: E/AndroidRuntime(11363): at android.app.ActivityThread.access$3300(ActivityThread.java:125)
02-24 11:05:45.695: E/AndroidRuntime(11363): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2087)
02-24 11:05:45.695: E/AndroidRuntime(11363): at android.os.Handler.dispatchMessage(Handler.java:99)
02-24 11:05:45.695: E/AndroidRuntime(11363): at android.os.Looper.loop(Looper.java:123)
02-24 11:05:45.695: E/AndroidRuntime(11363): at android.app.ActivityThread.main(ActivityThread.java:4627)
02-24 11:05:45.695: E/AndroidRuntime(11363): at java.lang.reflect.Method.invokeNative(Native Method)
02-24 11:05:45.695: E/AndroidRuntime(11363): at java.lang.reflect.Method.invoke(Method.java:521)
02-24 11:05:45.695: E/AndroidRuntime(11363): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:871)
02-24 11:05:45.695: E/AndroidRuntime(11363): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:629)
02-24 11:05:45.695: E/AndroidRuntime(11363): at dalvik.system.NativeStart.main(Native Method)
02-24 11:05:45.695: E/AndroidRuntime(11363): Caused by: java.lang.UnsatisfiedLinkError: Library converter not found
02-24 11:05:45.695: E/AndroidRuntime(11363): at java.lang.Runtime.loadLibrary(Runtime.java:461)
02-24 11:05:45.695: E/AndroidRuntime(11363): at java.lang.System.loadLibrary(System.java:557)
02-24 11:05:45.695: E/AndroidRuntime(11363): at roman10.media.ffmpeg.ffmpegService.<clinit>(ffmpegService.java:123)
I decided to recompile the converter.so file
however, when running the ndk-build command on it, i receive these messages:
c:\Users\user\workspace\Main\jni>c:\work\android-ndk-r8d\ndk-build
c:/android-ndk-r8d/build/core/build-binary.mk:266: warning: overriding comm
ands for target `c:/Users/user/workspace/Main//obj/local/armeabi/objs/converter'
c:/android-ndk-r8d/build/core/build-binary.mk:266: warning: ignoring old co
mmands for target `c:/Users/user/workspace/Main//obj/local/armeabi/objs/converte
r'
c:/android-ndk-r8d/build/core/build-binary.mk:266: warning: overriding comm
ands for target `c:/Users/user/workspace/Main//obj/local/armeabi/objs/converter'
c:/android-ndk-r8d/build/core/build-binary.mk:266: warning: ignoring old co
mmands for target `c:/Users/user/workspace/Main//obj/local/armeabi/objs/converte
r'
c:/android-ndk-r8d/build/core/build-binary.mk:357: warning: overriding comm
ands for target `c:/Users/user/workspace/Main//obj/local/armeabi'
c:/android-ndk-r8d/build/core/build-binary.mk:357: warning: ignoring old co
mmands for target `c:/Users/user/workspace/Main//obj/local/armeabi'
c:/android-ndk-r8d/build/core/build-binary.mk:439: warning: overriding comm
ands for target `c:/Users/user/workspace/Main//libs/armeabi'
c:/android-ndk-r8d/build/core/build-binary.mk:439: warning: ignoring old co
mmands for target `c:/Users/user/workspace/Main//libs/armeabi'
c:/android-ndk-r8d/build/core/build-binary.mk:357: warning: overriding comm
ands for target `c:/Users/user/workspace/Main//obj/local/armeabi'
c:/android-ndk-r8d/build/core/build-binary.mk:357: warning: ignoring old co
mmands for target `c:/Users/user/workspace/Main//obj/local/armeabi'
"Compile thumb : converter <= cmdutils.c
c:/Users/user/workspace/Main//jni/cmdutils.c:32:34: fatal error: libavformat/avf
ormat.h: No such file or directory
compilation terminated.
make: *** [c:/Users/user/workspace/Main//obj/local/armeabi/objs/converter/cmduti
ls.o] Error 1
What can I do to fix this, and make it work?
According to the error you are missing the libavformat headers.
I found this:
FFMpeg on Android, undefined references to libavcodec functions, although it is listed on command line
I have a problem running tutorial2 (Advanced - Mix java 9+ native
opencv) sample on HTC incredible S.
Other samples work great.
The app terminates immediately with this message: "The application
Tutorial 2 Advanced - 2. Mix Java + Native OpenCV( process
org.opencv.samples.tutorial4) has expired unexpectedly. Please try
again."
Any help or suggestion?
02-24 22:27:12.083: I/Process(2212): Sending signal. PID: 2212 SIG: 9
02-24 23:15:34.915: I/Sample::Activity(2296): Instantiated new class
org.opencv.samples.tutorial4.Sample4Mixed
02-24 23:15:34.935: I/Sample::Activity(2296): onCreate
02-24 23:15:34.935: W/dalvikvm(2296): Exception Ljava/lang/
UnsatisfiedLinkError; thrown while initializing Lorg/opencv/samples/
tutorial4/Sample4View;
02-24 23:15:34.935: D/AndroidRuntime(2296): Shutting down VM
02-24 23:15:34.935: W/dalvikvm(2296): threadid=1: thread exiting with
uncaught exception (group=0x4001d5a0)
02-24 23:15:34.945: E/AndroidRuntime(2296): FATAL EXCEPTION: main
02-24 23:15:34.945: E/AndroidRuntime(2296):
java.lang.ExceptionInInitializerError
02-24 23:15:34.945: E/AndroidRuntime(2296): at
org.opencv.samples.tutorial4.Sample4Mixed.onCreate(Sample4Mixed.java:
35)
02-24 23:15:34.945: E/AndroidRuntime(2296): at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:
1072)
02-24 23:15:34.945: E/AndroidRuntime(2296): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
1785)
02-24 23:15:34.945: E/AndroidRuntime(2296): at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:
1842)
02-24 23:15:34.945: E/AndroidRuntime(2296): at
android.app.ActivityThread.access$1500(ActivityThread.java:132)
02-24 23:15:34.945: E/AndroidRuntime(2296): at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1038)
02-24 23:15:34.945: E/AndroidRuntime(2296): at
android.os.Handler.dispatchMessage(Handler.java:99)
02-24 23:15:34.945: E/AndroidRuntime(2296): at
android.os.Looper.loop(Looper.java:150)
02-24 23:15:34.945: E/AndroidRuntime(2296): at
android.app.ActivityThread.main(ActivityThread.java:4263)
02-24 23:15:34.945: E/AndroidRuntime(2296): at
java.lang.reflect.Method.invokeNative(Native Method)
02-24 23:15:34.945: E/AndroidRuntime(2296): at
java.lang.reflect.Method.invoke(Method.java:507)
02-24 23:15:34.945: E/AndroidRuntime(2296): at
com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:839)
02-24 23:15:34.945: E/AndroidRuntime(2296): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
02-24 23:15:34.945: E/AndroidRuntime(2296): at
dalvik.system.NativeStart.main(Native Method)
02-24 23:15:34.945: E/AndroidRuntime(2296): Caused by:
java.lang.UnsatisfiedLinkError: Couldn't load mixed_sample:
findLibrary returned null
02-24 23:15:34.945: E/AndroidRuntime(2296): at
java.lang.Runtime.loadLibrary(Runtime.java:429)
02-24 23:15:34.945: E/AndroidRuntime(2296): at
java.lang.System.loadLibrary(System.java:554)
02-24 23:15:34.945: E/AndroidRuntime(2296): at
org.opencv.samples.tutorial4.Sample4View.<clinit>(Sample4View.java:91)
02-24 23:15:34.945: E/AndroidRuntime(2296): ... 14 more
02-24 23:20:35.008: I/Process(2296): Sending signal. PID: 2296 SIG: 9
seems like a linking error due to
02-24 23:15:34.935: W/dalvikvm(2296): Exception Ljava/lang/UnsatisfiedLinkError; thrown while initializing Lorg/opencv/samples/tutorial4/Sample4View;
check your project settings for the toolchain for the build settings.
this might bring you more information:
http://opencv.itseez.com/doc/tutorials/introduction/android_binary_package/android_binary_package_using_with_NDK.html
Hello i've been googling a lot today with no luck. The thing is that i'm trying to delete an element from my database but i only get 02-24 14:04:32.635: ERROR/AndroidRuntime(8823): android.database.sqlite.SQLiteException: bind or column index out of range: handle 0x327de0
The table in the database has only one column which is an INTEGER PRIMARY KEY and has a TRIGGER like this
CREATE TRIGGER "FavForeignKey" BEFORE INSERT ON Favorites WHEN (SELECT rowid FROM Sign Where Sign.rowid = NEW.ViewedImage) IS NULL BEGIN SELECT RAISE(ROLLBACK, 'insert on table "Favorites" violates foreign key constraint "Sign.rowid"'); END
i don't know why i'm getting this error, i need some help.
**Here is the query i'm using:**
public void deleteFavorite(int imageId){
m_db.delete(FAVORITE_TABLE, FAVORITES_COLUMN_VIEWED_IMAGE, new String[]{""+imageId});
}
And here's the error stack:
02-24 14:04:32.635: ERROR/AndroidRuntime(8823): android.database.sqlite.SQLiteException: bind or column index out of range: handle 0x327de0
02-24 14:04:32.635: ERROR/AndroidRuntime(8823): at android.database.sqlite.SQLiteProgram.native_bind_string(Native Method)
02-24 14:04:32.635: ERROR/AndroidRuntime(8823): at android.database.sqlite.SQLiteProgram.bindString(SQLiteProgram.java:241)
02-24 14:04:32.635: ERROR/AndroidRuntime(8823): at android.database.DatabaseUtils.bindObjectToProgram(DatabaseUtils.java:191)
02-24 14:04:32.635: ERROR/AndroidRuntime(8823): at android.database.sqlite.SQLiteDatabase.delete(SQLiteDatabase.java:1669)
02-24 14:04:32.635: ERROR/AndroidRuntime(8823): at com.enea.takk.database.DBManager.deleteFavorite(DBManager.java:161)
02-24 14:04:32.635: ERROR/AndroidRuntime(8823): at com.enea.takk.views.ShowImage$1.onClick(ShowImage.java:82)
02-24 14:04:32.635: ERROR/AndroidRuntime(8823): at com.android.internal.app.AlertController$ButtonHandler.handleMessage(AlertController.java:158)
02-24 14:04:32.635: ERROR/AndroidRuntime(8823): at android.os.Handler.dispatchMessage(Handler.java:99)
02-24 14:04:32.635: ERROR/AndroidRuntime(8823): at android.os.Looper.loop(Looper.java:144)
02-24 14:04:32.635: ERROR/AndroidRuntime(8823): at android.app.ActivityThread.main(ActivityThread.java:4937)
02-24 14:04:32.635: ERROR/AndroidRuntime(8823): at java.lang.reflect.Method.invokeNative(Native Method)
02-24 14:04:32.635: ERROR/AndroidRuntime(8823): at java.lang.reflect.Method.invoke(Method.java:521)
02-24 14:04:32.635: ERROR/AndroidRuntime(8823): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
02-24 14:04:32.635: ERROR/AndroidRuntime(8823): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
02-24 14:04:32.635: ERROR/AndroidRuntime(8823): at dalvik.system.NativeStart.main(Native Method)
Some help will be appreciated.
Thanks in advance
try this
public void deleteFavorite(int imageId){
m_db.delete(FAVORITE_TABLE, FAVORITES_COLUMN_VIEWED_IMAGE + "=" +imageId,null);
}