Thanks, I'm developing on 2.1 and 2.2. The gesture file was created on 2.1.
It fails rarely on 2.1, but I haven't witnessed it with my 2.2 device, only got to see crash logs. I will investigate further, thanks! On Sep 5, 5:53 pm, Filip Havlicek <havlicek.fi...@gmail.com> wrote: > Hi Mor, > > if it works with 99%, it's going to be hard. Right now I would try to > determine conditions under which the error is thrown. > > For example, are you using the application on the same version of Android OS > as you created the gesture file? I'm pretty sure it shouldn't be a problem, > but who knows. Try to recreate the gestures file (on multiple versions of OS > if possible). > > Aren't you using some deprecated methods? They might be fine when developing > application on, let's say 1.6, but might be an issue when you deploy the > application to 2.2. > > It might be a bug in the gestures framework, although I wouldn't go that far > yet. > > Best regards, > Filip Havlicek > > 2010/9/5 marmor <gaz...@gmail.com> > > > > > > > > > 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><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<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