Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reader loads really slow on Android #103

Open
shlomizadok opened this issue Jul 4, 2023 · 5 comments
Open

Reader loads really slow on Android #103

shlomizadok opened this issue Jul 4, 2023 · 5 comments
Labels

Comments

@shlomizadok
Copy link
Contributor

I was wondering if anyone else experiences that?
It happens on all Androids, but gets even worse on older (3-4 years old) Androids.
It takes more that 2 minutes to load & parse a 500kb epub file.
(Network and connectivity are fine)
Has anyone encountered similar behavior?
Any direction on how to resolve this?
Thanks 🙏

Copy link

This issue is stale because it has been open for 90 days with no activity.

@github-actions github-actions bot added the stale label Mar 13, 2024
@victorsoares96
Copy link
Owner

Are you using an epub in base64 format?

@Upendra672
Copy link

I was wondering if anyone else experiences that? It happens on all Androids, but gets even worse on older (3-4 years old) Androids. It takes more that 2 minutes to load & parse a 500kb epub file. (Network and connectivity are fine) Has anyone encountered similar behavior? Any direction on how to resolve this? Thanks 🙏

even i am facing the same issue on android

@victorsoares96
Copy link
Owner

@Upendra672 can you provide me with the device specifications so I can perform some tests? and if possible the .epub file or its size

@aliMurtaja
Copy link

Are you using an epub in base64 format?

Yes I am using base64, having same problem, application is very slow, when I swipes to next page, it takes around 2min to navigate, is there any solution ?

This is my code

import React, {useEffect, useState} from 'react';

import { SafeAreaView, Text, Button } from 'react-native';
import { Reader, useReader } from '@epubjs-react-native/core';
import { useFileSystem } from '@epubjs-react-native/file-system'; // for Bare React Native project
import { Annotations } from './Annotation';
import { Bookmarks } from './Bookmarks';
import { BookmarksList } from './Bookmarks/BookmarksList';
import Toc from './TableOfContents';
// import { useFileSystem } from '@epubjs-react-native/expo-file-system'; // for Expo project
import ExampleE from './../../src/components/baseSF/base64'
import { Formats } from './Formates';
var RNFS = require('react-native-fs');

export default function Epub() {
const [basesf, setBasesf] = useState(null);
function onPressLearnMore() {
RNFS.readFile(RNFS.ExternalStorageDirectoryPath+ "/clinic/another.txt").then((res)=>{
setBasesf(res)
}).catch(err=> console.log(err))
}

useEffect(()=>{
console.log('FILE WRITTEN! 2', basesf)
}, [basesf])

if(!basesf){
return <Button
// onPress={()=>onPressLearnMore_(RNFS.ExternalStorageDirectoryPath+ "/clinic/example.epub")}
onPress={onPressLearnMore}
title="Learn More"
color="#841584"
accessibilityLabel="Learn more about this purple button"
/>
}

return (
<SafeAreaView style={{ flex: 1 }}>
<Reader
src = {"data:application/oebps-package+xml;base64,"+basesf}
fileSystem={useFileSystem}
width={"100%"}
height={700}
/>

);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants