Bundle a file inside app in Android
What I want to do is to have the user press a button of some sort and inside the method of that button I want the system to open up a file (in this case a .docx file) inside a file viewer this would have to be done via an intent but how should that be coded and where do I put my .docx file?
Android doesn't have inbuilt functionality for viewing .docx file.
Your android device should installed .docx viewer (Third party like, Documents To Go, Smart Office, Quickoffice) application then you can open that file using Intent.
Intent intent = new Intent(); intent.setAction(Intent.ACTION_VIEW); String type = "application/msword"; intent.setDataAndType(Uri.fromFile(docx file), type); startActivity(intent);
But if any .docx viewer is not installed then you can direct user to first install that application using Android Market and then after download that app you can open your .docx file in it.
Or you can integrate .docx viewer functionality in application using third party library. I think Apache's docx4j is in java.