Having spent two days banging my head against my desk, I've decided to ask for some help...
I'm trying to share videos and other links to my air for android app that I am developing with Flash CS6. I have added to following to my manifest file:
<![CDATA[
<manifest>
<application>
<activity android:name=".ui.MyActivity" >
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/plain" />
</intent-filter>
I know that this is supposed to trigger the activity ".ui.MyActivity" when the SEND intent is invoked. I have also added the following code to my AS code:
NativeApplication.nativeApplication.addEventListener(InvokeEvent.INVOKE, onAppInvoke);
function onAppInvoke(event:InvokeEvent):void {
Status_txt.text = event.arguments.toString()
Status_txt.text += event
}
But i really haven't had much luck. The best result i've obtained is the opening of my app but the event.arguments array is empty. Other results include the foce closing of my app whenever other share with it or the failing of my app to compile.
Does anyone have any advice?
Thanks in advance!
Smollett
Related
I made an Android application in which I want to implement deep linking (example: http://myApp/seeMore?id=123456)
When I send a sms via intent, I receive it, and the link is clickable, and it opens the content of the application I want to see!
What's the problem? If I send myself the link via whatsapp (or messenger), I receive it, but this same link in the whatsapp message is not clickable!
I also tried the format myApp://seeMore?id=123456 (with the Manifest xml updated as it should be), but nothing happens, the link sent is not clickable, even via SMS.
The only time I had a clickable link in whatsapp and messenger, it's with the http://myApp.com/seeMore?id=123456 format. But when I click on the link, it opens the browser saying that the page does not exist.
And I saw that in this case, I have to link my app to my website but I don't have a website... And I don't want to have one!
Questions :
Is there a way to make "myApp://seeMore?id=123456" clickable in SMS, Whatsapp, Messenger apps? By forcing in the code to say that it's a hyperlink? something else? :) )
Is it possible to make the link "http://myapp.com/seeMore?id=123456" work to point directly to my apk and not to the browser? (Did I configure my intent-filter wrong?) I saw a style attribute verifyAuto=true in the xml manifest, but when I tried, it didn't work...
Is it possible to generate a clickable link (even if it's not a url?) via intent send to messenger/whatsapp?
Does anyone have any idea whatsoever for my concern? :)
Here it is, if you have any idea, I'm interested! Thanks for reading and possibly helping me :)
Translated with www.DeepL.com/Translator (free version)
My current AndroidManifest:
<activity
android:exported="true"
android:name=".vue.activity.GraphActivity"
android:screenOrientation="landscape"
android:launchMode="singleTask"
android:parentActivityName=".vue.activity.MainActivity">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<!-- Accepts URIs that begin with "http://speedchyps/course” -->
<data android:scheme="http"
android:host="speedchyps"
android:pathPrefix="/course" />
<!-- note that the leading "/" is required for pathPrefix-->
</intent-filter>
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".vue.activity.MainActivity" />
</activity>
Config when i try "maJolieAppli://seeMore?id=123456":
<intent-filter android:label="#string/filter_view_example_gizmos">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<!-- Accepts URIs that begin with "speedchyps://course” -->
<data android:scheme="speedchyps"
android:host="course" />
</intent-filter>
I am trying to open my app through a url which has a query parameter in it that I need to check to proceed to the next screen. Here is what the Android Manifest for that activity looks like:
<activity
android:name=".ContainerActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:label="#string/app_name"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustResize"
android:theme="#style/AppTheme.NoActionBar"
android:launchMode="singleTask">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER"
/>
<data android:scheme="https" />
<data android:host="myapp" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
</intent-filter>
</activity>
The app launches fine with the uri https://myapp?groupCode=1234 but the problem is that I am getting the same uri every time (on certain devices) even after I uninstall the app and install it for the first time. Here is where I get the uri
Uri uri = getIntent().getData();
Log.d(TAG, "the uri is "+uri);
The uri is always
https://myapp?groupCode=1234
Really lost on this one. I can only reproduce the issue on a couple of devices a samsung s6 is the one I'm working with now. I've tried little things like
android:allowBackup="false"
android:fullBackupContent="false"
I've also tried to capture the new intent in onNewIntent() but I can't seem to get that to fire for this activity. Idea here was to see if setting the new intent would work, but its just mind blowing to me that this doesn't work after a complete uninstall, reinstall and then opening of the app through a url like https://myapp?groupCode=abcd and still getting back the url https://myapp?groupCode=1234
Please help!
EDIT:
I should add that the device I'm not getting it to work on has been using Hockey to get apks onto the device. The way hockey works is kinda crappy, you basically download the apk and then manually install it on the phone. This phone probably has 100 apks on it by now. Is there any way that there is data being cached somewhere where a new app would capture it? I cannot recreate the issue for devices that have not been using hockey/have a ton of apk files. I don't see why this would matter exactly but I'm basically just trying anything at this point.
I will also add that the onNewIntent() was simply not being called because the activity is destroyed by the time you click on the link.
Hi I am trying to create an app that accepts files from other applications. I tried this tutorial, http://developer.android.com/training/secure-file-sharing/setup-sharing.html as well as this one, http://code.tutsplus.com/tutorials/android-sdk-receiving-data-from-the-send-intent--mobile-14878 and nothing seems to work.
here is my manifest,
...
<activity
android:name="com.example.activities.mainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEND_MULTIPLE" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="application/*" />
</intent-filter>
</activity>
...
Yet still for some reason my application won't show up if I try to share files with it from dropbox or anything else. I've tried different mime types, using SEND instead of SEND_MULTIPLE, and starting a clean application project and nothing.
Thanks
EDIT:
Essentially what I want to do is have my app show up in the share menu for all other applications. I managed to get a complete action using... pop up, but this isn't what I'm looking for. Unfortunately all google searches result in the info above.
I believe that I have solved it. for mime type rather than having "application/*" all you need is */*. For some reason, most files are opened as text/plain mime type including excel files. Odd.
I know this has been asked before, and I have looked through a lot of those questions, but none seems to hold the answer for me.
What I am trying to do is to open my app when I click a link, which in my case would look like dots://test.com/. I'm trying to get this working through intents. When I replace dots:// with http:// and use http in my scheme instead of dots, it works fine. But since the only domains I own have got pretty long urls, it's not practical to go that route.
My android manifest looks like this:
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:logo="#drawable/logo"
android:theme="#style/AppTheme" >
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
<meta-data
android:name="ADMOB_ALLOW_LOCATION_FOR_ADS"
android:value="true" />
<activity
android:name="nl.delta6.dots.engine.MainActivity"
android:exported="true"
android:label="#string/app_name"
android:screenOrientation="landscape"
android:theme="#android:style/Theme.NoTitleBar.Fullscreen" >
<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="dots" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.google.android.gms.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" />
</application>
I have tried numerous solutions mentioned in posts like Make a link in the Android browser start up my app? and Launch android application from a browser link, but none seem to work for me. All ideas are welcome.
Edit 1:
Okay, so I noticed that if I click a link on a webpage like dots link, it does launch my app. The links just don't show as links in other apps, though I know that is possible. I'll keep looking around, but if there's anybody who could send me off in the right direction that'd be more than welcome.
I think the best article is here: Make a link in the Android browser start up my app?
Note that you really want to use hackbod's recommendation, which means that registering the scheme "dots" to yourself is not a good idea. The easiest way to create a link that a browser can use is to first, in a test setting, have your intent format itself to a uri:
Intent intent = new Intent(someContext, MainActivity.class)
System.out.println[or use logcat](intent.getUri());
Then just paste the output from intent.getUri() as a url. It will look something like:
intent:#Intent;component=[your/activty/class/NameActivity;]
If you serve that as a link on a website, connect to it on your phone with your app installed and click the link it should then open your app.
Note that you can also add "extras" to your activity using putExtra if you want to see example intent uris that can be used to send extra data back to your app.
So I'm updating an app I created a while ago. In the AndroidManifest.xml I have the following (along with an <intent-filter> for android.intent.action.MAIN) inside an <activity>:
<intent-filter android:label="#string/send_label" android:icon="#drawable/icon">
<action android:name="android.intent.action.SEND" />
<data android:mimeType="text/plain" />
</intent-filter>
If I remember correctly, when I first created this app, the above (minus the android:label and android:icon bits) worked; my app would show up in the "Share" menu. A couple weeks ago I noticed a review of my app on the Market saying that it didn't show up when trying to Share stuff. I checked, and sure enough, it wasn't there.
Is the fact that I have two <intent-filter> blocks for one Activity confusing it? Did I break something between then and now, did something change in the Android API, or what's going on here?
Don't you need to specify a category?
(such as <category android:name="android.intent.category.DEFAULT" />