I have an idea to open the Google Glass native application using GCM service.
Could anybody help me with this. Is that possible.
As of right now, there is no Google Play Services on Glass. Thus you can't register for GCM messages on Glass.
However, I do see GCMBroadcastReceiver in GlassHome's apk manifest, so I assume, they added (or in progress of adding) some pieces of Play Services. Will see what's gonna happen when they officially release Glass :)
Just to summarize, no, it is not possible to open native Glass app using GCM. At least right now
You can achieve the same thin using the Mirror API to insert a card that can then be used to launch a GDK app. Specifying a menu item as like below will insert a card with a menu that the user can tap to launch
"menuItems":[
{
"action":"OPEN_URI",
"id":"OpenAppId",
"payload":"my.package.name.scheme://open?param1=value1¶m2=value2",
"values":[
{
"displayName":"Accept",
"iconUrl":"https://my_url_dot_com/glass_menu_icons/ic_done_50.png",
"state":"DEFAULT"
},
{
"displayName":"Accepting",
"state":"PENDING"
},
{
"displayName":"Accepted",
"state":"CONFIRMED"
}
]
},
You'll need this intent filter on your Android manifest file:
<intent-filter>
<data android:scheme="my.package.name.scheme" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
And can then access the query params passed in the payload as Intent extras.
Related
While developing an IoT device integration with Android app I'm stuck at this problem.
What I wish to achieve is to talk to my app, for example, "Alexa, What is the temperature inside the cooker?". For this info to retrieve, I have an android app connected to smart cooker via bluetooth and the app than can read the temperature info from cooker.
Now how do I get the query in my android app and how can I return my response as "The current temperature in cooker is 100 degree celsius". and alexa could verbalize it for me.
Here is what I've done so far.
I created an account with amazon developer console
Registered my app there and copied API key into my android project
Added their lib in my android project
Used Login With Amazon service to get the accessToken
requestContext = RequestContext.create(this)
requestContext.registerListener(object : AuthorizeListener() {
override fun onSuccess(authorizeResult: AuthorizeResult) {
accessToken = authorizeResult.accessToken
Timber.d("Access Token: %s", accessToken)
}
override fun onCancel(auth: AuthCancellation?) {
Timber.e(auth?.description)
}
override fun onError(error: AuthError) {
Timber.e(error, error.localizedMessage)
}
})
signInBtn.setOnClickListener {
AuthorizationManager.authorize(
AuthorizeRequest.Builder(requestContext)
.addScopes(ProfileScope.profile(), ProfileScope.postalCode())
.build()
)
}
Here is the manifest's relevant declarations
<activity android:name="com.amazon.identity.auth.device.workflow.WorkflowActivity"
android:theme="#android:style/Theme.NoDisplay"
android:allowTaskReparenting="true"
android:launchMode="singleTask">
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<!-- android:host must use the full package name found in Manifest General Attributes -->
<data android:host="${applicationId}" android:scheme="amzn"/>
</intent-filter>
</activity>
I've been following this documentation.
What do I have to do to get the query in my application to process and return the result? or is it possible at all?
You need to create a Smart home skill to do it, the way you need to go forward is
create a smart home skill , reference documentation here
Once you have created a smarthome skill(you would have created a backend server in the process) and the user has enabled the skill in his Alexa account after this whenever the user asks "Alexa, What is the temperature inside the cooker?" you will get a directive request to your server , which you can then route it to the android app and have the android app send response to the AVS directly or through your server .
I am trying to open an app that I made from mobile chrome browser.
https://developer.chrome.com/multidevice/android/intents
From this link, I figured that I must use the "intent:" syntax to do the job.
However, my app doesn't open. Instead, it opens the Google Play Store, but the store just shows the "item not found" page.
I would love to know if I'm doing anything wrong.
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="myscheme" android:host="myhost" android:path="/"/>
</intent-filter>
This is the intent filter that I wrote.
var androidIntentUrl = 'intent://myhost/#Intent;scheme=myscheme;package=my.test.app.package;end';
if(!isIOS && isChromeAndBiggerThanVer25()) {
location.href = androidIntentUrl;
}
And this is what I wrote on the web.
Must the app be released on Play Store to make this happen?
I don't quite understand the whole stuff yet.
I want to know what's wrong.
PS) The names "myscheme" and "myhost" are just names that I made up for writing this question. The actual names in my code match those written in my project settings and all, including the package name.
As Alexey commented on my post,
<a href="myscheme://myhost/some/other/parameters">
worked just okay for me.
I double checked the official document (the link on my post) and my chrome version (which is 71), so I have no idea why the intent:// syntax did not work.
I guess there were changes on mobile Chrome after version 25 that I missed or couldn't find.
I just encountered the same problem where linking with Intents did not work but the direct scheme linking did. However, I didn't want to use the direct version to have a fallback redirect to the PlayStore.
The solution was that the package parameter in the intent link did not have to match the package given in the AndroidManifest.xml. I was working with a Unity project and had to use the bundle name given in the project setting.
tl;dr: this is still working in Chrome (v78), but the package parameter is not necessarily the package given in the manifest.
The package parameter should match your application id (found in build.gradle or your AndroidManifest.xml)
The sample code above shows package as my.test.app.package, if this is not your app package name or if the app is not installed, the intent will default to the Google Play Store to search for it. Similarly, it would be best change the host and scheme parameters to something custom to your app if you haven't already.
My answer is to open android application from web app using deep linking:
Flipkart - Open Flipkart!
WhatsApp - Open WhatsApp!
Clash Royale - Open Clash Royale!
FaceBook - Open FaceBook!
If the listed application is installed in your mobile then only it will open or you have to handle the case separately.
I am trying to connect Google Now SEARCH_ACTION with my searchable activity using this piece of code in my AndroidManifest.xml:
<activity android:name=".SearchableActivity">
<intent-filter>
<action android:name="com.google.android.gms.actions.SEARCH_ACTION"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</activity>
I am following instructions on http://android-developers.blogspot.com/2014/10/the-fastest-route-between-voice-search.html and https://developer.android.com/guide/components/intents-common.html#SearchOnApp.
This is just not working. The search from Google Now is not launching my app. I have verified that:
This works for Eat 24 app, confirming that there's no issue with right version of OS/Google app/Locale.
I can launch app from inside my app and receive typed search queries, confirming that my SearchableActivity code doesn't have any issues.
Anyone has gotten this to work? Could you please let me know what I am missing here?
Well... looks like the app needs to be published on Play Store:
https://plus.google.com/+AndroidDevelopers/posts/afSRdDQiy1N - look for comments by Jarek Wilkiewicz. Going to try this next.
This is driving me really crazy. I am new to Android development but experienced in iOS development. I wanted to implement Parse Push notifications to an Android app and all is going fine:
The devices are registered at Parse
While sending a test Push message the Parse system tells me that the message is received
BUT: I don't receive anything on my Android test devices.
I have already created new Parse Apps and Android Studio projects but without any luck. Any help on debugging this or is this a Android studio related issue?
EDIT: I just followed the Push service quick guide so I added some lines to the Manifest and added this to my code
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_inlog);
Parse.initialize(this, "xxx", "xxx");
ParseFacebookUtils.initialize("1515015192073818");
ParseInstallation.getCurrentInstallation().saveInBackground();
Manifest:
<receiver android:name="com.parse.GcmBroadcastReceiver"
android:permission="com.google.android.c2dm.permission.SEND">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<!--
IMPORTANT: Change "com.parse.starter" to match your app's package name.
-->
<category android:name="com.pootentieel.andrew.sbpootentieel" />
</intent-filter>
</receiver>
Did you changed com.parse.starter to match your package name and have you registered push callback receiver activity?
EDIT:
goto this link github.com/ParsePlatform/PushTutorial and import the android project and change the keys. Then run the android project and send a push to see if it works. If it works check both the projects side by side to see what is causing the problem. Please mark this answer as correct if it helped thanks :)
I'm trying to use deep-linking from Google+ into an Android app, following http://developers.google.com/+/mobile/android/share/deep-link.
I can share to Google+. The link in the post is "clickable" (it highlights during touch), but does nothing on release. Also, the post contains a suspicious "undefined" line of text.
sample http://raw.github.com/concreterose/TestDeepLink/master/README_ASSETS/sample_share.png
I have enabled deep linking in Google Developers Console project credentials.
I'm using a signed-in PlusClient created with Scopes.PLUS_LOGIN, posting via:
Intent shareIntent = new PlusShare.Builder(this, plusClient)
.setText("Testing deep link")
.setType("text/plain")
.setContentDeepLinkId("deeplink",
"title",
"description",
Uri.parse(thumbnailUrl))
.getIntent();
startActivityForResult(shareIntent, 0);
I'm not sure if I need all of these, while trying to get things working I have:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.USE_CREDENTIALS" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
The handling activity (given as the first activity in the manifest):
<activity android:name=".ParseDeepLinkActivity">
<intent-filter>
<action android:name="com.google.android.apps.plus.VIEW_DEEP_LINK" />
<data android:scheme="vnd.google.deeplink" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
</intent-filter>
</activity>
is:
public class ParseDeepLinkActivity extends Activity {
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Log.i(TAG, "onCreate");
throw new RuntimeException("got here");
}
}
I'm building with the release keystore and testing on a several real devices running 4.4.
I've tried:
Using the PlusShare.Builder(activity) constructor (without plusClient), no change.
Using addCallToAction(label, uri, deeplink) instead of setContentDeepLinkId. There is no call to action button, and clicking the post goes to uri and not the deep link.
Triple checking "Deep linking: Enabled" is set correctly in the developers console.
Building without proguard, no change.
Uninstalling the app then clicking the link (supposed to open the play store entry), does nothing.
Signing with a different key. Plus sign in fails (as expected).
Using different versions of play services (4.0.30 vs 3.2.+).
adb shell setprop log.tag.GooglePlusPlatform VERBOSE does not generate any log messages.
Fetching my API access token and verifying it has auth/plus.login, it does.
Can anyone tell me what I'm doing wrong? Thanks!!
Update: This is now working, apparently fixed by a Google Play Services update.
It turns out this a known issue that will be fixed with the next Google+ update:
Google+ Interactive shares on android are broken in version 4.2.4.58179886
Its generally best to share a URL marked up with schema.org rather than passing the title, description and image. Because there is no URL, the link will never be clickable on web (you need to use setContentURL to have that) - but it should open the application on Android.
That said, the undefined does indeed look suspicious. There are two concerning things there, the first being that the link doesn't work, and the second that description is no longer generally shown in regular shares. There is a known issue with interactive posts to Android, which hopefully should be resolved early in the new year, and I am wondering if that is also effecting the sharing of deeplinks.
To narrow it down, could you try testing with schema.org marked up URL in setContentURL (e.g. https://developers.google.com/+/web/snippet/examples/thing), and passing null for title, image and description on the setContentDeeplink call?