diff --git a/build/sdk.atree b/build/sdk.atree index 44430f627..148899b52 100644 --- a/build/sdk.atree +++ b/build/sdk.atree @@ -184,6 +184,7 @@ development/samples/SpinnerTest samples/${PLATFORM_NAME}/SpinnerT development/samples/TicTacToeLib samples/${PLATFORM_NAME}/TicTacToeLib development/samples/TicTacToeMain samples/${PLATFORM_NAME}/TicTacToeMain development/samples/TtsEngine samples/${PLATFORM_NAME}/TtsEngine +development/samples/ToyVpn samples/${PLATFORM_NAME}/ToyVpn development/samples/USB/MissileLauncher samples/${PLATFORM_NAME}/USB/MissileLauncher development/samples/USB/AdbTest samples/${PLATFORM_NAME}/USB/AdbTest development/samples/VoiceRecognitionService samples/${PLATFORM_NAME}/VoiceRecognitionService diff --git a/samples/ToyVpn/Android.mk b/samples/ToyVpn/Android.mk new file mode 100644 index 000000000..8fe714cae --- /dev/null +++ b/samples/ToyVpn/Android.mk @@ -0,0 +1,16 @@ +LOCAL_PATH:= $(call my-dir) +include $(CLEAR_VARS) + +LOCAL_MODULE_TAGS := samples + +# Only compile source java files in this apk. +LOCAL_SRC_FILES := $(call all-java-files-under, src) + +LOCAL_PACKAGE_NAME := ToyVpn + +LOCAL_SDK_VERSION := current + +include $(BUILD_PACKAGE) + +# Use the following include to make our test apk. +include $(call all-makefiles-under,$(LOCAL_PATH)) diff --git a/samples/ToyVpn/AndroidManifest.xml b/samples/ToyVpn/AndroidManifest.xml new file mode 100644 index 000000000..8366dd6bc --- /dev/null +++ b/samples/ToyVpn/AndroidManifest.xml @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/samples/ToyVpn/_index.html b/samples/ToyVpn/_index.html new file mode 100755 index 000000000..d896899c2 --- /dev/null +++ b/samples/ToyVpn/_index.html @@ -0,0 +1,7 @@ +

ToyVPN is a sample application that shows how to build a VPN client using the VpnService class introduced in API level 14.

+ +

This application consists of an Android client and a sample implementation of a server. It performs IP over UDP and is capable of doing seamless handover between different networks as long as it receives the same VPN parameters.

+ +

The sample code of the server-side implementation is Linux-specific and is available in the server directory. To run the server or port it to another platform, please see comments in the code for the details.

+ + diff --git a/samples/ToyVpn/res/layout/form.xml b/samples/ToyVpn/res/layout/form.xml new file mode 100644 index 000000000..7a325db54 --- /dev/null +++ b/samples/ToyVpn/res/layout/form.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + +