hide application from android application chooser - android

Hi
I created an application (BookReader) that parses and displays a certain book (given as the default book).
But if I simply copy any other book on my device and attempt to open it, android displays a list of suggested installed applications that can open my book. Among these suggested applications is my app (BookReader) too and if selected it opens that book.
How can set my app so it won't appear in the suggested android apps list? Because I don't want my app to be used for opening other books. Just the default one.
Thanks
NOTE! I want it to appear in the application list. I just don't want to appear as a app suggestion for opening other books or files.

thanks guys!
I solved it by removing the mimeTypes in the manifest file which were inside the intent-filter that was a match for the action of opening those file formats.
Hope this helps others too

Your application is probably registering for an intent that matches the intent used by any book. You probably want to modify your IntentFilter to narrow the scope to only match your specific book somehow. What intent does your book generate?

You will need to modify the AndroidManifest.xml to remove the IntentFilter that listens for books. If you paste the contents of this file, I can provide more exact details.
Did you take an open source eBook reader and try to package individual books as their own applications?

Related

Getting xml from other applications in android.

I have two applications, can i get the complete xml file of application 1 in application 2 ?
I am currently getting the individual resources application 1 in application 2 by using package manager.
So my first suggestion is to just re-make the xml file in the second application.
However, I am assuming that since you are getting resources from the other application that you want to be able to interact with the second app, in which case I would suggest reading through the Android documentation on Intents:
http://developer.android.com/guide/topics/intents/intents-filters.html
If you want to share xml data you would need to create a content provider for this purpose.

Choosing application to open file with programmatically

My application is trying to open a text file, and is presented with a list of apps that are able to open the text file, for eg (HTMLViewer, OpenOffice, etc). I want my application to open text file via OpenOffice automatically, without the list dialog popping out. Is there any ways to do that programmatically?
NOTE: This question is assuming that the user has the necessary applications installed and the applications mentioned in this question only serve as examples.
What you are looking for is setPackage()
Set an explicit application package name that limits the components this Intent will resolve to. If left to the default value of null, all components in all applications will considered. If non-null, the Intent can only match the components in the given application package.

QR if statement?

I was wondering if anyone has solved this problem. I want to scan a QR code from my android phone that will ultimately launch an Android App. If the app exists, the app is launched with some unique information. If the app doesn't exist then it takes the user the marketplace to download the app. Can this be done?
Any help will greatly be appreciated :)
Sure, you can write an app that can do that. Barcode Scanner actually does some of the things you want (e.g. opening the market from a code), it's open source, if you need some samples take a look there. The project also has a library that you can use to scan QR-/barcodes.
Keep in mind that a QR-code is nothing else than a String in a machine-readable format. You can encode a package name in a code and scan that. When you successfully did that, just test if the app with that package name is present on the device. If yes, run it via an Intent (you can use PackageManager.getLaunchIntentForPackage() for that). If not, link to the market page via Intent.ACTION_VIEW with a market url. You may encode some extras into the QR-codes, depending on which size you choose for these.
The benefit from the package name only is that there are many codes already out there that link to the android market site of a certain app. Their format is
market://search?q=pname:com.example
As you can see, theres already a packagename included (here com.example).
You can parse and use it. If you want extras, you have to encode your own qr-codes though.

Android Development: How To Add App To The Application Chooser?

Basically I want to add my application to the application chooser list for files with the type .php, .java, .js, .html etc. so that users can browse for a file using any file browser and use my app to open it.
I've looked at tutorials for Broadcast Receivers but none of them have shown how to do this, they've just shown how to listen for the phone state changing and stuff.
Help! :(
Thanks,
Alex!
Although I never used it, I think this might help you: Intent-Filters.
And also this thread from anddev.org.

Any way for users to communicate a parameter to an Android application?

In Android Live Wallpapers, the usual Android View classes cannot be used (as far as I know). Therefore, if you want to let a user select a file, you would have to write your own File Chooser interface pixel by pixel. This would be an extraordinary endeavor.
Is there any way for users to pass a parameter -- such as a file name or directory location -- to an Android application?
Live Wallpapers have a mechanism to have a settings UI associated with them that can be set when the user is selecting the wallpaper. This is android:settingsActivity described here: http://developer.android.com/reference/android/R.styleable.html#Wallpaper
You might consider using Open Intents. For example, apps like OI File Manager offer intents like PICK_FILE that let other app developers use their functionality. Installing may add several clicks the first time but it's otherwise fairly seamless (just like choosing an attachment from Gmail).
Check out:
Open Intents: Pick Folder
Open Intents: Pick File

Categories

Resources