How can I run PowerPoint (.ppt) file in Android programmatically.
You need either implement your own Activity, whish is able to read ppt files, or use a thirdparty application to do it. In that case you need to know the particular action to set to the intent in order to launch it. As I know, quick office can read ppt files.
Related
I want to know how to open files in the app that are present in other apps.
Like Gmail, What's app use file sharing(Attach file) from Gallery and File Manager.
(Could you Suggest a elegant way to do this)
I have an android app which allows the user to gather research data. I want to export the gathered data as an excel file. So the user can work with the data on a desktop computer.
The question is, what is the best way in terms of usability to offer file export to the user?
On idea was to start the email client with the excel file as attachment. But if you have to send this email to yourself just to get the files seem kind of a workaround.
The second idea is to store the file in the android file system. But is there a commen folder for something like that? Like the "Documents" folder in windows? I dont want the user to search too long for his file. And is this really best practice?
The common way, is using the shared intent system and allowing the user to pick which app "he" or "she" wants to use to share the file. You can also save it to the android file system just as easily. There is no common folder which everyone should use. But if you want ease of accessibility for the file, create a new sub-directory under the top-level directory on the device. Use this method to get a reference to the top-level, Environment.getExternalStorageDirectory(). You must have the android.permission.WRITE_EXTERNAL_STORAGE permission declared in your app Manifest. The sub-directory name should be something obvious to that user that the data inside belongs to your app. Furthermore, display a toast that indicates to the user where the file is stored to make it even easier for them.
I am developing an android app that encrypts/decrypts file.
Once a file is encrypted, its extension changes to filename.encrypted ( here filename is itself a fully qualified filename like hello.pdf, so the encrypted file becomes hello.pdf.encypted).
I have intregrated a file chooser intent in my app, so that user don't need to open a third party intent to choose the files.
My problem is, while user selects to Encrypt a file, he should not be allowed to choose files that are already encrypted i.e. having the extension ".encrypted" and when they are trying to Decrypt a file they should only see the files with the extension ".encrypted".
I have seen a lot of file chooser intents like (https://github.com/iPaulPro/aFileChooser) and (http://code.google.com/p/android-filechooser/) but none have the ability to customize the viewable/selectable files. I read a post (Android file chooser) that says, it cannot be done, but I have seen apps that have implemented this feature.
I am need of help in some resources or links that shows me how is that possible to achieve. I strongly believe the functionality is possible.
Besides, I would also like my app to recognize the extension ".encrypted" when viewed from a third party file manager. I believe that is possible by indicating it in the Android Manifest, but I failed to make it possible. I read this post: Register new file type in Android but could not do it.
Looking for some help here.
I found a library https://github.com/Kaloer/Android-File-Picker-Activity for the thing I wanted to achieve.
They have given us provision to specify allowed extensions using putExtra in the intent.
May be it would be useful to others with similar problems.
I had searched through different questions here but still didn't get how to approach it.
So, basically, I have a file in my app that is displayed as if in file explorer, consequently, when user clicks on it - i want to open it using preinstalled program. Say, I want to open a pdf file with a preinstalled pdf viewer. How do I approach this? If there any "automatic" solutions when you just give android a file path and its type and it offers you programs it can be opened with?
Thanks xx
android will appropriate prog to open it if available
Intent contacts = new Intent();
contacts.setAction(android.content.Intent.ACTION_VIEW);
contacts.setData(uri for what u want 2 do);
startActivity(contacts);
I want to ask user to select a file to open from external storage and receive it's path. Preferably I'd like to avoid excesive coding and use some standard method (well known, system-provided intent or similar).
Said file is to be SpatiaLite db file (*.sqlite), so it won't show in Gallery.
Unfortunately there is no Android native file picker, but you can get an open-source one to add in your project, then modify it to fit your needs. Check out this SO question for a good start.
I would also suggest that Android file pickers have intents that you can feel free to use. Unfortunately if the user does not have the proper apps on their device, your intent will not succeed. If this happens, you can always direct the user to download the app. Alternatively, you can check if the file picking intent will succeed (see this advice), and use the standard file picker if so (many users have ASTRO, for example, which I think has an intent you can use), and you can fall back on something included in your app, this will make for a perhaps nicer end to end user experience across apps on their device.