Skip to content
Yu Zhiqiang edited this page Jul 10, 2014 · 9 revisions

Wiki - Phimp.me Android app

Phimp.me Android app is a photo-sharing app.

The whole project includes this repo and the Generator. It aims to create a photo sharing app and a generator that can customize it.

MainActivity

This is the main screen of this app. Currently it only contains an action bar with a camera button.

ChooseDialogFragment

After touching the camera button, this dialog will popup. It contains three options listed below.

  • Capture a new photo (CaptureActivity)
  • Choose from library (ChooseFromLibraryActivity)
  • Select from map (MapActivity)

CaptureActivity

This activity uses startActivityForResult() to call the system camera, and gets its result (an Uri) through OnActivityResult(). Then this activity will start the PreviewActivity with Uri as an extra, and finish itself.

ChooseFromLibraryActivity

This activity calls the Gallery provided by Android. Once getting the Uri of selected image, it will pass it to PreviewActivity, and finish itself.

MapActivity

It uses the Google Map API v2 to show a map. It will get information of all photos from the system database. The thumbnails are shown in the map at the location of each photo. When users touch a photo, it goes to the PreviewActivity.

PreviewActivity

Simply show the photo selected. On its action bar there is a edit button and a forward button. Edit button calls the photo editor inside the Gallery app of Android, while the forward button goes to the UploadActivity.

UploadActivity

This is the screen for uploading a photo. Where users can write a description for the photo, turn on the geographical location and modify it. Also this page supports Android Beam (NFC), where users can tap two devices to beam the selected photo from one to another. The receiver is not required to have the phimpme app installed.

GPSManagerActivity

This is the activity used to change the geographical location inside a photo. It shows a map with the location of the photo in the center, marked with "×". Users can move the map to change the location info of the photo.

ShareToWordpressActivity

This activity aims to upload photos to self-hosted WordPress site. We use XMLRPC to upload files directly to WordPress, so nothing special is needed to do on the WordPress site. The only thing needed is an account and password with the permission of uploading photos to image library and adding new post.

The URL of WordPress site is defined in Configuration.java.

An important reference to implement this function is the GitHub repository of WordPress for Android.

The related library and src package for uploading is list below:

ShareToDrupalActivity

In this activity, we upload photos to Drupal with the help of a Drupal plugin called Drupapp, which is part of the Drupoid.

Our app includes the function of the android app of Drupoid. After setting up the Drupal site, we need to install the Drupapp as a module, and give it the permission of uploading images. For details, please read the instruction of setting up Durpoid.

The related library and src package for uploading is list below:

Build in Command Line

Here is the official guide: Building Your Project with Gradle from the Command Line

To build in command line, we need a text file named local.properties in the same dictionary with gradlew. It contains the local SDK path. This file is not included in version control, but will be generated once you open this project in Android Studio. We can also manually create one with the following content:

sdk.dir=/path/to/the/local/SDK/folder/

After doing so, we can run gradlew to build the project. We may need to give it the permission of executing with sudo chmod a+x ./gradlew. Then, run ./gradlew, and the Gradle build system will be installed automatically.

When you see "BUILD SUCCESSFUL", you can find the APK in the folder of build.