Hi, Thanks for the response.
I've done all preparations as done by Google's example, including the gesture file in res/raw. 99% of the time everything works fine, onGesturePerformed is called and I get right answers from the recognize function, but in some cases (haven't figured out which yet), I crash on the recognize call. BTW, I'm using a large gestures file, containing about 30 gestures, I don't think it's too big for android, because Google's gesture search contains all English letters and numbers at least. Any idea? Thanks, Mor @ Contapps. On Sep 3, 2:59 pm, Filip Havlicek <havlicek.fi...@gmail.com> wrote: > Hi Mor, > > do you have your gestures file in res/raw directory? Do you have the > necessary preparations done in your onCreate method? They are the same as in > the example provided by Google, ie "GestureLibraries.fromRawResource", > "GestureOverlayView gestures = findViewById" and > "addOnGesturePerformedListener"? That should be enough, works fine for me in > the example. > > Best regards, > Filip Havlicek > > 2010/9/3 marmor <gaz...@gmail.com> > > > > > > > > > I got a crash with the following stack trace: > > > E/AndroidRuntime( 6709): Uncaught handler: thread main exiting due to > > uncaught exception > > E/AndroidRuntime( 6709): java.lang.IllegalArgumentException: > > Comparison method violates its general contract! > > E/AndroidRuntime( 6709): at java.util.TimSort.mergeHi(TimSort.java: > > 864) > > E/AndroidRuntime( 6709): at java.util.TimSort.mergeAt(TimSort.java: > > 481) > > E/AndroidRuntime( 6709): at > > java.util.TimSort.mergeCollapse(TimSort.java:406) > > E/AndroidRuntime( 6709): at java.util.TimSort.sort(TimSort.java:210) > > E/AndroidRuntime( 6709): at java.util.TimSort.sort(TimSort.java:169) > > E/AndroidRuntime( 6709): at java.util.Arrays.sort(Arrays.java:2500) > > E/AndroidRuntime( 6709): at > > java.util.Collections.sort(Collections.java:1952) > > E/AndroidRuntime( 6709): at > > android.gesture.InstanceLearner.classify(InstanceLearner.java:84) > > E/AndroidRuntime( 6709): at > > android.gesture.GestureStore.recognize(GestureStore.java:134) > > E/AndroidRuntime( 6709): at > > android.gesture.GestureLibrary.recognize(GestureLibrary.java:64) > > E/AndroidRuntime( 6709): at > > > com.contapps.android.search.SearchResults.onGesturePerformed(SearchResults. > > java: > > 130) > > > Line 130 in my code is: > > ArrayList<Prediction> predictions = mLibrary.recognize(gesture); > > and it is the first line in onGesturePerformed(GestureOverlayView > > overlay, Gesture gesture). > > > Any idea what's wrong and what checks can I perform on gesture before > > sending it to recognize to avoid this crash? > > > Thanks, > > Mor > > @ Contapps. > > > -- > > You received this message because you are subscribed to the Google > > Groups "Android Developers" group. > > To post to this group, send email to android-developers@googlegroups.com > > To unsubscribe from this group, send email to > > android-developers+unsubscr...@googlegroups.com<android-developers%2Bunsubs > > cr...@googlegroups.com> > > For more options, visit this group at > >http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en