Skip to content
This repository has been archived by the owner on Oct 9, 2020. It is now read-only.

Commit

Permalink
Merge pull request #324 from fossasia/stable
Browse files Browse the repository at this point in the history
version 0.8.1 (shipping)
  • Loading branch information
championswimmer committed Apr 2, 2016
2 parents 51edd4f + d3f949c commit c298b26
Show file tree
Hide file tree
Showing 70 changed files with 920 additions and 662 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Changelog for Open Event Android
Being maintained since 0.8.x

#### 0.8.1 - next

#### 0.8.0 - 0.8.1
- add missing track details in sessions view
- material look to speaker details
- using retrofit 2.0 now
- fix nav drawer menu layout
20 changes: 16 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
## The Open Event Android Client

The Android client is a generic app that has two parts:

a) A standard configuration file, that sets the details of the app (e.g. color scheme, logo of event, link to JSON app data)
b) The Android app itself
This app uses the json api provided by a server maintained [here](https://github.com/fossasia/open-event-orga-server).

b) This app uses the json api provided by a server maintained [here](https://github.com/fossasia/open-event-orga-server).

## Development Setup
Before you begin, you should already have the Android Studio SDK downloaded and set up correctly. You can find a guide on how to do this here: [Setting up Android Studio](http://developer.android.com/sdk/installing/index.html?pkg=studio)
Expand All @@ -24,6 +25,7 @@ Before you begin, you should already have the Android Studio SDK downloaded and

- *Note:* If you recieve a Gradle sync error titled, "failed to find ...", you should click on the link below the error message (if avaliable) that says *Install missing platform(s) and sync project* and allow Android studio to fetch you what is missing.
- *Note:* If you are trying to build this project on a Windows Machine, you should **Comment** out line number 5 and **Uncomment** line number 6 inside build.gradle(Project: app).

5. Once all build errors have been resolved, you should be all set to build the app and test it.

6. To Build the app, go to *Build>Make Project* (or alternatively press the Make Project icon in the toolbar).
Expand All @@ -32,14 +34,18 @@ Before you begin, you should already have the Android Studio SDK downloaded and

### Screenshots
![alt-tag](screenshots/ss2.PNG)

![alt-tag](screenshots/ss1.PNG)

![alt-tag](screenshots/ss3.PNG)

![alt-tag](screenshots/ss4.PNG)

### Configuring the app

**Configuring Server and Web-App Urls**
- Browse the project directories and open (with Android Studio): *app/src/main/java/org/fossasia/openevent/api/Urls.java*

- In this file you will see several constant variables that allow you to set useful properties of the app, these include:
* API_VERSION: Server API version. (Example: "v1")
* EVENT_ID: ID of the event to load from server. (Example: 1)
Expand All @@ -53,20 +59,24 @@ Before you begin, you should already have the Android Studio SDK downloaded and

**Configuring App Theme / Localizations**
- The styles.xml files have been configured to allow easy customization of app themes.

- You can configure themes by changing various components found in the styles.xml files, found at:
* */app/src/main/res/values/styles.xml*
* */app/src/main/res/values-v21/styles.xml*


- Using *Theme Editor*:
* You can also configure the theme of the app using Android Studio's *Theme Editor*.
* Go to *Tools>Android>Theme Editor* to open the Theme Editor.
* From there you can configure the colors and styles of in-app elements using a neat UI.


- *Translations Editor*:
* You can configure the string localizaions / translations using Android Studio's *Translations Editor*.
* Find /app/src/main/res/values/strings.xml
* Right click on the file, and select *Open Translations Editor*.


- Editing Manually:
* You can find the configuration files for the app for manual editing here:
* */app/src/main/res/values/*
Expand All @@ -80,12 +90,14 @@ Before you begin, you should already have the Android Studio SDK downloaded and
- Also there is a check on the version of data already there in the app's database. If data is stale then only it is downloaded.
- If database is empty then firstly json file in assets is accessed but if internet is available , latest data is downloaded.

## Libraries userd
## Libraries used
- Otto
- Retrofit
- ButterKnife
- Timber
- Google Gson
- LeakCanary
- Picasso

## Branches and Contribution policy
We have the following branches
Expand All @@ -104,5 +116,5 @@ We have the following branches
## A note about Codestyle
Please read our [CODESTYLE](CODESTYLE.md) carefully. Pull requests that do not match the style will be rejected.

##License
## License
This project is currently licensed under the GNU General Public License v3. A copy of LICENSE.md should be present along with the source code. To obtain the software under a different license, please contact FOSSASIA.
12 changes: 6 additions & 6 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ android {
minSdkVersion 15
targetSdkVersion 23
versionCode 80
versionName "0.8.0"
versionName "0.8.1"

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
buildConfigField "String", "GIT_SHA", "\"${gitSha}\""
Expand Down Expand Up @@ -63,9 +63,9 @@ dependencies {
compile "com.android.support:support-v4:${SUPPORT_LIB_VERSION}"
compile "com.android.support:cardview-v7:${SUPPORT_LIB_VERSION}"
compile "com.android.support:recyclerview-v7:${SUPPORT_LIB_VERSION}"
compile 'com.google.code.gson:gson:2.5'
compile 'com.squareup.okhttp:okhttp:2.7.2'
compile 'com.squareup.retrofit:retrofit:1.9.0'
compile 'com.squareup.retrofit2:retrofit:2.0.0'
compile 'com.squareup.retrofit2:converter-gson:2.0.0'
compile 'com.squareup.okhttp3:logging-interceptor:3.2.0'
compile "com.android.support:design:${SUPPORT_LIB_VERSION}"
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.squareup:otto:1.3.8'
Expand All @@ -83,7 +83,7 @@ dependencies {
// Testing
testCompile 'junit:junit:4.12'
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2'
androidTestCompile ('com.android.support.test:runner:0.4') {
androidTestCompile('com.android.support.test:runner:0.4') {
exclude group: 'com.android.support', module: 'support-annotations'
}
androidTestCompile "com.android.support:support-annotations:${SUPPORT_LIB_VERSION}"
Expand All @@ -92,7 +92,7 @@ dependencies {
exclude group: 'com.android.support', module: 'support-v4'
exclude module: 'recyclerview-v7'
}
androidTestCompile ('com.android.support.test:rules:0.4') {
androidTestCompile('com.android.support.test:rules:0.4') {
exclude group: 'com.android.support', module: 'support-annotations'
}
androidTestCompile "org.mockito:mockito-core:1.10.19"
Expand Down
114 changes: 73 additions & 41 deletions app/src/androidTest/java/org/fossasia/openevent/APITest.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@

import java.util.concurrent.CountDownLatch;

import retrofit.Callback;
import retrofit.RetrofitError;
import retrofit.client.Response;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;

/**
* User: mohit
Expand All @@ -25,38 +25,50 @@ public class APITest extends AndroidTestCase {
public void testSpeakerAPIResponse() throws Exception {
APIClient client = new APIClient();
final CountDownLatch latch = new CountDownLatch(1);
client.getOpenEventAPI().getSpeakers(Urls.EVENT_ID, new Callback<SpeakerResponseList>() {
client.getOpenEventAPI().getSpeakers(Urls.EVENT_ID).enqueue(new Callback<SpeakerResponseList>() {
@Override
public void success(SpeakerResponseList speakerResponseList, Response response) {
assertNotNull(speakerResponseList.speakers);
// Assert that the list size > 0
assertTrue(speakerResponseList.speakers.size() > 0);
latch.countDown();
public void onResponse(Call<SpeakerResponseList> call, Response<SpeakerResponseList> response) {
if (response.isSuccessful()) {
assertNotNull(response.body().speakers);
// Assert that the list size > 0
assertTrue(response.body().speakers.size() > 0);
latch.countDown();
} else {
fail("API Request Failed");
latch.countDown();
}
}

@Override
public void failure(RetrofitError error) {
public void onFailure(Call<SpeakerResponseList> call, Throwable t) {
fail("API Request Failed");
latch.countDown();
}
});

latch.await();
}

public void testSponsorAPIResponse() throws Exception {
APIClient client = new APIClient();
final CountDownLatch latch = new CountDownLatch(1);
client.getOpenEventAPI().getSponsors(Urls.EVENT_ID, new Callback<SponsorResponseList>() {
client.getOpenEventAPI().getSponsors(Urls.EVENT_ID).enqueue(new Callback<SponsorResponseList>() {
@Override
public void success(SponsorResponseList sponsorResponseList, Response response) {
assertNotNull(sponsorResponseList.sponsors);
// Assert that the list size > 0
assertTrue(sponsorResponseList.sponsors.size() > 0);
latch.countDown();
public void onResponse(Call<SponsorResponseList> call, Response<SponsorResponseList> response) {
if (response.isSuccessful()) {
assertNotNull(response.body().sponsors);
// Assert that the list size > 0
assertTrue(response.body().sponsors.size() > 0);
latch.countDown();

} else {
fail("API Request Failed");
latch.countDown();
}
}

@Override
public void failure(RetrofitError error) {
public void onFailure(Call<SponsorResponseList> call, Throwable t) {
fail("API Request Failed");
latch.countDown();
}
Expand All @@ -67,16 +79,21 @@ public void failure(RetrofitError error) {
public void testEventAPIResponse() throws Exception {
APIClient client = new APIClient();
final CountDownLatch latch = new CountDownLatch(1);
client.getOpenEventAPI().getEvents(new Callback<EventResponseList>() {
client.getOpenEventAPI().getEvents().enqueue(new Callback<EventResponseList>() {
@Override
public void success(EventResponseList eventResponseList, Response response) {
assertNotNull(eventResponseList.event);
assertTrue(eventResponseList.event.size() > 0);
latch.countDown();
public void onResponse(Call<EventResponseList> call, Response<EventResponseList> response) {
if (response.isSuccessful()) {
assertNotNull(response.body().event);
assertTrue(response.body().event.size() > 0);
latch.countDown();
} else {
fail("API Request Failed");
latch.countDown();
}
}

@Override
public void failure(RetrofitError error) {
public void onFailure(Call<EventResponseList> call, Throwable t) {
fail("API Request Failed");
latch.countDown();
}
Expand All @@ -87,16 +104,21 @@ public void failure(RetrofitError error) {
public void testSessionAPIResponse() throws Exception {
APIClient client = new APIClient();
final CountDownLatch latch = new CountDownLatch(1);
client.getOpenEventAPI().getSessions(Urls.EVENT_ID, new Callback<SessionResponseList>() {
client.getOpenEventAPI().getSessions(Urls.EVENT_ID).enqueue(new Callback<SessionResponseList>() {
@Override
public void success(SessionResponseList sessionResponseList, Response response) {
assertNotNull(sessionResponseList.sessions);
assertTrue(sessionResponseList.sessions.size() > 0);
latch.countDown();
public void onResponse(Call<SessionResponseList> call, Response<SessionResponseList> response) {
if (response.isSuccessful()) {
assertNotNull(response.body().sessions);
assertTrue(response.body().sessions.size() > 0);
latch.countDown();
} else {
fail("API Request Failed");
latch.countDown();
}
}

@Override
public void failure(RetrofitError error) {
public void onFailure(Call<SessionResponseList> call, Throwable t) {
fail("API Request Failed");
latch.countDown();
}
Expand All @@ -107,16 +129,21 @@ public void failure(RetrofitError error) {
public void testTrackAPIResponse() throws Exception {
APIClient client = new APIClient();
final CountDownLatch latch = new CountDownLatch(1);
client.getOpenEventAPI().getTracks(Urls.EVENT_ID, new Callback<TrackResponseList>() {
client.getOpenEventAPI().getTracks(Urls.EVENT_ID).enqueue(new Callback<TrackResponseList>() {
@Override
public void success(TrackResponseList trackResponseList, Response response) {
assertNotNull(trackResponseList.tracks);
assertTrue(trackResponseList.tracks.size() > 0);
latch.countDown();
public void onResponse(Call<TrackResponseList> call, Response<TrackResponseList> response) {
if (response.isSuccessful()) {
assertNotNull(response.body().tracks);
assertTrue(response.body().tracks.size() > 0);
latch.countDown();
} else {
fail("API Request Failed");
latch.countDown();
}
}

@Override
public void failure(RetrofitError error) {
public void onFailure(Call<TrackResponseList> call, Throwable t) {
fail("API Request Failed");
latch.countDown();
}
Expand All @@ -127,16 +154,21 @@ public void failure(RetrofitError error) {
public void testMicrolocationAPIResponse() throws Exception {
APIClient client = new APIClient();
final CountDownLatch latch = new CountDownLatch(1);
client.getOpenEventAPI().getMicrolocations(Urls.EVENT_ID, new Callback<MicrolocationResponseList>() {
client.getOpenEventAPI().getMicrolocations(Urls.EVENT_ID).enqueue(new Callback<MicrolocationResponseList>() {
@Override
public void success(MicrolocationResponseList microlocationResponseList, Response response) {
assertNotNull(microlocationResponseList.microlocations);
assertTrue(microlocationResponseList.microlocations.size() > 0);
latch.countDown();
public void onResponse(Call<MicrolocationResponseList> call, Response<MicrolocationResponseList> response) {
if (response.isSuccessful()) {
assertNotNull(response.body().microlocations);
assertTrue(response.body().microlocations.size() > 0);
latch.countDown();
} else {
fail("API Request Failed");
latch.countDown();
}
}

@Override
public void failure(RetrofitError error) {
public void onFailure(Call<MicrolocationResponseList> call, Throwable t) {
fail("API Request Failed");
latch.countDown();
}
Expand Down
Loading

0 comments on commit c298b26

Please sign in to comment.