Make GET/POST calls with google assistant due to own app parameters - android

I am trying to control home appliances through my app. And I have a web server to take requests and make mqtt publishes with this parameter. And I want to make this requests with google assistant. But some parameters should come from my app and some of them come according to user says. For example:
"Turn on kitchen Light"
What google assistant should do:
http:/myserverIp/incoming/param=kitchenLight&param=On&param=userId
What my server should do:
mqtt publish: topic:home/userId/kitchenLight payload=1
I've read google assitant sdk, I watched google io-18/17 assistant talks but I couldn't find right answer. According to picture below I should use "Url template model" but I couldn't find out even where I should locate actions.xml in my android project!
Is it possible to pass data to google assistant from my app and making GET/POST request which is user based?

According to picture below I should use "Url template model" but I couldn't find out even where I should locate actions.xml in my android project!
I think this is the source of your confusion. If you are building a Smart Home Action for the Google Assistant - you're not building an Android project at all. You are building a cloud- or server-based webhook that will take JSON from the Assistant and handle it in some way that makes sense for your devices.
In your case, it sounds like one approach would be to have this webhook act as a sort of proxy to your existing service. So it would take the JSON from the Assistant and turn it into the URL query you are currently expecting.

Related

Google assistant intergration to app without server connection

I am currently creating a remote control app which uses IP control to control devices. I have created this and now I am looking to add a way for you to say for example, "OK Google, Power on 'device' in 'app name'". I have looked at Google's app actions console and I could not find a way to make this as a custom command. I have seen that there is a way to do this by adding deep links into my application. However everywhere I look this requires me to have a host web server which I do not want. Is there any way to do this without a web host or otherwise using the device as it's own host or it's own fulfillment server within the app?
The URL may or may not be resolvable by an HTTP client and it won't send a request to this links. Alternatively, you can also define a custom URL scheme. e.g. myapp://example/{foo}.
https://developers.google.com/assistant/app/action-schema#fulfillment

Google Assistant integration with my custom app?

I am learning about google actions and made a basic, google-keep like app which records notes for logged in users. it has a mobie client and a firebase server. i wish to know if assistant could be made to interact in such a manner that notes could be created via an assistant session without opening the mobile client at all.
For example:
User (on any screen): "hey google"
AI - "hi , how can i help?"
U - " place a note to call david in customNotter" ( suppose)
Ai - "am sorrry, customnotter does not exist on your mobile , download it from playstore http"//www.link..."
U - *downloads customNotter app , installs, logs himself in*
U - " place a note to call david in customNotter"
Ai - "Ok, your note is saved"
*saves note "call david" in customNotter (by somehow calling some code to interact with customNotter's server?)*
I can imagine a kotlin code that could be included in my app , which the assistant could trigger which could simply add the note to server, but cannot imagine how assistant could trigger that code with user's auth details and the note data?
PS: Also i wish to know if google home could also be integrated for such app. And if not , what are the key factors that would limit google home to not interact with my server ? like suppose am building a complete business model for CustomNotter , where there is a unified server and many clients like ios / android / web apps . can google home be able to act like another authenticated client, interacting directly with the server?
The best option is to use Actions on Google to directly make calls to your Firebase server and update the database that way. The hooks into Android apps are not deep at the moment. Android Actions were announced, but are not available right now.
The benefit of doing this is that your Action will work on any Assistant surface, beyond an Android phone, and will not require the user to install your app.
Since you can run Actions on Google on Firebase Functions, it is easy to incorporate into your Firebase database.
You're making a couple of assumptions here, but before I make different assumptions, I want to clarify something. You said "it has a mobile client and a firebase server". I assume the "firebase server" is what stores the user's notes?
If so, then you don't really need to have the app installed locally at all for the Assistant to work with it. You just need to make sure your mobile app and your Action both have the same user account reference, so they can update and read from the same records in the database. This would work anywhere the Assistant can run Actions - on a mobile device or on a speaker such as Google Home.
In this case, your conversation might look like this:
User: Hey Google, ask Custom Notter to remind me to call David.
Assistant: Getting Custom Notter
[Earcon, indicating your Action is running]
Action: Hi there. I've added a note to call David.
[Earcon, indicating the Action is done]
This is a very simple example of the conversation. Other conversation flows may also want to indicate if the user hasn't connected such an app to the account, or you may need to prompt them for permission to use their account, etc.
You will need to write server code to handle the processing - all Actions interact with a webhook running on a server in the cloud. You can write this in any language you wish, including Kotlin, and on any service you wish - however Google provides libraries and other support if you run it in node.js using Firebase Cloud Functions or on Google's Cloud.
All the details are available at https://developers.google.com/actions/
If you do have a mobile app, and you want to look into how to get the Assistant to launch things in that app, you can look into App Actions, which are coming soon for Android.

Enable Deep Linking for an Android app

Recently I built an Android app that consume data through JSON from a back-end. There is no public/front zone, it's only back-end. Moreover I built a showcase-website just to let people know the app exists.
Back-end and Showcase-Webiste reside at two different URLs. In the developer console I enabled the app indexing and the showcase-website is the one I set.
I'd like to add deep linking but I can't figure out how to configure the intent-filter.
For example, suppose my showcase-website URL is this:
http://nolimitsworld.com/
How should I configure the data section of the intent-filter? the host parameter should be?
The question in your subject line is misleading. You do have a public web site, and that's your showcase web site. Use that showcase web site for your intent filter. The backend url only gets called from your android app anyway, so no one needs to know that one but you.
If you still need help figuring it out, please remove the api url from your question, and just show us the url to your showcase web site instead (and only register that one with google).
Now if your other concern is that you wish to index your application without going through any web site at all since most people wouldn't recognize the domain name of your web site anyway, then there is actually no need to do deeping linking and app indexing through google.
You could just get away with indexing the content of your app with a search provider and launching your app with an explicit intent. Google doesn't even need to get involved if you do that.

Integrate Appcelerator Cloud Services to a custom website made with ASP.NET

I'm really new to mobile world, so I'd like to get some opinion from experienced people.
After several days searching over the internet, I'm wondering if it's possible
integrate Appcelerator Cloud Services to a custom website made with ASP.NET, for example.
Although my mobile application, built with Titanium, it's linked to ACS, and works fine, I don't know if
it's possible to manage data stored in ACS from a custom website. To clarify, in one point there is my mobile application
talks to a webserver (ACS, for example) and other point there is a website, to manage the data stored in ACS.
What do you think, someone achieved this?
Or is it preferable to write a webserver from the scratch, store my data in somewhere, and forget about ACS?
Thank you.
Appcelerator says
Appcelerator Cloud Services (ACS) is a Mobile Backend as a Service
(MBaaS), offering a fast and easy way to build connected mobile apps.
Choose from a library of services such as push notification, status
updates, photo storage, and social integration, or create your own
custom cloud services.
Here in this page - Getting Started: Using the Javascript SDK - you can see how we can use javascript SDK which lets you access the Appcelerator Cloud Services server through some simple to use JavaScript calls. You can use this to develop web-based app.
ACS has a REST API which you can access through anything that supports xhr (which .NET does). For instance, to create a new user in ACS, you use the following link:
https://api.cloud.appcelerator.com/v1/users/create.json?key=YOUR APP APP KEY?email=john.smith#company.com&role=teacher
There are other properties you can tag onto the querystring to create a new user from a REST call. They have a complete API using REST. It's all documented. You can even send push notifications to devices from your custom website using the REST API! It's pretty cool.
http://cloud.appcelerator.com/docs/api/v1/users/create#rest
Good luck!

Android Simple client app sending text to google cloud datastore ? example, hints

I am new to this environment and trying to explore while doing this task.
Description: The client application should display a textbox of any kind, and a submit button of any kind.
Assumptions: The server should be written in Google Application Framework and deployed online in a Google Application Framework account.
All in all, this is not an easy task.
First read tutorials on all your basic technologies: AppEngine and Android. There are plenty around. You should know how to make a text box on Android and handle click events.
Then to post some data to AppEngine from Android you'll need:
The hardest part - user authentication. Three options:
Your own username/passwords. You need a signup/login pages on AppEngine and at least a login page on Android. You also need a email confirmation.
OpenID. Easy to setup on AppEngine. Hard to do on Android: Webservice credentials - OpenID/Android AccountManager?
OAuth. Easy on Appengine. Pretty easy on Android. Requires Google account on Android phone and access to it (app privileges - not all people like this).
REST service on AppEngine. Use Resteasy. And GSON for JSON conversion.
REST client on Android. Example, video. Also use GSON.

Categories

Resources