google / search-samples Goto Github PK
View Code? Open in Web Editor NEWSample code for integrating with Search.
Home Page: https://developers.google.com/search/
License: Apache License 2.0
Sample code for integrating with Search.
Home Page: https://developers.google.com/search/
License: Apache License 2.0
Steps to reproduce:
adb -s 01a4968dd882b783 shell am start -a android.intent.action.VIEW -d "http://recipe-app.com/recipe/pierogi-poutine" com.recipe_app
Expected result
public and personal content should be indexed and searchable like described here: https://codelabs.developers.google.com/codelabs/app-indexing/#12
Actual result
content isn't indexable nor showing up google search results on the device
runProguard is no longer supported
In the documentation ( http://search-codelabs.appspot.com/codelabs/voice-search#6 ), there is an old import of the play-services-appindexing library, namely com.google.android.gms:play-services-appindexing:6.5.87
The app itself uses methods for appIndexing, which are not available in this method, but in com.google.android.gms:play-services-appindexing:7.0.0, please update the codelab example accordingly.
Would be nice to see it in the list at https://github.com/google
http://search-codelabs.appspot.com/codelabs/android-deep-linking#3 : this link say to select android-deep-linking folder, but there is no folder of deep-linking, there is only five folder
In the app-indexing
sample, onStop()
has the following code to end the indexing action and log the result:
final String TITLE = recipe.getTitle();
final Uri APP_URI = BASE_APP_URI.buildUpon().appendPath(recipe.getId()).build();
Action viewAction = Action.newAction(Action.TYPE_VIEW, TITLE, APP_URI);
PendingResult<Status> result = AppIndex.AppIndexApi.end(mClient, viewAction);
result.setResultCallback(new ResultCallback<Status>() {
@Override
public void onResult(Status status) {
if (status.isSuccess()) {
Log.d(TAG, "App Indexing API: Recorded recipe "
+ recipe.getTitle() + " view end successfully.");
} else {
Log.e(TAG, "App Indexing API: There was an error recording the recipe view."
+ status.toString());
}
}
});
mClient.disconnect();
The problem with this is that immediately disconnecting from the client means the ResultCallback
will never fire, making it pointless. Either the ResultCallback
should be removed from this sample, or the code should wait until the result is received to disconnect, a la:
result.setResultCallback(new ResultCallback<Status>() {
@Override
public void onResult(Status status) {
if (status.isSuccess()) {
Log.d(TAG, "App Indexing API: Recorded recipe "
+ recipe.getTitle() + " view end successfully.");
} else {
Log.e(TAG, "App Indexing API: There was an error recording the recipe view."
+ status.toString());
}
mClient.disconnect();
}
});
We may have uncovered a bug in GSDTT.
We have sample code that reveals the bug.
Is this the proper forum to post the sample code for evaluation?
/jay gray
On step 8 towards the bottom of the page, there is the text "There should be an existing deep link in the app for each API call."
If you click on the the link deep link
, it directs you to the Uri http://localhost:22080/app-indexing/webmasters/app
The overview has the following point
An existing Android app that you can publish in the Play Store. (optional)
This is misleading since I spent hours trying to make this run on my app and it did not. Any voice commands issued to Google Now could not be redirected to my app. I changed the namespace of the example app and tried to run it and the same thing happened.
The app is published on Play Store as "Recipe Sample" as a result the Google now only works for "Search for salad on Recipe Sample". I cannot change the label of the app and use that instead. This must be clearly mentioned in the tutorial.
how to run it locally with terminal?
thanks.
Would be great to include instructions for developers who use Eclipse.
The AppIndexing sample uses the view/viewEnd API from AppIndexApi. These methods are marked as deprecated in the API documentation and it is suggested that start/end should be used instead.
"deep_link" hyperlink on Step 9. at the bottom gives "Error: Not Found"
The websites NDTV Scroll and times now are having non standard AMP Logos. Does these websites pay google to show their stories even when yhe logo is not as per standard. Google had given a documentation describing about logo. Action and words are different when cases of bigger companies come up
Hello,
On step 3 where it says to execute this command:
adb shell am start -a com.google.android.gms.actions.SEARCH_ACTION \
--es query "salad" com.recipe_app
If I execute it as a one single line, I get the following result:
>adb shell am start -a com.google.android.gms.actions.SEARCH_ACTION \ --es query "salad" com.recipe_app
Starting: Intent { act=com.google.android.gms.actions.SEARCH_ACTION pkg= --es }
Error: Activity not started, unable to resolve Intent { act=com.google.android.gms.actions.SEARCH_ACTION flg=0x10000000 pkg= --es }
If I copy/paste it directly from the tutorial (two lines) I get the following result:
>adb shell am start -a com.google.android.gms.actions.SEARCH_ACTION \
--es query "salad" com.recipe_appStarting: Intent { act=com.google.android.gms.actions.SEARCH_ACTION }
Plus I get the app prompted but not showing the results nor the filtered search as you can see here:
Any idea what am I doing wrong?
Thanks in advance!
Relevant Stack Overflow: http://stackoverflow.com/questions/35710385/image-missing-and-required-wordpress-amp-structure-doesnt-add-image-attribute
I'm in the same situation. Thousands of posts on a site where I'm enabling AMP. Most of back-catalog has missing "featured image" in WP because the feature didn't exist at the time AND because some posts just don't have images (also applies to some new posts, though most have images because we make it a publishing condition now). Whenever there's no featured image the WP plugin does the right thing and leaves the 'image' field empty.
From what I can tell, this is acceptable from a schema.org perspective, and isn't an "error". Correctly, Webmaster Tools doesn't treat a missing image as an "error".
What it DOES do is treat it as an "issue" of type "Info: Invalid structured data element", and lists it along with errors in the AMP section of Webmaster Tools.
I want to get rid of these warnings, and it would be pretty easy to do so by setting a default image to go in that field of the structured data. This is exactly how we use Open Graph's image field for Facebook and friends, so our logo shows on posts with no image.
IS THAT ACCEPTABLE IN THE CONTEXT OF AMP?
That's the question I find unclear when reading the docs: https://developers.google.com/search/docs/data-types/articles
It says "The representative image of the article. Only a marked-up image that directly belongs to the article should be specified." but this doesn't clarify my question, nor does it express how warnings will constantly show if you fail to specify an image.
Obviously if I set a default image I risk people seeing our logo in the carousel and finding it useless, but from our perspective this is still better than not being shown at all. On the other hand if Google is going to PUNISH us somehow for re-using a generic image then it wouldn't be worth it at all.
Any clarity here would be very useful, a clarification in the docs would be even better.
Thanks for any feedback,
Hello,
there is an ambiguous method - getAllRecipes() in AppIndexingService.java. It is not clear what the implementation of this method should look like, or whether it is mandatory for this sample. Can you please advise?
Igor
Hi!
In order to make the sample app compatible with latest Android Studio (0.9.0) and Android Lollipop, please update API level to 21 and add Gradle 0.14.0 support.
Thank you.
I'm doing the App Indexing codelab and I've noticed that all the sample code here contains local.properties
files... You get warning from AS when importing the code because of course the SDK location is not the one defined in that file (points to some guy's Linux home folder). The repo also contains some .gradle
and .idea
folders and .iml
files than shouldn't be there. Please clean up the repo.
my phone is android p. when I use Deeplink jump to my App, start a new Activity and finish it. it delay 3 - 4 s to back. I tested that all my mobile phones were the same.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.