0

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

Jason Sturges
  • 15,855
  • 14
  • 59
  • 80
Rradhak
  • 437
  • 1
  • 4
  • 16

2 Answers2

0

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

1lb3r
  • 498
  • 5
  • 15
0

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().

CommonMan
  • 3,868
  • 2
  • 24
  • 35
  • Thanks Manan....Thats the problem.I need to have it as application specific files (since I dont have sdcard and also I need it sandboxed).There is no built in library for viewing ms formats.I am really looking if someone has faced similar issues in the past to shed some light.The question is simple,but solution isnt:( – Rradhak Nov 04 '11 at 16:21
  • I actually,I did a workaround for this.When I created the file,I created as openFileoutput("filename",world_readable).Then,it could b opened by third party. – Rradhak Nov 05 '11 at 18:11