rogerhu / codepath-TwitterAppClient

0 stars 0 forks source link

Review my app #1

Open rogerhu opened 10 years ago

rogerhu commented 10 years ago

I saw your note later about passing a fake Twitter object. I did get Intents working but decided it was a cleaner approach simply to try to do a refresh through Twitter. I do know what the "intent" was though.

A lot of time was spent getting Android Studio to work with the PullRefreshView. There are a few things I learned from this experience -- you probably know, but I thought I would write it down while it's still fresh:

1) Doing it was a complete reinstall. Android Studio will need to redownload the Android Support Tools + x86 images, etc.

2) Eclipse uses way too many window panes -- it just doesn't work well without a big monitor. Android Studio is just a joy to work with on the IDE + debugging. But it's still very alpha though very good since it's based off IntelliJ.

3) Android Studio doesn't take care of apk dependency injection. The current UI will compile correctly but may not push the dependent .class files upstream. I was messing with all sorts of settings on the UI (when my project was created as an IntelliJ) and the simple answer was to move to Gradle-based projects.

4) Android Studio seems smart about handling dependent Activity objects, but for custom libraries that don't have Activity (i.e. PullRefreshView) it doesn't seem to do well without explicitly specifying build.gradle. I had to create a separate project though for the PullRefreshView since no amount of .jar compilation would work (the R.class file conflicts and confuses the build).

4) Android Studio requires a specific folder structure (src/main/java) and will break otherwise if it doesn't follow this format. There is a way to generate build.gradle files in Eclipse (http://developer.android.com/sdk/installing/migrate.html) but I ended up creating this template. I ended up also moving the directory structure around to make things work.

rhu@rhu-laptop:~/prjoects/Android_workspace/old.TwitterAppClient/android-rest-client-template-master$ more build.gradle 
buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:0.6.+'
    }
}
apply plugin: 'android'

repositories {
    mavenCentral()
}

android {
    compileSdkVersion 18
    buildToolsVersion "18.1.1"

    defaultConfig {
        minSdkVersion 13
        targetSdkVersion 18
    }
}

dependencies {
    compile 'com.android.support:appcompat-v7:+'
    compile files('libs/activeandroid-3.0.jar')
    compile files('libs/android-async-http-1.4.3.jar')
    compile files('libs/codepath-oauth-0.2.4.jar')
    compile files('libs/codepath-utils.jar')
    compile files('libs/scribe.jar')
    compile files('libs/universal-image-loader-1.8.4.jar')

5) Android Studio can be enabled with auto-imports but excluding android.R from auto import is a good idea.

6) Android Studio comes with gradle, so no need to install your own. However, see #7.

7) Our team got stuck tonight when we upgraded to Android v0.3.0 and the original build was on v0.2. We had to bump the gradle wrapper properties file to 1.8 to get it to work, along with upping the compat libraies in the build.gradle file. See https://github.com/steffanc/Tahoe/commit/39c623f1da6a5ba6cbc2785f5b5869408d603da7.

8) Got AcitveAndroid working, though ran into fun problems with trying to use Java Generics and how ActiveAndroid will attempt to implement any model that is declared as a base class.

I didn't see the maxId issue but I may look into further why I'm not seeing the dup Twitter stuff on refreshes (possibly I'm just not repro'ng correctly with real-time feeds)

/cc @nesquena @timothy1ee

nesquena commented 10 years ago

Thanks for the detailed notes about your learnings with Android Studio. Good to see you are figuring out how to work with Gradle properly through studio. I do plan to move the entire class to Android Studio once it becomes more widely used professionally and exists the "early preview release" to a stable beta. Will give more detailed feedback tomorrow.

Nathan Esquenazi

On Tuesday, October 22, 2013 at 3:04 AM, Roger Hu wrote:

I saw your note later about passing a fake Twitter object. I did get Intents working but decided it was a cleaner approach simply to try to do a refresh through Twitter. I do know what the "intent" was though. A lot of time was spent getting Android Studio to work with the PullRefreshView. There are a few things I learned from this experience -- yo probably know, but I thought I would write it down while it's still refresh: 1) Doing it was a complete reinstall. Android Studio will need to redownload the Android Support Tools + x86 images, etc.
2) Eclipse uses way too many window panes -- it just doesn't work well without a big monitor. Android Studio is just a joy to work with on the IDE + debugging. 3) Android Studio doesn't take care of apk dependency injection. I was messing with all sorts of settings on the UI (when my project was created as an IntelliJ) and the simple answer was to move to Gradle-based projects.
4) I had to create a separate project though for the PullRefreshView since no amount of .jar compilation would work (the R.class file conflicts and confuses the build). 4) Android Studio requires a specific folder structure (src/main/java) and will break otherwise if it doesn't follow this format. There is a way to generate build.gradle files in Eclipse (http://developer.android.com/sdk/installing/migrate.html) but I ended up creating this template: rhu@rhu-laptop:~/prjoects/Android_workspace/old.TwitterAppClient/android-rest-client-template-master$ more build.gradle buildscript { repositories { mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:0.6.+' } } apply plugin: 'android' repositories { mavenCentral() } android { compileSdkVersion 18 buildToolsVersion "18.1.1" defaultConfig { minSdkVersion 13 targetSdkVersion 18 } } dependencies { compile 'com.android.support:appcompat-v7:+' compile files('libs/activeandroid-3.0.jar') compile files('libs/android-async-http-1.4.3.jar') compile files('libs/codepath-oauth-0.2.4.jar') compile files('libs/codepath-utils.jar') compile files('libs/scribe.jar') compile files('libs/universal-image-loader-1.8.4.jar')
5) Android Studio can be enabled with auto-imports but excluding android.R from auto import is a good idea. 6) Android Studio comes with gradle, so no need to install your own. However, see #7. 7) Our team got stuck tonight when we upgraded to Android v0.3.0 and the original build was on v0.2. We had to bump the gradle wrapper properties file to 1.8 to get it to work, along with upping the compat libraies in the build.gradle file. See steffanc/Tahoe@39c623f (https://github.com/steffanc/Tahoe/commit/39c623f1da6a5ba6cbc2785f5b5869408d603da7). 8) Got AcitveAndroid working, though ran into fun problems with trying to use Java Generics and how ActiveAndroid will attempt to implement any model that is declared as a base class.
I didn't see the maxId issue but I may look into further why I'm not seeing the dup Twitter stuff on refreshes (possibly I'm just not repro'ng correctly with real-time feeds) /cc @nesquena (https://github.com/nesquena) @timothy1ee (https://github.com/timothy1ee)

— Reply to this email directly or view it on GitHub (https://github.com/rogerhu/codepath-TwitterAppClient/issues/1).

nesquena commented 10 years ago

Roger, :+1: nice work overall. A few notes after checking out the code:

Here's a detailed Project 3 Feedback Guide here which covers the most common issues with this submitted project. Read through the feedback guide point-by-point to determine how you could improve your submission.

Let us know if you have any other thoughts or questions about this assignment. Hopefully by now you feel pretty comfortable with all the major pieces to basic Android apps (Views, Controllers, Models, Authentication, API Communication, Preferences, ActionBar, et al) and see how they all fit together. We are close to a turning point in the course where you should be hitting a "critical mass" for your Android knowledge.