Place InSights - Social Analytics App on Android


Published on

  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Place InSights - Social Analytics App on Android

  1. 1. Project 4 Task 2 – Place InSights app on Android By Rohan Nanda Description: My application makes use of 2 APIs. One is Google’s Places API, and the other is Trippin’IN API. My app mashes up information from both these APIs to present social channel details of the closest matched searchstring. The search could be for a place to eat, drink, party, shop or go outdoors in some city. I present the number of checkins on facebook, facebook likes, rankings in top categories and subcategories, and an Instagram photo feed. I use longitude and latitude coordinates from places API, along with other details, and use that as input in trippin’IN’s API. Note: a. Only popular cities work in the input. Although Google places’ library is vast, Trippin’IN’s database of places is limited. Pittsburgh is not in its database. b. It is assumed that the user will enter good valid data as input. Fault tolerance is handled to a fair extent. c. Examples of searches are: Restaurants: Penelope, California Pizza Kitchen in New York Party places:Pacha London d. There is a cap of 50 requests for Places API per 24 hours. 2. Implement a native Android application The name of my native Android application project in Eclipse is: PlaceInSightsAndroid 2.1My application uses TextView, EditText, Button, and ImageView. See main.xml for details of how they are incorporated into the RelativeLayout. Here is a screenshot of the layout before the picture has been fetched.
  2. 2. 1.2. Requires input from the user Here is a screenshot of the user searching for the night club: Pacha London 1.3. Makes an HTTP request (using an appropriate HTTP method) to your web app My application does the HTTP request in The HTTP request is: ""+search where search is the user's search term. The search method makes this request of my web application, parses the returned XML to get the details to show the user 1.4. Receives and parses an XML or JSON formatted reply from the web app My good response is: <response> <title>Pacha London</title> <icon/> <open_now/> <imageurl> </imageurl> <maincategory>Party</maincategory>
  3. 3. <subcategory>Nightclub</subcategory> <totalcheckins>5408</totalcheckins> <totalwerehere>49673</totalwerehere> <totallikes>32394</totallikes> <rank>8</rank> <total>60</total> <gallery> <photo0> pg </photo0> <photo1> pg </photo1> <photo2> pg </photo2> <photo3> </photo3> <photo4> pg </photo4> <photo5> pg </photo5> </gallery> </response> My bad response is: <response> <error>Your text search didn't return results.</error> </response>
  4. 4. 1.5. Displays new information to the user Find below a screen shot of the output: 1.6. Is repeatable (I.e. the user can repeatedly reuse the application without restarting it.)
  5. 5. 2. Implement a web application, deployed to Google App Engine The name of the Google App Engine project in Eclipse is: PlaceInSights 2.1. Uses the MVC design pattern In my web app project: Model: View: prompt.jsp Controller: 2.2. Receives an HTTP request from the native Android application receives the HTTP request with the argument "search". It passes this search string on to the model. 2.3. Executes business logic appropriate to your application does an HTTP request to: 2 APIs, Trippin’ Ins API:[place name]?coordinates=[lat,lng]&KEY=[your API key] and Google’s places API.It then parses the XML response from Google api, puts the coordinates and closest relevant search result in the input of TRIPPIN’IN’s API, and extracts the parts it needs to respond to the Android application. I parse JSON from Trippin’in.
  6. 6. 2.4. Replies to the Android application with an XML or JSON formatted response. I format the response using in-built argument setting while outputting. I set the content type in the servlet PlacesInSightsModelto “text/xml”.