[android-developers] Re: LetterRecognizer API in the Gesture class
Hi Andy, It seems like the LetterRecognizer was never released. But in our app we've added gesture search that works similar and learns the user's handwriting so it gets better in time (it can also be taught new languages). It's not perfect, but you can check it out in Contacts+http://play.google.com/store/apps/details?id=com.contapps.android from the market (you'll need to enable gesture search from settings). We haven't worked on this feature for a while, so I'm sure there's more stuff to improve on it. Mor. On Friday, October 26, 2012 1:55:40 PM UTC+2, Andy India wrote: Hi Mor, Did you get any update about the same like LetterRecognizer in Gesture. I need to implement it in one of my project. You have posted 2 years back. Please help me if you get any update. Thanks, Andy On Tuesday, October 12, 2010 1:29:24 AM UTC+5:30, Mor G. wrote: Hi, I'm implementing a gesture search feature in my application, I've noticed that in the Gesture class docs (http://developer.android.com/ reference/android/gesture/Gesture.htmlhttp://developer.android.com/reference/android/gesture/Gesture.html) it reads: A user-defined gesture can be recognized by a GestureLibrary and a built-in alphabet gesture can be recognized by a *LetterRecognizer*. How can I use the LetterRecognizer? There's no API for that in the docs, I've also searched android's code itself, and besides the same comment above in the code there's nothing. I've implemented a letter recognizer manually by drawing the ABC letters to a gesture raw file and using the regular mLibrary.recognize(gesture) API, but the success rate is not very high, not even close to Google's gesture search app. Does Google's gesture search uses LetterRecognizer? Thanks, Mor. www.contapps.com -- 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
[android-developers] Re: java.lang.IllegalStateException: Fragment MyFragment is not currently in the FragmentManager
There's a solution in stackoverflow: http://stackoverflow.com/questions/11296411/fragmentstatepageradapter-illegalstateexception-myfragment-is-not-currently but it doesn't seem to be helping me, since I'm not instantiating my fragments as he did, but maybe it'll help you. I'm still looking for a solution for myself. On Thursday, June 14, 2012 10:34:05 AM UTC+3, Alexandros wrote: Someone please? On Sunday, June 3, 2012 10:50:33 AM UTC+3, Alexandros wrote: Hello everyone, Some time ago, I updated my application to use the support v4 library in order to use the ViewPager control. The initial version of the application used the FragmentPagerAdapter, however, because the application has a lot of pages it seemed wise to use the FragmentStatePagerAdapter, since I was getting OutOfMemory reports. But now, I am getting reports of another error. The error is: java.lang.IllegalStateException: Fragment MyFragment is not currently in the FragmentManager. I did some searching on the Internet, but nothing solid came up. The problem seems to be happening when the activity is trying to pause and the onSaveInstanceState method is called. After I did some investigation on the support v4 library my self, I noticed that this exception is thrown in the FragmentManager.putFragment() when the member of the fragment mIndex is less than 0, but I cannot figure out when mIndex becomes less than 0 and why this is not handled correctly. *I would like to point out that I do not have an MOR (method of reproduction) for this error.* Here is the call stack: java.lang.RuntimeException: Unable to pause activity my activity with the ViewPager java.lang.IllegalStateException: Fragment MyFragment is not currently in the FragmentManager at android.app.ActivityThread.performPauseActivity(ActivityThread.java:3438) at android.app.ActivityThread.performPauseActivity(ActivityThread.java:3395) at android.app.ActivityThread.handlePauseActivity(ActivityThread.java:3378) at android.app.ActivityThread.access$2700(ActivityThread.java:129) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2124) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:143) at android.app.ActivityThread.main(ActivityThread.java:4717) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:521) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618) at dalvik.system.NativeStart.main(Native Method) Caused by: java.lang.IllegalStateException: Fragment MyFragment is not currently in the FragmentManager at android.support.v4.app.FragmentManagerImpl.putFragment(FragmentManager.java:516) at android.support.v4.app.FragmentStatePagerAdapter.saveState(FragmentStatePagerAdapter.java:185) at android.support.v4.view.ViewPager.onSaveInstanceState(ViewPager.java:881) at android.view.View.dispatchSaveInstanceState(View.java:6098) at android.view.ViewGroup.dispatchSaveInstanceState(ViewGroup.java:1323) at android.view.ViewGroup.dispatchSaveInstanceState(ViewGroup.java:1327) at android.view.ViewGroup.dispatchSaveInstanceState(ViewGroup.java:1327) at android.view.ViewGroup.dispatchSaveInstanceState(ViewGroup.java:1327) at android.view.View.saveHierarchyState(View.java:6081) at com.android.internal.policy.impl.PhoneWindow.saveHierarchyState(PhoneWindow.java:1573) at android.app.Activity.onSaveInstanceState(Activity.java:1094) at android.support.v4.app.FragmentActivity.onSaveInstanceState(FragmentActivity.java:480) at my activity with the ViewPager.onSaveInstanceState(ContentActivity.java:288) at android.app.Activity.performSaveInstanceState(Activity.java:1044) at android.app.Instrumentation.callActivityOnSaveInstanceState(Instrumentation.java:1180) at android.app.ActivityThread.performPauseActivity(ActivityThread.java:3420) Thanks in advanced. -- 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
Re: [android-developers] Re: How to set theme using resources from another application?
Ok, if I forget about using different drawables, and keep my external theme to modifying current's theme existing attributes only, will that be possible? I've seen the method Resources.Theme.setTo(other) which has the following desc.: Set this theme to hold the same contents as the theme other. If both of these themes are from the same Resources object, they will be identical after this function returns. If they are from different Resources, only the resources they have in common will be set in this theme. So this method isn't very useful if the themes are from the same resource, so it's used when the themes are from different resources like I'm having, but it doesn't seem to do the trick and change a single color value (textColorPrimary) I'm setting in the external theme, and after calling the setTo method, i'm getting resourceId as 0. Any pointers on how to properly use Theme.setTo? Sorry for being annoying... :) -- 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
Re: [android-developers] Re: How to set theme using resources from another application?
Ok, if I forget about using different drawables, and keep my external theme to modifying current's theme existing attributes only, will that be possible? I've seen the method Resources.Theme.setTo(other) which has the following desc.: Set this theme to hold the same contents as the theme other. If both of these themes are from the same Resources object, they will be identical after this function returns. If they are from different Resources, only the resources they have in common will be set in this theme. So this method isn't very useful if the themes are from the same resource, so it's used when the themes are from different resources like I'm having, but it doesn't seem to do the trick and change a single color value (textColorPrimary) I'm setting in the external theme, and after calling the setTo method, i'm getting resourceId as 0. Any pointers on how to properly use Theme.setTo? Sorry for being annoying... :) -- 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
[android-developers] Re: How to set theme using resources from another application?
I'm searching for an answer to this as well, found a few related stackoverflow questions, but no full answer yet: http://stackoverflow.com/questions/8762955/android-app-way-to-develop-app-that-has-add-ons http://stackoverflow.com/questions/6066477/hashmapstring-drawable-mdrawables http://stackoverflow.com/questions/7037417/copy-theme-from-another-application On Thursday, April 5, 2012 8:51:58 PM UTC+3, Terry wrote: I'm able to use getResourcesForApplication and getIdentifier to get the individual resources from another application. However, when I try to call setTheme using a remote theme.xml from another app, the references inside theme.xml point to the app that I'm running, not pointing to the remote application where the theme.xml is. As a result, I get a ResourceNotFoundException inside theme.xml where I try to use the styles I defined from the remote app. In other words, I can apply theme.xml but not reference to the styles inside it. Moderator, please don't block this post. I googled for days and have not found a resolution to it. -- 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
[android-developers] Re: How to set theme using resources from another application?
Hi Richard, thanks for the reply. I have an app with light and dark themes defined in themes.xml. I have a setting to allow the user the select light/dark theme in the app. This works great. Now the themes are pretty heavy in graphics, since they define not only styling but different drawables as well, so I want to offer more themes like blue, green, red, etc. as external apks in Google play, like I've seen many other apps have done, so a user could install a MyApp blue theme apk, and then he'll be able to choose this theme from the main app settings. I've tried using: Resources res = pm.getResourcesForApplication(appInfo); Which gets the resources object of the external apk, but I can't seem to get and apply the theme from it using activity.setTheme(externalTheme). I've tried using: Context themedContext = activity.getApplicationContext().createPackageContext(com.myapp.blue, Context.CONTEXT_IGNORE_SECURITY); Which gets a themed context, but again, couldn't set this theme to my running activity. I've read a lot about this, but couldn't find any complete solution. Thanks, Mor. On Thursday, August 2, 2012 12:17:40 AM UTC+3, RichardC wrote: If it's your own application then read about library projects. Otherwise unless the app you are reading resources from is available under a suitable open source licence then in my opinion what you are trying to do could be infringing copyright. If the app is open source then just download it and use the resources. On Thursday, April 5, 2012 6:51:58 PM UTC+1, Terry wrote: I'm able to use getResourcesForApplication and getIdentifier to get the individual resources from another application. However, when I try to call setTheme using a remote theme.xml from another app, the references inside theme.xml point to the app that I'm running, not pointing to the remote application where the theme.xml is. As a result, I get a ResourceNotFoundException inside theme.xml where I try to use the styles I defined from the remote app. In other words, I can apply theme.xml but not reference to the styles inside it. Moderator, please don't block this post. I googled for days and have not found a resolution to it. -- 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
Re: [android-developers] Re: How to set theme using resources from another application?
Hi Dianne, thanks for the info. I've seen methods like Resources.Theme.applyStyle which capable of overriding existing attributes with a supplied style resource-id, which would have been useful if I could tell it from what resource to get the resource-id from. Isn't there a similar method that I can use to only override certain attributes in my existing applied theme? If not, could you maybe suggest a different way to approach this problem? There are lots of themed apps on Android, so I'm sure there's a way to do this. Thanks again, Mor. On Thursday, August 2, 2012 12:51:30 AM UTC+3, Dianne Hackborn wrote: You can't really do this by simply pointing to a theme. The resources object is used across the view hierarchy to load resources; to set the theme from another apk you will need to have the resources coming from there, but then you won't be able to access any of your own resources that you need (like strings etc). On Wed, Aug 1, 2012 at 2:38 PM, Mor G. Hi Richard, thanks for the reply. I have an app with light and dark themes defined in themes.xml. I have a setting to allow the user the select light/dark theme in the app. This works great. Now the themes are pretty heavy in graphics, since they define not only styling but different drawables as well, so I want to offer more themes like blue, green, red, etc. as external apks in Google play, like I've seen many other apps have done, so a user could install a MyApp blue theme apk, and then he'll be able to choose this theme from the main app settings. I've tried using: Resources res = pm.getResourcesForApplication(appInfo); Which gets the resources object of the external apk, but I can't seem to get and apply the theme from it using activity.setTheme(externalTheme). I've tried using: Context themedContext = activity.getApplicationContext().createPackageContext(com.myapp.blue, Context.CONTEXT_IGNORE_SECURITY); Which gets a themed context, but again, couldn't set this theme to my running activity. I've read a lot about this, but couldn't find any complete solution. Thanks, Mor. On Thursday, August 2, 2012 12:17:40 AM UTC+3, RichardC wrote: If it's your own application then read about library projects. Otherwise unless the app you are reading resources from is available under a suitable open source licence then in my opinion what you are trying to do could be infringing copyright. If the app is open source then just download it and use the resources. On Thursday, April 5, 2012 6:51:58 PM UTC+1, Terry wrote: I'm able to use getResourcesForApplication and getIdentifier to get the individual resources from another application. However, when I try to call setTheme using a remote theme.xml from another app, the references inside theme.xml point to the app that I'm running, not pointing to the remote application where the theme.xml is. As a result, I get a ResourceNotFoundException inside theme.xml where I try to use the styles I defined from the remote app. In other words, I can apply theme.xml but not reference to the styles inside it. Moderator, please don't block this post. I googled for days and have not found a resolution to it. -- -- 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
[android-developers] times_contacted not being updated on some devices
Hi, I've noticed some strange behavior when using the times_contacted field in ContactsContract.Contacts (and also the last_time_contacted field). In some Samsung devices this counter counts emails only, in some HTC devices this is always zero, and in other HTC devices this counter is incremented for the wrong contacts (there's a confusion between RawContact ids and Contact ids). Has anyone else came across this issue? Does anyone have a suggested solution to overcome this? I've managed to create a BroadcastReceiver that updates times_contacted for incoming/outgoing calls, but this doesn't solve the wrong contacts issues, and isn't as complete as the counting in Nexus for example (on Nexus it counts calls,emails,smss), also, I don't want to count these calls twice on devices where this counter already works. Any help? Any ideas? Thanks, Mor. -- 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
[android-developers] Re: sectionindexer is not updated when adapter's data is changed
Hi, Look in the code of AlphabetIndexer which implements SectionIndexer as well. http://www.google.com/codesearch/p?hl=en#uX1GffpyOZk/core/java/android/widget/AlphabetIndexer.javaq=alphabetindexersa=Ncd=1ct=rc I think the function you're interested in is setCursor. Good luck. Mor. www.contapps.com On Nov 4, 1:14 pm, manigault manig...@gmail.com wrote: Hi all , I have ListView with adapter class which extends ArrayAdapter and implementsSectionIndexer. The problem is section indexer is not updated when adapter data is changed. Even if i add new elements the section remain the same. I tried some options setFaseScrollEnabled(false); setFaseScrollEnabled(true); but i got IndexOutOfBounds exception. So how can i updatesectionIndexerwhen adapter's data is changed. -- 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
[android-developers] Multi stroke gestures not recognized when last stroke is vertical
Hi, I have a gesture overlay on top of a list, when I do a vertical stroke, onGesturePerformed isn't being called because android assumes this was a scrolling stroke, this is ok. However, when I do a multi stroke gesture, where prev. strokes already recognized as gestures (change color), and the last stroke is vertical, the whole gesture is cancelled and onGesturePerformed is not called. This event should be handled properly by looking at GestureOverlayView's code: final boolean cancelDispatch = (mIsGesturing || (mCurrentGesture != null mCurrentGesture.getStrokesCount() 0 mPreviousWasGesturing)) mInterceptEvents; ( http://www.google.com/codesearch/p?hl=en#uX1GffpyOZk/core/java/android/gesture/GestureOverlayView.javaq=android%20GestureOverlayView%20dispatchTouchEventsa=Ncd=1ct=rcl=493 ) but it is definitely not working for me. Also, mLib.setSequenceType(GestureStore.SEQUENCE_INVARIANT), is not working for me, stops recognizing gestures, like in: http://groups.google.com/group/android-developers/browse_thread/thread/de26b59b55407ed3 Any help would be appreciated. Thanks, Mor. -- 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