I would like to open this directly from my program, is it possbile?
I checked this, but cannot found relevant information
https://developers.google.com/maps/documentation/android-api/intents
If it is impossible, is there any alternative way?
You can't do that from your activity.
In the image above you can see a dialog that catches the voice of the user, this is because Google Maps calling an intent ACTION_RECOGNIZE_SPEECH, and you can't start an intent and after calling Maps.
Here is the only documentation that I found on the internet for that question. The Adding Voice Capabilities. Just remember that these voice actions are task-based and are built into the Wear platform. So you need to use Android wear for that, see Maps API on Android wear.
Just read the two documentation to understand more. Also take note, that do not violate any terms of service on the Google Maps. Here is one example question for that.
So far, I have not used this voice capablities, so I'm not sure if it will really help you, but I think I give you a small idea with it. Goodluck and Happy coding :)
Related
I am trying to write an app that hooks into the "navigation to" functionality of Google Now but I am unable to figure out exactly how it works. I suspect it's using "Intent.ACTION_VIEW" and then passing it some special URL but I haven't been able to find any documentation on that. Thanks in advance for the help.
You probably want to look into implicit intents.
Specifically for GPS navigation, you have a detailed explanation right here:
https://developers.google.com/maps/documentation/android-api/intents#display_a_map
if you want to do something more specific, just ask :)
That "special URL" you are referring to is a URI (so the schema is geo, as opposed to a URL where the schema is usually http).
P.S. here's some material about implicit intents :
https://developer.android.com/guide/components/intents-filters.html
and if you are in the process of learning the android framework, then I recommend Udacity's free course "developing Android Apps"- Google engineers explaining Android. That will save you a lot of time for sure!
When I am initializing a Speech recognition app, I use this line of code:
Boolean b=SpeechRecognizer.isRecognitionAvailable(cContext);
Why does b always equals false on some devices (the emulator for example)?
I understand what the function does from its description on Android documentation, but the documentation does not say what to do to make voice recognition available.
Do I have to setup something else on my emulator?
Do you know how to make Speech recognition always available?
The problem IS real, so don't downvote before knowing. I solved it myself. The ultimate solution is to verify programmatically, that Google Search app is INSTALLED and ENABLED. If not, the best practice is to use intents to take the user to the Play Store for download/update, or to the App Info screen within settings to enable it. I did it, and it worked, if you need the code just let me know.
I'm developing an Android app that will do a Google Image Search and return the images to the user in a list. I've looked around on StackOverflow and have run into some problems. First off, I'm a total newbie programmer with only 4 months' worth of programming experience, so I appreciate you guys being patient with me.
I looked through Google Image Search API and I know it's being depreciated and will get shut down someday. Because of this, I don't want to use it. After extensive research on the topic, I don't want to use Bing or another image search service, and I don't want to do a "reverse image search. I just want to use a simple image search via string. I've used this app (https://github.com/tonytamsf/Android-Image-Search) to look at the code, but in all honesty, it's just not helping and it's confusing me more on how to exactly search for an image on Google. Plus, the app won't compile in Eclipse :(
I've also looked around at Google Developer APIs, and I'm not sure if I need to turn on an API key for myself? Still, a bit confused about that. I thought I needed to do a custom search engine, but just by looking at that, I don't think it's exactly what I'm looking for.
Can anyone point me to some resources for this? I would really appreciate it. Thank you!
Just a heads up, but what you're asking is pretty challenging and it sounds like you're just getting started. Here's what I can suggest though:
To get that demo code working in eclipse, I had to right-click the project, click properties, click Android, then check the box for the version of android installed. (I had android 19 installed, and the code was expecting 16, so it was giving up. Tell it to use what you have, which probably is 19). This worked for me after using the git plugin in eclipse to import the project. If you are importing a different way, you may have different issues. * Using git and importing the project is a good skill to have, so if that's unfamiliar territory, take the time to look at that.
Ok, that's the end of what I am sure of. The rest is an educated guess, but I'm sure others can correct me.
Next, if tinkering with that project isn't enough, getting real google image search working will take several skills, especially since the old API is gone. In total you'll need to know:
Java
Android programming
google cloud services
google custom search API
REST
some other libraries to glue the custom search to your app
It's a big chunk there. Currently, it seems the only way to use google's image search is to run a google app engine (you basically set up an online account for google to run a server for you. It does computation and sends messages back and forth for you. You only get a little bit for free each day and then if you want more you have to pay. This is one-way Google earns money. It's not something they let you run on your own computer anymore.). Then you make your android app talk to that server using your new login ID, and the server will take the search term and send back the answers to your android app.
You can get the app engine running and use it in chrome without dealing with android to save yourself time, then add the android part later in the future. Good luck!
Google provides a variety of 'cards' for Google Now (http://www.google.com/landing/now/). Is it possible to create your own cards? The system looks pretty modular, but I haven't found any documentation or instructions to do so. (I believe you need to supply the content of the card, and some way of signaling when it is supposed to be shown. There is probably just some interface that you have to implement.)
If there is no documented solution, a hackish/undocumented way would be ok, too. I'm mostly curious how it works.
Edit: Specifically, does somebody have knowledge about the internals of Google Now, e.g. by decompiling the .apk? What I've seen suggests it is pretty modular, and it should be fairly easy to drop another class into the .apk, or to maybe inject code using Cydia Substrate. I know that there is (as of Nov. 2013) no official way to add new cards.
There is currently no way to do that. Google makes its own cards and custom application cannot register any cards. But I hope it will be possible in future.
Actually Google announced last week that developers can now develop custom Google Now cards:
http://www.google.com/landing/now/integrations.html
However, a developer guide seems not available yet.
Edit:
On the end of the page they point out that:
We'll let you know when we are able to onboard more partners
There is a work-around that will soon allow you to place cards in Google Now's stream at a particular time or a particular location: Use Google Keep (https://drive.google.com/keep/)
You can create a new card at Google Keep with a time based or location based reminder, depending on which the relevant card will show up in Google Now.
Since Google Keep is now in Drive, the API is expected to be available soon (keep a lookout for it at http://discovery-check.appspot.com/ )
There is not way to do this by your own at the moment. If you really want to do it you can fill in this form: https://services.google.com/fb/forms/nowintegrations/. You can ask Google if they want to cooperate to create a Google Now card.
Note quite an answer, as it is still not possible to create Google Now cards, but you can now hook into the Google Now search function (basically Android's Siri) and provide custom search results. For example you can say "show me the lyrics to..." and it opens a lyrics app.
Here is a link to the project which is based on the Xposed framework.
Just guessing from my impression of the Google Search apk (which includes all the Google Now functionality and even the home screen on KitKat), it should be possible to use a similar technique to inject cards into the app - however since the app is huge and very complicated, it will be a lot of work. I'd keep my eyes open on the xda-developers forums, wouldn't be surprized if someone there solves this in the future.
It appears that there is developer documentation on how to push google now info via email, eg. flight details, restaurant reservations etc.
https://developers.google.com/schemas/now/cards
I have yet to dig into this, but may update this answer if I discover anything significant.
I'm looking for an Automatic Speech Recognition solution for Android that can handle many locutors at the same time. I need a solution that can understand who is speaking what.
For example, if I have two users in front of my app, and if they are speaking at the same time, I need to know who said "YES" and who said "NO". My grammar is very simple, if it helps...
I've already tested both Android Recognizer Intent and implemented SpeechRecognizer, so I can already recognize the words, but I cannot associate them to specific locutors.
By the way, If you know this kind of solution for other platforms such as iOS or web-based app, I'll take it as well :).
Thank you.