From dd7ffe3d5af63c7281bf69febcb5862e72353a9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Carlos=20Nieto?= Date: Wed, 3 Jun 2015 16:52:52 -0500 Subject: [PATCH 1/7] Adding docs on how to build Firetweet. --- README.md | 79 +++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 77 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 79c07bf7..bd078fa2 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,83 @@ # FireTweet -FireTweet is a Twitter client for Android that uses Lantern to unblock access to Twitter in censored regions around the world. + +FireTweet is an Android app powered by Lantern that gives direct unblocked +access to Twitter from anywhere in the world. -[FireTweet](https://github.com/getlantern/firetweet) is an open-source Twitter client for Android. You can download the latest [here](https://github.com/firetweet/downloads/blob/master/firetweet.apk?raw=true). +You can download the latest build of FireTweet +[here](https://github.com/firetweet/downloads/blob/master/firetweet.apk?raw=true). + +## Building Firetweet + +### Prerequisites + +* [Android Studio][2] +* git + +### + +Download the most recent copy of the Firetweet's source code using `git`: + +``` +mkdir -p ~/AndroidstudioProjects +cd ~/AndroidstudioProjects +git clone https://github.com/getlantern/firetweet.git +``` + +In the welcome screen choose the "Open an existing Android Studio" option and +select the `firetweet` folder you just checked out with git. + +![screen shot 2015-06-03 at 3 05 47 pm](https://cloud.githubusercontent.com/assets/385670/7970218/19ad1676-0a02-11e5-9480-b51c4cd1bdde.png) + +Wait until Android Studio finishes importing the project. + +![screen shot 2015-06-03 at 4 26 43 pm](https://cloud.githubusercontent.com/assets/385670/7971837/5dcf7172-0a0d-11e5-95be-8352444fea75.png) + +After a few minutes you'll end up with a blank workspace, click the `1. +Project` tab from the left side of the screen and make sure the combo box near +the play button says `firetweet`. + +![screen shot 2015-06-03 at 4 30 07 pm](https://cloud.githubusercontent.com/assets/385670/7971918/0e21190e-0a0e-11e5-8eb1-16f5aecc5bc4.png) + +If you want to test Firetweet on an Android emulator or into a real device, +just click the play button and choose on which device you want to deploy +Lantern. If you want to test this on an emulator make sure you're using the ARM +architecture. + +To build FireTweet select the `Make Project` action from the `Build` menu. + +![screen shot 2015-06-03 at 4 34 12 pm](https://cloud.githubusercontent.com/assets/385670/7971971/64eedf50-0a0e-11e5-8914-da487955d016.png) + +This will create a `./firetweet/build/outputs/apk/firetweet-fdroid-debug.apk` +file that you can install on an android device with the help of `adb`: + +``` +adb install ./firetweet/build/outputs/apk/firetweet-fdroid-debug.apk +``` + +## Open Source + +FireTweet was forked from [Twidere][1], an Open Source client for Twitter. + +> Twidere - Twitter client for Android +> +> Copyright (C) 2012-2014 Mariotaku Lee +> +> This program is free software: you can redistribute it and/or modify +> it under the terms of the GNU General Public License as published by +> the Free Software Foundation, either version 3 of the License, or +> (at your option) any later version. +> +> This program is distributed in the hope that it will be useful, +> but WITHOUT ANY WARRANTY; without even the implied warranty of +> MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +> GNU General Public License for more details. +> +> You should have received a copy of the GNU General Public License +> along with this program. If not, see . + +[1]: https://github.com/TwidereProject/Twidere-Android/ +[2]: http://developer.android.com/tools/studio/index.html From 210ab62207cc720c4aae1562df13812bb0b37cb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Carlos=20Nieto?= Date: Thu, 4 Jun 2015 14:50:02 -0500 Subject: [PATCH 2/7] How are Lantern and Firetweet related to each other? --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index bd078fa2..53dd2f59 100644 --- a/README.md +++ b/README.md @@ -58,6 +58,17 @@ file that you can install on an android device with the help of `adb`: adb install ./firetweet/build/outputs/apk/firetweet-fdroid-debug.apk ``` +## How is Lantern included in Firetweet? + +We created a really small version of Lantern that can be compiled for Android +phones and used by Android apps. This library is bundled with Firetweet, you +can always find the latest version of the library +[here](https://github.com/getlantern/firetweet/tree/master/firetweet/src/main/jniLibs/armeabi-v7a). + +If you prefer to build this binary blob for yourself you may check out the +[Lantern building instructions](https://github.com/getlantern/lantern), in +particular the "Creating libgojni.so" section. + ## Open Source FireTweet was forked from [Twidere][1], an Open Source client for Twitter. From aa210b5132830f00ef78431eed6f364c7f6d6e5a Mon Sep 17 00:00:00 2001 From: Ulysses Aalto Date: Mon, 15 Jun 2015 11:43:53 +0200 Subject: [PATCH 3/7] Updated Gradle to 2.4 for speed improvements --- build.gradle | 2 +- gradle.properties | 15 +++++++++++++++ gradle/wrapper/gradle-wrapper.properties | 2 +- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index cb99ac40..0b66bd12 100644 --- a/build.gradle +++ b/build.gradle @@ -9,7 +9,7 @@ buildscript { } dependencies { classpath 'com.github.ben-manes:gradle-versions-plugin:0.8' - classpath 'com.android.tools.build:gradle:1.1.3' + classpath 'com.android.tools.build:gradle:1.2.3' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } diff --git a/gradle.properties b/gradle.properties index c00f6811..422005a9 100644 --- a/gradle.properties +++ b/gradle.properties @@ -16,3 +16,18 @@ org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryErro # This option should only be used with decoupled projects. More details, visit # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects # org.gradle.parallel=true + +# The Gradle daemon aims to improve the startup and execution time of Gradle. +# When set to true the Gradle daemon is to run the build. +# TODO: disable daemon on CI, since builds should be clean and reliable on servers +org.gradle.daemon=true + +# Specifies the JVM arguments used for the daemon process. +# The setting is particularly useful for tweaking memory settings. +# Default value: -Xmx10248m -XX:MaxPermSize=256m +org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 + +# Enables new incubating mode that makes Gradle selective when configuring projects. +# Only relevant projects are configured which results in faster builds for large multi-projects. +# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:configuration_on_demand +org.gradle.configureondemand=true diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 819314ff..7ca18b7c 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-all.zip From 73308c063eed012a15051b779c2c408b81ed94dc Mon Sep 17 00:00:00 2001 From: Ulysses Aalto Date: Mon, 15 Jun 2015 11:44:17 +0200 Subject: [PATCH 4/7] Makefile for command-line compilation --- Makefile | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..47051fd0 --- /dev/null +++ b/Makefile @@ -0,0 +1,54 @@ +APK_FILE := ./firetweet/build/outputs/apk/firetweet-fdroid-debug.apk + +define pkg_variables + $(eval PACKAGE := $(shell aapt dump badging $(APK_FILE)|awk -F" " '/package/ {print $$2}'|awk -F"'" '/name=/ {print $$2}')) + $(eval MAIN_ACTIVITY := $(shell aapt dump badging $(APK_FILE)|awk -F" " '/launchable-activity/ {print $$2}'|awk -F"'" '/name=/ {print $$2}' | grep MainActivity)) +endef + +.PHONY: all + +all: build-debug install run + +compile-debug: + ./gradlew \ + firetweet:compileFdroidDebugSources \ + firetweet:compileFdroidDebugAndroidTestSources \ + firetweet.component.common:compileDebugSources \ + firetweet.component.common:compileDebugAndroidTestSources \ + firetweet.component.jsonserializer:compileDebugSources \ + firetweet.component.jsonserializer:compileDebugAndroidTestSources \ + firetweet.component.nyan:compileDebugSources \ + firetweet.component.nyan:compileDebugAndroidTestSources \ + firetweet.component.querybuilder:compileDebugSources \ + firetweet.component.querybuilder:compileDebugAndroidTestSources \ + firetweet.component.twitter4j:compileDebugSources \ + firetweet.component.twitter4j:compileDebugAndroidTestSources \ + firetweet.component.twitter4j.streaming:compileDebugSources \ + firetweet.component.twitter4j.streaming:compileDebugAndroidTestSources \ + firetweet.extension.push.xiaomi:compileDebugSources \ + firetweet.extension.push.xiaomi:compileDebugAndroidTestSources \ + firetweet.extension.streaming:compileDebugSources \ + firetweet.extension.streaming:compileDebugAndroidTestSources \ + firetweet.extension.twitlonger:compileDebugSources \ + firetweet.extension.twitlonger:compileDebugAndroidTestSources \ + firetweet.library.extension:compileDebugSources \ + firetweet.library.extension:compileDebugAndroidTestSources \ + firetweet.wear:compileDebugSources \ + firetweet.wear:compileDebugAndroidTestSources + +build-debug: + ./gradlew assembleFdroidDebug + +$(APK_FILE): build-debug + +install: $(APK_FILE) + $(call pkg_variables) + adb install $(APK_FILE) + +uninstall: + $(call pkg_variables) + adb uninstall $(PACKAGE) + +run: + $(call pkg_variables) + adb shell am start -n $(PACKAGE)/$(MAIN_ACTIVITY) From 41e1ce141183c46f8a2e0c5ae99a4b889d65adf3 Mon Sep 17 00:00:00 2001 From: Ulysses Aalto Date: Mon, 15 Jun 2015 12:05:51 +0200 Subject: [PATCH 5/7] Update README for command-line building instructions --- README.md | 40 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 37 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 53dd2f59..a212ba31 100644 --- a/README.md +++ b/README.md @@ -12,13 +12,13 @@ You can download the latest build of FireTweet ## Building Firetweet -### Prerequisites +### Building from Android Studio + +#### Prerequisites * [Android Studio][2] * git -### - Download the most recent copy of the Firetweet's source code using `git`: ``` @@ -58,6 +58,40 @@ file that you can install on an android device with the help of `adb`: adb install ./firetweet/build/outputs/apk/firetweet-fdroid-debug.apk ``` +### Building from the Command Line (beta, for development only) + +#### Prerequisites + +* Java Development Kit 1.7 +* Git + +#### Building, installing and running + +Build the Debug target: + +``` +make build-debug +``` + +Install it: + +``` +make install +``` + +Run the app on the device from the command line: + +``` +make run +``` + +By default, all three tasks will be run in order with: + +``` +make +``` + + ## How is Lantern included in Firetweet? We created a really small version of Lantern that can be compiled for Android From 5c564c8c9cd362b39d5adddfd29faa1845390023 Mon Sep 17 00:00:00 2001 From: Ulysses Aalto Date: Thu, 18 Jun 2015 13:34:38 +0200 Subject: [PATCH 6/7] Added -r (reinstall) option to installation task --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 47051fd0..e8bfc22d 100644 --- a/Makefile +++ b/Makefile @@ -43,7 +43,7 @@ $(APK_FILE): build-debug install: $(APK_FILE) $(call pkg_variables) - adb install $(APK_FILE) + adb install -r $(APK_FILE) uninstall: $(call pkg_variables) From 488d656d0e89c8f94609894f389881092d9aa4a2 Mon Sep 17 00:00:00 2001 From: Ulysses Aalto Date: Fri, 19 Jun 2015 15:32:32 +0200 Subject: [PATCH 7/7] Added instructions for VirtualBox images usage --- README.md | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/README.md b/README.md index a212ba31..eb493bd2 100644 --- a/README.md +++ b/README.md @@ -103,6 +103,66 @@ If you prefer to build this binary blob for yourself you may check out the [Lantern building instructions](https://github.com/getlantern/lantern), in particular the "Creating libgojni.so" section. + +## VirtualBox Android development images + +### Why use a Virtualbox image instead of the Android Emulator or a real device? + +There are several reasons for doing so. When comparing with the Android Emulator, the main reason is that Virtualbox is faster. It virtualizes the x86 architecture, which introduces less overhead than full ARM emulation. When comparing with a real device, there are also reasons for using Virtualbox instead: + +* On-screen development. This might be useful for remote pair programming or visual testing. +* Screen size customization. +* Easier build and bug reproducibility. + +One thing to note is that the majority of Android devices use the ARM architecture. Virtualbox relies on the x86 architecture instead. However, the emulation feature called _Houdini_ binary translation allows for instruction translation, which means that we can run _native_ ARM code on our x86 emulator. + +The Android x86 images are based on this project: http://www.android-x86.org/ + +You can find the latest image [here](https://s3.amazonaws.com/lantern-android-development-images/Android+4.4.ova) + +### Installing on the VirtualBox image + +1. Make sure that port forwarding is set from 5555 (host) to 5555 (guest) for the main network interface. +2. Run the Virtualbox image. +3. Connect with ADB +``` +adb connect localhost:55555 +``` +4. Check that the device is properly connected +``` +adb devices +``` +5. Run make (it will compile, upload and run the app on VirtualBox) +``` +make +``` + +### Development notes + +#### Screen orientation + +* Press F12 two times in less than 2 seconds = Rotate 90º to the LEFT. +* Press F11 two times in less than 2 seconds = Rotate 90º to the RiGHT. +* Press F10 two times in less than 2 seconds = Rotate 180º. +* Press F9 two times in less than 2 seconds = Normal view 0/360º. + +#### Screen size + +* Using the kernel VGA configuration option: + +When in GRUB, hit 'e' to edit the first entry, then 'e' again to edit the first line. Append the text 'vga=ask' at the end of the boot line. Choose any of the display sizes, but the depth must be 16. + +* Using an app (recommended): + +Use the app called _Resolution Changer_ and activate the resolution overriding. There is no need to reboot after this. + +#### Misc + +* For better UI integration, disable mouse integration (Host+I) +* Certain apps, including Firetweet reorient the screen. This will remap the mouse coordinates and motion, which will drive you crazy! First try rotating setting the screen orientation to landscape. Then, you can try also setting a screen size with _Resolution Changer_ to a new height/width that inverts these values. + + + ## Open Source FireTweet was forked from [Twidere][1], an Open Source client for Twitter.