Foursquare Client is an android app that allows a user to search for city venues. The app utilizes Foursquare web API.
The app implemented with Model-View-ViewModel design pattern in conjunction with Android data binding library.
- ViewModel - implemented with android.databinding.Observable from android data binding library + Repository (it's a mediator between Models and ViewModels). The Repository receives/updates Models via memory cache/local datasource/remote datasource. Access to remote datasource is implemented with Retrofit library. Local datasource accesses only json file with cities list.
- View - Fragment/Activities
- Model - classes defined in src/main/java/me/elmira/foursquareclient/model/
- When the app modifies the ViewModel in the MVVM architecture, the View is automatically updated by a library. ViewModel doesn't have access to the View reference.
- The Data Binding Library ensures that the View and ViewModel remain in sync bi-directionally as illustrated by the following diagram (without SQLite).
The following required functionality is completed:
- The main screen contains a list with 5 cities of your choice (loaded from json file in assets)
- When the user clicks on a city, user will be sent to a screen that displays a list of venues in the city (max=25). An item in the list should show the venue name, a thumbnail, location and categories. It should also indicate if the venue was bookmarked or not.
- When the user clicks on a venue, user will be taken to a screen that displays a grid of photos for the venue (max=50). Screen will also display a Bookmark button. When user clicks the Bookmark button, update the button to selected state. When the user returns to the previous screen, it should update the Bookmark state of the venue in the list.
Here's a walkthrough of implemented user stories:
Add 2 string resources with your Foursquare credentials:
<string name="foursquare_client_id">YOUR_CLIENT_ID</string>
<string name="foursquare_client_secret">YOUR_CLIENT_SECRET</string>
- Fresco - An image management library
- Retrofit networking library - Http client for Android
- GSON library- A Java serialization/deserialization library that can convert Java Objects into JSON and back.
- Dagger2 - A dependency injector for Android and Java
- Data Binding Library - Android data binding library
Copyright 2017 Elmira Andreeva
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.