The first thing to do is to install Git on the remote server.
Once you do that the rest of the process is split into three sections:
- Server set-up
- Local set-up (push commits)
- Server (pull commits)
| package com.jakewharton.utilities; | |
| import android.content.Context; | |
| import android.graphics.drawable.Drawable; | |
| import android.preference.CheckBoxPreference; | |
| import android.util.AttributeSet; | |
| import android.view.View; | |
| import android.widget.ImageView; | |
| import com.jakewharton.wakkawallpaper.R; |
| <? | |
| // Twitter self-hosted image service/url shortener by Ryan Petrich | |
| // Installation: | |
| // 1. Paste this script into the top of your HTTP root's index.php (rename index.html to index.php if it doesn't exist) | |
| // 2. Add the following to your HTTP root's .htaccess file (create .htaccess if it doesn't exist): | |
| // ErrorDocument 404 /index.php | |
| // 3. Create a "s" subfolder and give it 777 permissions | |
| // 4. Add the following as the custom URL for URL shortening in Twitter for iPhone's settings: | |
| // http://yourdomain.com/?d=%@&p=password | |
| // 5. Add the following as the custom URL for Image service: |
| #!/bin/bash | |
| # NOTE: this is an OSX launchd wrapper shell script for Tomcat (to be placed in $CATALINA_HOME/bin) | |
| CATALINA_HOME=/Users/username/tomcat | |
| function shutdown() { | |
| date | |
| echo "Shutting down Tomcat" | |
| $CATALINA_HOME/bin/catalina.sh stop |
| // | |
| // !!WARNING: Not recommended for production code!! | |
| // | |
| public class ClassLoaderActivity extends Activity | |
| { | |
| public void onCreate(Bundle savedInstanceState) | |
| { | |
| // file.jar has a dex'd "classes.dex" entry that you can generate with "dx" from any number of JARs or class files | |
| ClassLoader dexLoader = new DexClassLoader("/path/to/file.jar", getCacheDir().getAbsolutePath(), null, getClassLoader()); | |
| setAPKClassLoader(dexLoader); |
| <?xml version="1.0"?> | |
| <!DOCTYPE module PUBLIC | |
| "-//Puppy Crawl//DTD Check Configuration 1.2//EN" | |
| "http://www.puppycrawl.com/dtds/configuration_1_2.dtd"> | |
| <!-- | |
| Checkstyle-Configuration: Android checkstyle by Enea | |
| Description: none | |
| --> |
| package android.support.v4.preference; | |
| import android.app.Activity; | |
| import android.content.Intent; | |
| import android.os.Bundle; | |
| import android.os.Handler; | |
| import android.os.Message; | |
| import android.preference.Preference; | |
| import android.preference.PreferenceManager; | |
| import android.preference.PreferenceScreen; |
| LOCAL_PATH := $(call my-dir) | |
| include $(CLEAR_VARS) | |
| LOCAL_MODULE := ffmpeg | |
| include $(LOCAL_PATH)/config.mak | |
| LOCAL_CFLAGS := -DHAVE_AV_CONFIG_H -std=c99 | |
| Okay so here's the setup: | |
| [-] The primary server API is exposed via Flask (Python) and all static files, including all html, css, js is served by nginx. | |
| [-] Python is exposing an API at url http://domain.com/api/download/<file_id>, where file_id is a database id for the file that we're interested in downloading. | |
| 1. User wants to download a file, so we spawn a new window with the url '/api/download/<file_id>' | |
| 2. Nginx intercepts the request, sees that it starts with /api/, and then forwards the request to Flask, which is being served on port 5000. | |
| 3. Flask routes the request to its download method, retrieves the pertinent data from the file_id, and constructs additional header settings to make nginx happy and to force the browser to see the file stream as a download request instead of the browser just trying to open the file in a new window. Flask then returns the modified header stream to nginx | |
| 4. Nginx is finally ready to do some work. While parsing the headers for the incoming request, it encounters "X |
| public class DoubleTapZoomMapView extends MapView { | |
| private static final long TIME_INITIAL = -1; | |
| private static final long TIME_DOUBLE_TAP = 250; | |
| private long lastTouchTime = TIME_INITIAL; | |
| public DoubleTapZoomMapView(Context context, AttributeSet attrs) { | |
| super(context, attrs); | |
| } |