I need an option say "Chat with this Contact" included in the options list when you click Contacts in Android and then select options.
Basically what I want to find out is if I can link my application feature say chat directly with the contacts menu in Android? Are there any examples for that?
I don't think we can do that. The options we see on pressing the hard option key ( or soft one on recent handsets) are generated from either xml or by programatically. They are not some kind of a global properties to be set (kind of like Blackberry apps). So, NO...
If you want to send user to your chatting/communication application, you can do that by registering the android.intent.action.SENDTO and/or android.intent.action.SEND intent filters with your activity.
Here's how I did it.
<activity
android:name=".EventCreaterActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<action android:name="android.intent.action.SENDTO" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="sms" />
<data android:scheme="smsto" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/*" />
</intent-filter>
</activity>
If you set these intent filters appropriately, on clicking any contact user will get a prompt to chose between the default messaging application and your application which, I think, fairly serves your purpose.
Related
Right now in my manifest code I have
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter
android:autoVerify="true"
android:label="#string/app_name" >
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https" />
<data android:scheme="http" />
<data
android:name="default-url"
android:host="#string/bc"
android:scheme="#string/bc" />
</intent-filter>
which allow the user to get open with dialog if he click on URL that start with domain of my application for example: pop-up dialog to select the app
and its working fine, however, I'm facing an issue when the user request forgets password he receives a link on his email to reset his password.
the link he received is like this: www.domain.com/forget_password/email.
what I want is to keep the app link working but if the domain contains /forget_password open the browser by default, not the application.
Sorry, there is no "exclude" logic in <intent-filter>. You cannot create an <intent-filter> that says "I accept everything except this".
You will need to handle the forget_password path in your app, perhaps by launching a Web browser yourself.
Im developing a camera app that send images to a server, when user take a pic, the image is saved and send to the server. Now the custumer asked me that there must be a resend option in case of failure of whare ever reason.
How can i add a custom action in the gallery app so that when user press the menu can see a option that says: "Resend image with xxx app "?
Its like picasa, google + does. I'd like to add my own option there.
How is this possible? Some guide will be helpful.
you need to add Intent filter for that purpose. When u'll add intent filter your app will receive data of which you are listening. From gallery we have receive multiple or single option.You can see the link http://developer.android.com/training/sharing/receive.html
<activity android:name=".ui.MyActivity" >
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="image/*" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/plain" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEND_MULTIPLE" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="image/*" />
</intent-filter>
I'm creating a messaging app with Air for Android. I would like to enable other apps to share text to my app via the share menu option.
How do I get my app listed in there?
(This is the menu I would like to get listed in:)
Add an appropriate intent filter in your Activity tag in manifest file.
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/plain" />
</intent-filter>
Your Activity will show up, when Android searches for such Share Intent handlers.
To an Activity that will handle any shared content, add an Intent Filter to your Manifest. For example:
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/plain" />
<data android:mimeType="image/*" />
</intent-filter>
Using Android, when I click on an e-mail address in my default browser, a menu list pops up with Gmail, (an built-in email client), and K-9 (another e-mail application).
I would like to add my android application to appear in this list. Is this possible and how do I do this?
add this intent-filter to your activity in manifiest:
<intent-filter>
<action android:name="android.intent.action.SENDTO" />
<data android:scheme="mailto" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEND" />
<data android:mimeType="*/*" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEND_MULTIPLE" />
<data android:mimeType="*/*" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<data android:scheme="mailto" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
</intent-filter>
You need to create an IntentFilter this requires both Java code, where you create an Activity that is triggered when the system notifies someone is trying to send an email, and changes to your AndroidManifest where you subscribe to the Intent action. Here is an SO Post that explains which intent filters you need: android intent-filter to listen for sent email addresses?
You add these to your Activity entry in your AndroidManifest and then when someone clicks an email it'll show your app. when someone clicks it, it'll open that specific Activity you are going to want to read about pulling data out of intents. Specifically you'll want to pull out: http://developer.android.com/reference/android/content/Intent.html#EXTRA_EMAIL from the extras.
Read about intent-filter here:
https://developer.android.com/training/sharing/receive.html
I have to implement custom dialler application. Well it will not make regular phone call, instead it will connect to some service to estabilish VoIP connection. That is simple part I think I can handle it. But the other part is a bit tricky for me. I want to "register" my dialler somehow in the system to have it in context menu when you click on a phone number link in an e-mail for example. Now, when you click the number, default dialler appears. I want context menu to be shown where you can select if you want to use phone or my dialler. Is it possible? Can someone provide me some more tips?
OK. I know I have to create some intent-filter for that. Here is what I did but it does not work. Still no "My App" in the context menu when clicking phone number in some e-mail message.
<intent-filter android:priority="100">
<action android:name="android.intent.action.CALL_PRIVILEGED" />
<action android:name="android.intent.action.DIAL" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="tel" />
<data android:scheme="callto" />
</intent-filter>
Tha answer for your question is:
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<action android:name="android.intent.action.DIAL" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="tel" />
</intent-filter>