Place InSights - Social Analytics App on Android

  • 150 views
Uploaded on

 

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
150
On Slideshare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
0
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 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. 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 PlaceInsightsServlet.java. The HTTP request is: "http://1.placeinsights12.appspot.com/Place_InSightsServlet?searchstring=penelope"+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> http://graph.facebook.com/180159821999925/picture?type=large </imageurl> <maincategory>Party</maincategory>
  • 3. <subcategory>Nightclub</subcategory> <totalcheckins>5408</totalcheckins> <totalwerehere>49673</totalwerehere> <totallikes>32394</totallikes> <rank>8</rank> <total>60</total> <gallery> <photo0> http://distilleryimage0.s3.amazonaws.com/3f650200473211e39a6122000ae8039f_6.j pg </photo0> <photo1> http://distilleryimage5.s3.amazonaws.com/a4b5ea0c473211e3883d12b02091f087_6.j pg </photo1> <photo2> http://distilleryimage1.s3.amazonaws.com/149a2fa4473311e3b29022000ab482f1_6.j pg </photo2> <photo3> http://origincache-frc.fbcdn.net/1390354_541811592579073_1379879032_a.jpg </photo3> <photo4> http://distilleryimage1.s3.amazonaws.com/028efb7444f811e3964f22000ae801df_6.j pg </photo4> <photo5> http://distilleryimage2.s3.amazonaws.com/d085d64a455e11e3a30c22000a1f9683_6.j pg </photo5> </gallery> </response> My bad response is: <response> <error>Your text search didn't return results.</error> </response>
  • 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. 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: PlaceInSightsModel.java View: prompt.jsp Controller: PlaceInSightsServlet.java 2.2. Receives an HTTP request from the native Android application PlaceInSightsServlet.java 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 PlaceInSightsModel.java does an HTTP request to: 2 APIs, Trippin’ Ins API: http://api.v1.trippinin.com/match/[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. 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”.