Git Product home page Git Product logo

searchgoogleimages's Introduction

SearchGoogleImages

Parse images from google custom search and show in a grid view

GoogleSearchImageParser dependency

repositories {
    maven { url 'https://github.com/anthorlop/mvn-android/raw/master/' }
}

// GoogleSearchImageParser gradle dependencies
compile 'es.lombrinus.projects.mods:GoogleSearchImageParser:1.1'

Getting image items

        GImageParser.get(q, API_KEY, SEARCH_CX, new GImageParserListener() {
            @Override
            public void onError(String error) {

                Toast.makeText(MainActivity.this, error, Toast.LENGTH_SHORT).show();
            }

            @Override
            public void onSuccess(List<Item> itemList) {

                mAdapter = new MainAdapter(MainActivity.this, itemList, MainActivity.this);

                mGrid.setAdapter(mAdapter);

            }
        });

Required parameters

q: text to search

API_KEY: API Key from google Credentials

SEARCH_CX: Google Custom Search ID

Optional parameters

size

(unsigned integer) Number of search results to return. Valid values are integers between 1 and 10, inclusive.

start

(unsigned integer) The index of the first result to return.

siteSearch

(string) Specifies all search results should be pages from a given site.

imgColorType

(string) Returns black and white, grayscale, or color images: mono, gray, and color.

Acceptable values are: "color": color "gray": gray "mono": mono

imgDominantColor

(string) Returns images of a specific dominant color.

Acceptable values are: "black": black "blue": blue "brown": brown "gray": gray "green": green "pink": pink "purple": purple "teal": teal "white": white "yellow": yellow

imgSize

(string) Returns images of a specified size.

Acceptable values are: "huge": huge "icon": icon "large": large "medium": medium "small": small "xlarge": xlarge "xxlarge": xxlarge


You can generate your own Custom Search: API KEY: https://console.developers.google.com/apis/credentials SEARCH ID: https://cse.google.es/cse

alt text

searchgoogleimages's People

Contributors

anthorlop avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.