Code Monkey home page Code Monkey logo

ulysses's Introduction

Ulysses is a location/network-aware Place Search Framework (Place refers to GooglePlaces)

Why "Ulysses" ? Because Ulysses is latin name of Homer's Odyssey protagonist: a famous navigator, explorer, curious man.
He always knews his position, seeing stars and so on, so we could says he is "location-aware".
And he always was aware about his means of transport, its ships: so this is "network-aware" property.
And when he had land to any coast, in forced way or not, he always wanted to explore, searching for anything.

And so Ulysses component, an android component for curious people, but (always?) awareness ;D

usage (requires roboguice):

UlyssesSearcher us = Roboguice.getInjector(context).getInstance(UlyssesSearcher.class);
//or via: @Inject UlyssesSearcher us;

us.search(); 
 
List placesHere = us.getSearchResult();

where PlaceHere is class storing search result and distance from geolocation used:

private PlaceHere {
	Place place; // google places 
	float distance; // distance from location used for search
	PlaceDetails placeDetails; // google place place details 
}

UlyssesSearcher implements various interfaces:

  1. LocationUpdater (for a continuos location up2date)
  2. Searcher<StatusSearch,ResultSearch> (from Diane framework )

Then, various delegates (implementing above interfaces) are used in order to retrieve best results belongs various "conditions";
conditions can be "no network" and/or "old location" and/or "i have cache?" and so on:

  • IUlyssesLocationSearcherDelegate obtains best location (or try to)
  • IUlyssesNetworkSearcherDelegate retrieves results using networks (and of course best location, from IUlyssesLocationSearcherDelegate )
  • IUlyssesCacheSearcherDelegate retrieves results from cache, if we don't have network connection

every interface have implementing concrete classes for end-user, simply called UlyssesNetworkSearcherDelegate or similar;
really, UlyssesSearcher uses these 3 delegates for its stuffs.

a watch inside implementation:

every delegates interface extends others interfaces, combining all them together in order to provide a focused interface for particular job:
this super-interfaces comes from another framework, Diane which provides a set of interfaces and abstract classes for location and network searching.
Diane is result-agnostic (all framework is generics based) VS Ulysses which is focused on GooglePlaces.
So, Diane just provides algorithms for searching using last recent location (and to retrieve it) and/or using network.
And finally: SocratesDelegate (a client using Socrates) is responsible to query googleplaces and retrieves result.
It is network-not-aware, so it's called by UlyssesNetworkSearcherDelegate, which takes care of know if network are (not) available.

In addition to backend client, there is also a ui part:
PlacesHereListAdapter, which extends ArrayAdapter and provides an adapter for listactivity or listfragment.
Its layout (list_row.xml) shows place name, icon (an image "place-type" retrieved from googleplaces, using aquery),
distance from actual location ("here"), and rating (also from googleplaces result)

ulysses's People

Contributors

k0smik0 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.