OSDN Git Service

Theta V に対応させる。
authorMRSa <mrsa@myad.jp>
Tue, 29 Dec 2020 12:08:58 +0000 (21:08 +0900)
committerMRSa <mrsa@myad.jp>
Tue, 29 Dec 2020 12:08:58 +0000 (21:08 +0900)
.idea/codeStyles/Project.xml
.idea/compiler.xml [new file with mode: 0644]
.idea/gradle.xml
.idea/misc.xml
app/build.gradle
app/src/main/java/net/osdn/gokigen/pkremote/camera/utils/SimpleHttpClient.java
app/src/main/java/net/osdn/gokigen/pkremote/camera/vendor/theta/wrapper/connection/ThetaCameraConnectSequence.java
app/src/main/java/net/osdn/gokigen/pkremote/camera/vendor/theta/wrapper/playback/ThetaPlaybackControl.java
build.gradle
gradle/wrapper/gradle-wrapper.properties

index 681f41a..0d15693 100644 (file)
@@ -1,5 +1,23 @@
 <component name="ProjectCodeStyleConfiguration">
   <code_scheme name="Project" version="173">
+    <JetCodeStyleSettings>
+      <option name="PACKAGES_TO_USE_STAR_IMPORTS">
+        <value>
+          <package name="java.util" alias="false" withSubpackages="false" />
+          <package name="kotlinx.android.synthetic" alias="false" withSubpackages="true" />
+          <package name="io.ktor" alias="false" withSubpackages="true" />
+        </value>
+      </option>
+      <option name="PACKAGES_IMPORT_LAYOUT">
+        <value>
+          <package name="" alias="false" withSubpackages="true" />
+          <package name="java" alias="false" withSubpackages="true" />
+          <package name="javax" alias="false" withSubpackages="true" />
+          <package name="kotlin" alias="false" withSubpackages="true" />
+          <package name="" alias="true" withSubpackages="true" />
+        </value>
+      </option>
+    </JetCodeStyleSettings>
     <codeStyleSettings language="XML">
       <indentOptions>
         <option name="CONTINUATION_INDENT_SIZE" value="4" />
diff --git a/.idea/compiler.xml b/.idea/compiler.xml
new file mode 100644 (file)
index 0000000..61a9130
--- /dev/null
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="CompilerConfiguration">
+    <bytecodeTargetLevel target="1.8" />
+  </component>
+</project>
\ No newline at end of file
index 674414f..41871c2 100644 (file)
@@ -15,6 +15,7 @@
           </set>
         </option>
         <option name="resolveModulePerSourceSet" value="false" />
+        <option name="useQualifiedModuleNames" value="true" />
       </GradleProjectSettings>
     </option>
   </component>
index 4bb39d7..334463e 100644 (file)
@@ -74,7 +74,7 @@
       <textMaps />
     </LinkMapSettings>
   </component>
-  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" project-jdk-name="JDK" project-jdk-type="JavaSDK">
+  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="JDK" project-jdk-type="JavaSDK">
     <output url="file://$PROJECT_DIR$/build/classes" />
   </component>
   <component name="ProjectType">
index c4b4d4f..e247652 100644 (file)
@@ -6,8 +6,8 @@ android {
         applicationId "net.osdn.gokigen.pkremote"
         minSdkVersion 14
         targetSdkVersion 29
-        versionCode 10800
-        versionName "1.8.0"
+        versionCode 10801
+        versionName "1.8.1"
     }
     buildTypes {
         release {
@@ -20,10 +20,10 @@ android {
 dependencies {
     implementation fileTree(dir: 'libs', include: ['*.jar'])
     implementation 'androidx.appcompat:appcompat:1.2.0'
-    implementation 'androidx.exifinterface:exifinterface:1.2.0'
+    implementation 'androidx.exifinterface:exifinterface:1.3.2'
     implementation 'androidx.preference:preference:1.1.1'
-    implementation 'com.google.android.material:material:1.2.0'
-    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
+    implementation 'com.google.android.material:material:1.2.1'
+    implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
     implementation 'androidx.vectordrawable:vectordrawable:1.1.0'
 
     api files('libs/olycamerakit.jar')
index 43f95c9..a064758 100644 (file)
@@ -146,6 +146,16 @@ public class SimpleHttpClient
         httpCommandBytes(url, "POST", postData, setProperty, null, timeoutMs, callback);
     }
 
+    /**
+     *
+     *
+     *
+     */
+    public static void httpPostBytesWithHeader(String url, String postData, Map<String, String> setProperty, @Nullable String contentType, int timeoutMs, @NonNull IReceivedMessageCallback callback)
+    {
+        httpCommandBytes(url, "POST", postData, setProperty, contentType, timeoutMs, callback);
+    }
+
     private static void httpCommandBytes(@NonNull String url, @NonNull String requestMethod, @Nullable String postData, @Nullable Map<String, String> setProperty, @Nullable String contentType, int timeoutMs, @NonNull IReceivedMessageCallback callback)
     {
         HttpURLConnection httpConn = null;
@@ -360,6 +370,16 @@ public class SimpleHttpClient
      *
      *
      */
+    public static Bitmap httpPostBitmapWithHeader(String url, String postData, @Nullable Map<String, String> setProperty, @Nullable String contentType, int timeoutMs)
+    {
+        return (httpCommandBitmap(url, "POST", postData, setProperty, contentType, timeoutMs));
+    }
+
+    /**
+     *
+     *
+     *
+     */
     private static Bitmap httpCommandBitmap(@NonNull String url, @NonNull String requestMethod, @Nullable String postData, @Nullable Map<String, String> setProperty, @Nullable String contentType, int timeoutMs)
     {
         HttpURLConnection httpConn = null;
index cdd7a53..9cedada 100644 (file)
@@ -93,10 +93,10 @@ public class ThetaCameraConnectSequence implements Runnable
 
         try
         {
-            String response = SimpleHttpClient.httpPost(commandsExecuteUrl, startSessionData, TIMEOUT_MS);
+            String response = SimpleHttpClient.httpPostWithHeader(commandsExecuteUrl, startSessionData, null, "application/json;charset=utf-8", TIMEOUT_MS);
             Log.v(TAG, " " + commandsExecuteUrl + " " + startSessionData + " " + response);
 
-            String response2 = SimpleHttpClient.httpPost(getStateUrl, "", TIMEOUT_MS);
+            String response2 = SimpleHttpClient.httpPostWithHeader(getStateUrl, "", null, "application/json;charset=utf-8", TIMEOUT_MS);
             Log.v(TAG, " " + getStateUrl + " " + response2);
 
             onConnectNotify();
@@ -117,10 +117,10 @@ public class ThetaCameraConnectSequence implements Runnable
 
         try
         {
-            String responseS = SimpleHttpClient.httpPost(commandsExecuteUrl, startSessionData, TIMEOUT_MS);
+            String responseS = SimpleHttpClient.httpPostWithHeader(commandsExecuteUrl, startSessionData, null, "application/json;charset=utf-8", TIMEOUT_MS);
             Log.v(TAG, " " + commandsExecuteUrl + " " + startSessionData + " " + responseS);
 
-            String response = SimpleHttpClient.httpPost(getStateUrl, "", TIMEOUT_MS);
+            String response = SimpleHttpClient.httpPostWithHeader(getStateUrl, "", null, "application/json;charset=utf-8", TIMEOUT_MS);
             Log.v(TAG, " " + getStateUrl + " " + response);
             if (response.length() > 0)
             {
@@ -140,7 +140,7 @@ public class ThetaCameraConnectSequence implements Runnable
                    String sessionId = jsonObject.getString("sessionId");
                    String setApiLevelData = "{\"name\":\"camera.setOptions\",\"parameters\":{" + "\"sessionId\" : \"" + sessionId + "\", \"options\":{ \"clientVersion\":2}}}";
 
-                   String response3 = SimpleHttpClient.httpPost(commandsExecuteUrl, setApiLevelData, TIMEOUT_MS);
+                   String response3 = SimpleHttpClient.httpPostWithHeader(commandsExecuteUrl, setApiLevelData, null, "application/json;charset=utf-8", TIMEOUT_MS);
                    Log.v(TAG, " " + commandsExecuteUrl + " " + setApiLevelData + " " + response3);
                }
                 onConnectNotify();
index b7a3d44..9d08786 100644 (file)
@@ -38,7 +38,7 @@ public class ThetaPlaybackControl implements IPlaybackControl
     private final int maxCount;
     private final boolean useThetaV21;
 
-    private List<ICameraContent> cameraContentList;
+    private final List<ICameraContent> cameraContentList;
 
     public ThetaPlaybackControl(@NonNull Activity activity, int timeoutMs, int maxCount)
     {
@@ -101,7 +101,7 @@ public class ThetaPlaybackControl implements IPlaybackControl
             String postData = "{\"name\":\"camera.getImage\",\"parameters\":{\"_type\":\"thumb\",\"fileUri\":\"" + path + "\"}}";
             //Log.v(TAG, " postData : " + postData);
 
-            Bitmap bmp = SimpleHttpClient.httpPostBitmap(url, postData, timeoutValue);
+            Bitmap bmp = SimpleHttpClient.httpPostBitmapWithHeader(url, postData, null, "application/json;charset=utf-8", timeoutValue);
             HashMap<String, Object> map = new HashMap<>();
             map.put("Orientation", 0);
             callback.onCompleted(bmp, map);
@@ -141,7 +141,7 @@ public class ThetaPlaybackControl implements IPlaybackControl
                 {
                     //Log.v(TAG, " exec getFileList");
                     String imageListurl = "http://192.168.1.1/osc/commands/execute";
-                    String contentList = SimpleHttpClient.httpPost(imageListurl, paramData, timeoutValue);
+                    String contentList = SimpleHttpClient.httpPostWithHeader(imageListurl, paramData, null, "application/json;charset=utf-8", timeoutValue);
                     if (contentList != null)
                     {
                         JSONObject resultsObject = new JSONObject(contentList).getJSONObject("results");
@@ -232,7 +232,7 @@ public class ThetaPlaybackControl implements IPlaybackControl
         String postData = "{\"name\":\"camera.getImage\",\"parameters\":{\"_type\":\"full\",\"fileUri\":\"" + path + "\"}}";
         try
         {
-            SimpleHttpClient.httpPostBytes(urlToGet, postData, null, timeoutValue, new SimpleHttpClient.IReceivedMessageCallback() {
+            SimpleHttpClient.httpPostBytesWithHeader(urlToGet, postData, null, "application/json;charset=utf-8", timeoutValue, new SimpleHttpClient.IReceivedMessageCallback() {
                 @Override
                 public void onCompleted() {
                     callback.onCompleted();
@@ -295,7 +295,7 @@ public class ThetaPlaybackControl implements IPlaybackControl
         String contentList;
         try
         {
-            contentList = SimpleHttpClient.httpPost(imageListurl, paramStr, timeoutValue);
+            contentList = SimpleHttpClient.httpPostWithHeader(imageListurl, paramStr, null, "application/json;charset=utf-8", timeoutValue);
             if (contentList == null)
             {
                 // ぬるぽ発行
@@ -345,7 +345,7 @@ public class ThetaPlaybackControl implements IPlaybackControl
         {
             String paramStr = "{\"name\":\"camera.listFiles\",\"parameters\":{\"fileType\":\"all\",\"entryCount\":" +  maxCount + ",\"maxThumbSize\":640,\"_detail\":false, \"_sort\":\"newest\"}}";
             //Log.v(TAG, " paramStr : " + paramStr);
-            contentList = SimpleHttpClient.httpPost(imageListurl, paramStr, timeoutValue);
+            contentList = SimpleHttpClient.httpPostWithHeader(imageListurl, paramStr, null, "application/json;charset=utf-8", timeoutValue);
             if (contentList == null)
             {
                 // ぬるぽ発行
index 0acabe9..9313af6 100644 (file)
@@ -7,7 +7,7 @@ buildscript {
         
     }
     dependencies {
-        classpath 'com.android.tools.build:gradle:4.0.0'
+        classpath 'com.android.tools.build:gradle:4.1.1'
         
         // NOTE: Do not place your application dependencies here; they belong
         // in the individual module build.gradle files
index 693f1bb..37f7d30 100644 (file)
@@ -1,6 +1,6 @@
-#Sat May 30 16:01:16 JST 2020
+#Tue Dec 29 19:08:31 JST 2020
 distributionBase=GRADLE_USER_HOME
 distributionPath=wrapper/dists
 zipStoreBase=GRADLE_USER_HOME
 zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip