TextClassificationManager is available from API-26. Its public methods available for classify text .
My requirement is i need to detect language from a giver Text offline.
TextClassificationManager also have detectLanguages() method but its hidden.
Can i Use TextClassificationManager to detect language ?
I have searched a bit and i Found This Project Using TextClassificationManager by Reflection. But it throws NoSuchMethodErrror and Returns ..
So if anyone Used TextClassificationManager for this purpose can help me .
It's a bad decision to use hidden functions via reflection. You can never know if the function will be there and available so you have to prepare a fallback mechanism.
For Android SDK 26-27 You can try and use this Android lib project - https://github.com/rmtheis/language-detection but be aware that it's no longer maintained so use it for your own research but it's probably not a good idea to use it for production or apps released in Google Play.
Related
I was wondering if it's possible to use hidden methods of an open-source API by creating a copy of the API under a new name without the member method marked as hidden?
If it can't be done (because people would have already done that instead of using reflection), what are the reasons for it?
Thanks in advance!
EDIT: Just to clarify, I'm asking in the context of APIs which are a part of the Android framework (AOSP)
I'm learning about natural language processing, and are required to make a project.
I'm trying to build an application that checks spelling for Vietnamese. However, I just stopped in putting data into the software. I do not know how to split the input data and how to write the code to checks spelling.
I know, Android have APIs support this. Who can recommend me an API and how to use it? Thanks a lot!
I'm using a Google API (in this case, Classroom) for an Android app using com.google.api.services.classroom.Classroom. I want to cache the results on the device for speed/offline usage. Is there a quick-and-easy way to do this that uses the same java API? Can put something like an HttpResponseCache in the middle there somewhere?
Depends on your definition of "quick-and-easy", but I think the accurate answer here is no (!)--those methods are designed to be used "online."
I am a Computer Science undergraduate student and I am creating an Android app that using an API to interact with an execution server.
The server takes a xml file and do various stuff with it(get data, process data etc.)and then gives back data as output. Both input and output are exchanged via this API.
The problem is that the API references code from javax.xml.bind, for example, JAXBContext while android doesn't have javax.xml.bind package in its core. (a well known issue)
Feasible solutions on the internet seems to be repackaging the code I need, but I don't know exactly what suppose to be.
Since the API reference classes in javax.xml.bind and javax.net, I guess I have to extract code from these 2 packages and make them part of the API (I have access to API source) and then repackage the API. However, I guess classes inside javax.xml.bind might have dependencies on other classes that not supported by Android, so does javax.net. (Please forgive me if this is stupid thought...)
So anyone know : whether there are classes, which codes in javax.xml.bind and javax.net depends on, not supported by android ?
Bit of tricky question really..
I will be really appreciated if you can provide a work around that enable a Android app to call an API that reference codes inside javax.xml.bind.
Try JiBX (http://jibx.sourceforge.net/), it's a small and fast footprint, Android compatible, XML binding framework.
I ended up with repacking those package which exists in standard Java library but not in Android. Basically, just get source code of all those missing packages and then put them into the API source and rename them into a name that is different from the original one and then change corresponding code in API that reference these methods as well (you have to use a different name, otherwise code reference methods in these package will still looking for methods in the core Library (i.e Android API)
Anyway, hope it helps. If you have the same problem.
If you have any better suggestion. Please share it!
I am making application which is using a deprecated API. I have to submit it on Apple and Android App Store next month.
In this case, is there any chances to reject the application from app Store of Iphone And Android.
Don't use a deprecated API. Almost nobody deprecates something without providing an alternate means to accomplish the same task. Use the documentation to discover these alternatives, and adjust your code accordingly. What happens if iOS 5 comes out tomorrow, for instance, and all of a sudden your code breaks on those devices. You'll be scrambling to fix it. Fix it now while you have some time.
Android should not be a problem due to the fact that they won't look at your code. Apple will probably check your code and if they see it, they will most likely tell you that you are using deprecated API, but I don't think they will reject it if it is working flawlessly with it.