I need to open my my files in /data/data/{package-name}/files using QuickOffice in Android

600 views Asked by At

I need your hrlp.Right now,I am struck in here. 1)My device does not have an sdcard. 2)In my app,I have MS files under my Internal Memory like ppt,xls and even pdf 3)I have quickoffice in my device. 4)When ever I launch a view intent using the appropriate Mime type ,I get the follwing error:

ERR/Quickoffice(15141): java.io.FileNotFoundException: /data/data/packagename/files/folder/something.pptx (Permission denied) 01965 ERR/Quickoffice(15141): at org.apache.harmony.luni.platform.OSFileSystem.openImpl(Native Method) ERR/Quickoffice(15141): at org.apache.harmony.luni.platform.OSFileSystem.open(OSFileSystem.java:152) ERR/Quickoffice(15141): at java.io.FileInputStream.(FileInputStream.java:82) ERR/Quickoffice(15141): at java.io.FileInputStream.(FileInputStream.java:134) ERR/Quickoffice(15141): at android.content.ContentResolver.openInputStream(ContentResolver.java:300) ERR/Quickoffice(15141): at com.qo.android.quickcommon.OfficeActivity.a(Unknown Source) ERR/Quickoffice(15141): at com.qo.android.quickcommon.OfficeActivity.a(Unknown Source) ERR/Quickoffice(15141): at com.qo.android.quickword.Quickword.onCreate(Unknown Source) ERR/Quickoffice(15141): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1052) 01965 ERR/Quickoffice(15141): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627) ERR/Quickoffice(15141): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679) 01965 ERR/Quickoffice(15141): at android.app.ActivityThread.access$2300(ActivityThread.java:125) 01965 ERR/Quickoffice(15141): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033) 01965 ERR/Quickoffice(15141): at android.os.Handler.dispatchMessage(Handler.java:99) 01965 ERR/Quickoffice(15141): at android.os.Looper.loop(Looper.java:123) 01965 ERR/Quickoffice(15141): at android.app.ActivityThread.main(ActivityThread.java:4627) 01965 ERR/Quickoffice(15141): at java.lang.reflect.Method.invokeNative(Native Method) 01965 ERR/Quickoffice(15141): at java.lang.reflect.Method.invoke(Method.java:521) 01965 ERR/Quickoffice(15141): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858) 01965 ERR/Quickoffice(15141): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) 01965 ERR/Quickoffice(15141): at dalvik.system.NativeStart.main(Native Method)

Is there any workaround/solution.Please suggest:)Thanks in advance

2

There are 2 answers

2
CommonMan On

The file inside your package name can be accesses by only your application. If you want to have this file access outside of you app, write it on some shared location e.g. getExternalStorageDirectory().

0
1lb3r On

You have to use a ContentProvider to give access to files inside your internal storage.