You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ag...@apache.org on 2014/12/31 05:04:18 UTC

cordova-plugins git commit: CB-6630 Create a plugin for adding OkHttp to Android

Repository: cordova-plugins
Updated Branches:
  refs/heads/master 131de2f9d -> a365e2acc


CB-6630 Create a plugin for adding OkHttp to Android


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugins/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugins/commit/a365e2ac
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugins/tree/a365e2ac
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugins/diff/a365e2ac

Branch: refs/heads/master
Commit: a365e2acc82cd9057a6b15aaca121666a4f5372a
Parents: 131de2f
Author: Andrew Grieve <ag...@chromium.org>
Authored: Tue Dec 30 23:02:41 2014 -0500
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Tue Dec 30 23:02:41 2014 -0500

----------------------------------------------------------------------
 android-okhttp/library/AndroidManifest.xml      |  2 +
 android-okhttp/library/build-extras.gradle      | 24 ++++++++++++
 android-okhttp/library/project.properties       | 15 ++++++++
 .../cordova/okhttpplugin/OkHttpPlugin.java      | 39 ++++++++++++++++++++
 android-okhttp/plugin.xml                       | 24 ++++++++++++
 5 files changed, 104 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugins/blob/a365e2ac/android-okhttp/library/AndroidManifest.xml
----------------------------------------------------------------------
diff --git a/android-okhttp/library/AndroidManifest.xml b/android-okhttp/library/AndroidManifest.xml
new file mode 100644
index 0000000..842fe99
--- /dev/null
+++ b/android-okhttp/library/AndroidManifest.xml
@@ -0,0 +1,2 @@
+<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0.0" package="org.apache.cordova.okhttpplugin">
+</manifest>

http://git-wip-us.apache.org/repos/asf/cordova-plugins/blob/a365e2ac/android-okhttp/library/build-extras.gradle
----------------------------------------------------------------------
diff --git a/android-okhttp/library/build-extras.gradle b/android-okhttp/library/build-extras.gradle
new file mode 100644
index 0000000..465615d
--- /dev/null
+++ b/android-okhttp/library/build-extras.gradle
@@ -0,0 +1,24 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//  http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+repositories {
+    mavenCentral()
+}
+
+dependencies {
+    compile 'com.squareup.okhttp:okhttp-urlconnection:2.1.0'
+}

http://git-wip-us.apache.org/repos/asf/cordova-plugins/blob/a365e2ac/android-okhttp/library/project.properties
----------------------------------------------------------------------
diff --git a/android-okhttp/library/project.properties b/android-okhttp/library/project.properties
new file mode 100644
index 0000000..b3b1d5a
--- /dev/null
+++ b/android-okhttp/library/project.properties
@@ -0,0 +1,15 @@
+# This file is automatically generated by Android Tools.
+# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
+#
+# This file must be checked in Version Control Systems.
+#
+# To customize properties used by the Ant build system edit
+# "ant.properties", and override values to adapt the script to your
+# project structure.
+#
+# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
+#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
+
+# Project target.
+target=android-9
+android.library=true

http://git-wip-us.apache.org/repos/asf/cordova-plugins/blob/a365e2ac/android-okhttp/library/src/org/apache/cordova/okhttpplugin/OkHttpPlugin.java
----------------------------------------------------------------------
diff --git a/android-okhttp/library/src/org/apache/cordova/okhttpplugin/OkHttpPlugin.java b/android-okhttp/library/src/org/apache/cordova/okhttpplugin/OkHttpPlugin.java
new file mode 100644
index 0000000..ff308e5
--- /dev/null
+++ b/android-okhttp/library/src/org/apache/cordova/okhttpplugin/OkHttpPlugin.java
@@ -0,0 +1,39 @@
+/*
+       Licensed to the Apache Software Foundation (ASF) under one
+       or more contributor license agreements.  See the NOTICE file
+       distributed with this work for additional information
+       regarding copyright ownership.  The ASF licenses this file
+       to you under the Apache License, Version 2.0 (the
+       "License"); you may not use this file except in compliance
+       with the License.  You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+       Unless required by applicable law or agreed to in writing,
+       software distributed under the License is distributed on an
+       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+       KIND, either express or implied.  See the License for the
+       specific language governing permissions and limitations
+       under the License.
+*/
+package org.apache.cordova.okhttpplugin;
+
+import org.apache.cordova.CallbackContext;
+import org.apache.cordova.CordovaInterface;
+import org.apache.cordova.CordovaPlugin;
+import org.apache.cordova.PluginResult;
+import org.apache.cordova.CordovaWebView;
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import android.content.BroadcastReceiver;
+import android.content.Context;
+import android.content.Intent;
+import android.content.IntentFilter;
+import android.net.ConnectivityManager;
+import android.net.NetworkInfo;
+import android.util.Log;
+
+public class OkHttpPlugin extends CordovaPlugin {
+}

http://git-wip-us.apache.org/repos/asf/cordova-plugins/blob/a365e2ac/android-okhttp/plugin.xml
----------------------------------------------------------------------
diff --git a/android-okhttp/plugin.xml b/android-okhttp/plugin.xml
new file mode 100644
index 0000000..04c23fd
--- /dev/null
+++ b/android-okhttp/plugin.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    id="org.apache.cordova.labs.okhttp"
+    version="0.0.1">
+    <name>OkHttp</name>
+    <description>Uses OkHttp for network requests made by plugins that use CordovaResourceApi.createHttpConnection, such as org.apache.cordova.file-transfer.</description>
+    <license>Apache 2.0</license>
+    <keywords>cordova,okhttp</keywords>
+    <engines>
+        <engine name="cordova-android" version=">=4.0.0-dev" />
+    </engines>
+
+    <platform name="android">
+        <framework src="library" custom="true" />
+        <config-file parent="/*">
+            <feature name="OkHttpPlugin">
+                <param name="android-package" value="org.apache.cordova.okhttpplugin.OkHttpPlugin" />
+                <param name="onload" value="true" />
+            </feature>
+        </config-file>
+    </platform>
+</plugin>


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org