Closed chintandesai49 closed 8 years ago
19? What version is that? Api level?
Yes, API level 19 version name KitKat. And I'm loading epub in webview.
The problem lies in ContextHelper class where you encode text to UTF-8 with java. But the StandardCharsets class of java is not available below android KitKat version 19.
StandardCharsets is available since 1.7. Does Android KitKat use 1.6? Or should you use 1.7 when you are developing your app?
In KitKat, it is working as expected,but not below the version. So now what is the port to user this library below KitKat version ?
I'll check the problem myself and see if I find a reasonable solution. Thanks for the notice.
I make it work my way but I can tell you that you can make version specific check and put simple condition in ContextHelper class like this. if(version<19) encodedString = URLDecoder.decode(stringToEncode, "UTF_8"); else encodedString = URLDecoder.decode(stringToEncode, StandardCharsets.UTF_8.name());
That may not be the only thing that is broken in versions below 19. Is it?
Yes, I make it work only by putting version specified checking. But you are the author of the library, it's your call to check another condition.
The problem is fixed in version 1.0.85, released in few hours. Thanks for your cooperation.
App crashes on the version below 19 KitKat but working as expected on version >19 following is the crash report Caused by: java.lang.NoClassDefFoundError: java.nio.charset.StandardCharsets at com.github.mertakdut.ContextHelper.encodeToUtf8(ContextHelper.java:26) at com.github.mertakdut.Reader.mergeTocElements(Reader.java:266) at com.github.mertakdut.Reader.fillContent(Reader.java:162) at com.github.mertakdut.Reader.setInfoContent(Reader.java:32) at com.github.epubparsersampleandroidapplication.MenuActivity$ListBookInfoTask.doInBackground(MenuActivity.java:67) at com.github.epubparsersampleandroidapplication.MenuActivity$ListBookInfoTask.doInBackground(MenuActivity.java:50) at android.os.AsyncTask$2.call(AsyncTask.java:287) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305) at java.util.concurrent.FutureTask.run(FutureTask.java:137) at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569) at java.lang.Thread.run(Thread.java:838)