Open sumanabhi opened 6 years ago
If urgent,You can check out the source code and debug in your project,I'm busy on my work these days。I will solve the problem latter。
Besides,Strings in library is in chinese,you'd better modify the source code and compile it,And I will fixed latter too。
Sorry for my bad English
use compile 'com.github.deparse:DocumentView:-SNAPSHOT',and try again。
Files are saved int the directory you specfied。If you don't specfied DocumentView.TEMP_PATH,files will be saved in directories like /sdcard1/packagename/caches/files/filename_md5code.extname。If you don't have a sdcard, files will be saved in internal cache dir(context.getCacheDir()/caches/files/filename_md5code.extname)
If files are saved in internal cache dir,normally we can't find the file in apps like file browser.
If files are saved in internal cache dir,normally we can't find the file in apps like file browser.
By the way,I have added the multi-language support(English and Chinese),If you want to use other language,you can call DocumentHelper.setMessageProvider() to provide a MessageProvider,in which you can customlize messages in your language
Aditionally,as My English is bad,if any error of Strings in library,please let me know,thank you!
Hi,
Where should we have to define this DocumentView.TEMP_PATH as I have already saved the file on some path, so I can just have to pass the file path to your activity.
Thanks for the quick support.
Refer to app module in source code。
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
Intent intent = new Intent(MainActivity.this, DocumentViewerActivity.class);
intent.putExtra(DocumentView.FILE_PATH, listView.getAdapter().getItem(position).toString());
intent.putExtra(DocumentView.TEMP_PATH, Environment.getExternalStorageDirectory().getAbsolutePath() + "/test01/");
startActivity(intent);
}
});
DocumentView.FILE_PATH refers to the file which is to be viewed,it can be local file path on storage or url or asset path DocumentView.TEMP_PATH specify a directory used to save the downloaded temp files。 If DocumentView.FILE_PATH is an url or asset path,the file will be downed to the DocumentView.TEMP_PATH first, and then load it into the DocumentView
Yes, I have already go through this module and I just don't want to save this content anywhere else. as I have the requirement that we could not save the content for the user available space. So, Just tell me that when I have the file path of android Directory. It is necessary to specify a directory DocumentView.TEMP_PATH first if the file path i am passing to you is already the Directory Path of Internal Storage.
Please clarify this.
If the file path is already the Directory Path of Internal Storage,DocumentView.TEMP_PATH is not necessary。
Intent intent = new Intent(MainActivity.this, DocumentViewerActivity.class);
intent.putExtra(DocumentView.FILE_PATH, "/data/packagename/cache/test.xlsx);
startActivity(intent);
Is that answered your question exactlly? I can't get exactlly what you mean sometimes due to my bad English。
So, I am doing also the same way passing my file Directory Path of Internal Storage to the calling Intent
Intent intent= new Intent(MainActivity.this, DocumentViewerActivity.class); intent.putExtra(DocumentView.FILE_PATH, "/data/user/0/com.emedicoz.app/files/663309djangobookwzy482.ppt"); startActivity(intent);
but it is showing this error or I guess unable to open the file.
Did you make sure that the file exists? Can you send the file to me?Mail: 365168907@qq.com
Did you try it on a real phone? I didn't make any test on simulator
I just ran the sample on a simulator,and found that the TbsReaderView don't support simulator。
01-15 14:52:12.571 2454-2454/com.deparse.testlib E/TbsReaderView: not supported by:pptx
So,just run the app on a real device.
Ok, Let me check on the real device.
No, the Same error I am getting on the Real Device also even Real device get Crashed.
Process: com.test.the app, PID: 8290 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.test.app/com.deparse.documentviewer.DocumentViewerActivity}: java.lang.RuntimeException: DocumentHelper.init() is never called. at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2339) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2413) at android.app.ActivityThread.access$800(ActivityThread.java:155) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1317) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5343) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:700) Caused by: java.lang.RuntimeException: DocumentHelper.init() is never called. at com.deparse.documentviewer.DocumentHelper.a(TbsSdkJava:102) at com.deparse.documentviewer.DocumentView.view(TbsSdkJava:73) at com.deparse.documentviewer.DocumentViewerActivity.onCreate(TbsSdkJava:19) at android.app.Activity.performCreate(Activity.java:6010) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1129) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2292) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2413) at android.app.ActivityThread.access$800(ActivityThread.java:155) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1317) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5343) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:700)
One more question is it licensed?
Oh Shit, My mistake I have not initialized the DocumentHelper.init(this); in the app class. Let me update this and recheck
Ok,you try it first。I seached the internet and found some similar issues and they din't give any solutions. I guess this is because that some phone models is not compatible。I will try my best to find out a solution。
Getting the Error "Unable to view the file on mobile"
Did you get the error:
01-15 14:52:12.571 2454-2454/com.deparse.testlib E/TbsReaderView: not supported by:ppt
Yes I am getting the same error
So,the problem can not be solved in a short time,You‘d better find some alternative solutions。
ok
When I find any solutions,I will contact you on Github.
Anyone found the solution of the above mentioned problem? If yes, Kindly share the solution or if anyone has alternatives for the same, kindly do share it.
I don't think that there is any update from @deparse end. So, right now there is no solution as such available
So, May you please tell me how you resolved this problem and what you did if you didn't get the solution for that.
Thanks & Regards Aryan Vats
On Sun, Aug 23, 2020, 12:39 PM Abhinav Suman notifications@github.com wrote:
I don't think that there is any update from @deparse https://github.com/deparse end. So, right now there is no solution as such available
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/deparse/DocumentView/issues/1#issuecomment-678738562, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQU5OOSNYSBQLLDWU3W27HDSCC6EJANCNFSM4ELWAM5Q .
Try some other repo in this there are some more problem as well.
Hi, I am now able to load the Dependencies but still having some issues with making the build.