Send MMS with Photo via html link in android - android

I am wondering if its possible to have someone click on a link in a browser on android, and it will make a camera pop up so you can capture a image then send it via mms?

Yes, this can be done. Just have the link be something that one of the components in your manifest has an intent filter set for. So for instance, lets say you have an activity called MyActivity. Then the following would go in the manifest:
<activity name="MyActivity">
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:scheme="http" android:host="special.url.from/your/webpage"/>
</intent-filter>
</activity>
My activity then directs them to take a picture and send it via MMS.

Related

Intent filter not working for "geo:" scheme in Android

I have noticed that when someone shares a location in WhatsApp using WhatsApp location share feature, tapping on the location opens up application chooser which included both GMAP and Uber. Initially, it looked like it was something like the "ACTION_VIEW" intent with a "geo:" scheme. I am trying to make my Android app handle the "ACTION_VIEW" intent with a "geo:" scheme, but tapping on the location in WhatsApp is not working as expected. Here is my code in the AndroidManifest.xml file:
<activity
android:name=".MapActivity">
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data
android:scheme="geo"
android:host="*"/>
</intent-filter>
</activity>
When I tap on a location shared from WhatsApp, the Android system is not showing my app as an option in the app chooser. I have checked that my app is installed and that the activity is declared in the manifest file.
What could be the reason for the intent filter not working as expected, and how can I fix it? Does WhatsApp use any other type of DeepLink for this? When hovering or clicking the location from a PC, it redirects to https://maps.google.com/maps?q=23.7797847%2C90.4065005&z=17&hl=en
I was using similar intent filters. The main difference is that host is not specified. As I remember * in host should be used to match subdomains.
<intent-filter >
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:scheme="geo"/>
</intent-filter>

I have set my flutter app for deep links in Android, but when I tap on external link, it open my app as in-app popup. Why?

What I want to achieve is that if user tap on the link e.g. on Whatsapp:
HTTP://dev.mycompany.com/qr/asd89f7as98df78
This link will open my app supplied with the deep link.
But the issue is this link actually open my app inside the Whatsapp. So when I open the app switcher, it looks like there are two instances of my app opened. How can I fix this?
I suspect this has something to do with the way I configure my intent filter on Android Manifest. But I'm inexperienced with intent-filter. This is the current configuration for my intent filter(s):
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="http" android:host="dev.mycompany.com" />
<data android:scheme="https" />
</intent-filter>
Is there anything I can do to fix the problem? The first intent filter is the default when I create the app. The second one is from copy pasting from solutions I find on stack overflow. But I don't think this is the fully correct solution. I don't want the app to can be opened as popup.

How to open android application when an URL is clicked in the browser

I have to open my android application, when user clicks on a link that has my domain name. For example, lets say my domain is abc.com and i have posted this link on my Facebook page. When one of my friend(who has my application installed in his device) clicks on the link(in the device's browser), i should be able to open my website in a webview inside my application.
I am not sure how to get this work, but will intent-filters work? If so, can someone give me a piece of code to start with?
You have to define a custom Intent Filter in the activity that should be launched when the url is clicked.
Let say that you want to launch the FirstActivity when a user click a http://www.example.com/ link on a web page.
Add this to your activity in the Manifest :
<activity android:name=".FirstActivity"
android:label="FirstActivity">
<intent-filter>
<action android:name="android.intent.action.VIEW"></action>
<category android:name="android.intent.category.DEFAULT"></category>
<category android:name="android.intent.category.BROWSABLE"></category>
<data android:host="www.example.com" android:scheme="http"></data>
</intent-filter>
</activity>
When the user will click a HTML link to http://www.example.com/, the system will prompt either to use the browser or your app.
You can achieve this by using URI schemes (link e.g. myscheme://open/chat), add into your manifest this filter into e.g. main activity section (set your scheme name):
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="YOUR_SCHEME_NAME" />
</intent-filter>
In your activity where you've set filter, you can get URI by calling this (in onCreate):
Uri intentUri = getIntent().getData();

Android: open Activity from URL show instead of calling app in recent apps

I have an IntentFilter set in my Activity like:
<intent-filter>
<data android:host="www.example.com" android:scheme="http" android:pathPrefix="/d/"/>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
</intent-filter>
its working great to launch the Activity when a link is pressed, the problem is that looking in recent apps, my Activity shows in the preview of the calling app, instead of having its own instance.
for example: if a link with the url is clicked from WhatsApp, in recent apps I see my Activity in the preview for WhatsApp, instead of seeing my app opened in addition to WhatsApp.
I checked other apps and none of them is acting like that.
how do I fix this ?

Adding My App to The Gallery App menu

I am trying to set my application what will be a tool to edit pictures, to the menu in the gallery app of the android phone. I know it should go with the intent-filter but I can not get it to work.
<activity android:name=".Compass" android:label="#string/main_compass_tool_button">
<intent-filter android:label= "#string/main_compass_tool_button">
<action android:name="android.intent.action.SHARE"/>
<data android:mimeType="image/*"/>
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
The reason it is not working is because the action should be
android.intent.action.SEND
Not
android.intent.action.SHARE
I've mixed up the two also. SHARE is what you are supposed to show in the interface when sending a SEND intent - there is no SHARE intent.

Categories

Resources