applicationId "net.osdn.gokigen.a01d"
minSdkVersion 14
targetSdkVersion 30
- versionCode 10903
- versionName "1.9.3"
+ versionCode 10904
+ versionName "1.9.4"
}
buildTypes {
release {
dependencies {
api fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.2.0'
- implementation 'androidx.exifinterface:exifinterface:1.3.1'
+ implementation 'androidx.exifinterface:exifinterface:1.3.2'
implementation 'androidx.preference:preference-ktx:1.1.1'
implementation 'com.google.android.material:material:1.2.1'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
{
String shootUrl = "http://192.168.1.1/osc/commands/execute";
String postData = (useThetaV21) ? "{\"name\":\"camera.takePicture\",\"parameters\":{\"timeout\":0}}" : "{\"name\":\"camera.takePicture\",\"parameters\":{\"sessionId\": \"" + sessionIdProvider.getSessionId() + "\"}}";
- String result = SimpleHttpClient.httpPost(shootUrl, postData, timeoutMs);
+ String result = SimpleHttpClient.httpPostWithHeader(shootUrl, postData, null, "application/json;charset=utf-8", timeoutMs);
if ((result == null)||(result.length() < 1))
{
Log.v(TAG, "singleShot() reply is null.");
{
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context);
useOscV2 = preferences.getBoolean(IPreferencePropertyAccessor.USE_OSC_THETA_V21, false);
+ Log.v(TAG, " use OSC v2 : " + useOscV2);
}
catch (Exception e)
{
// Create Slicer to open the stream and parse it.
slicer = new SimpleLiveviewSlicer();
- slicer.open(streamUrl, paramData);
+ slicer.open(streamUrl, paramData, "application/json;charset=utf-8");
while (whileFetching)
{
try
{
- String responseS = SimpleHttpClient.httpPost(commandsExecuteUrl, startSessionData, TIMEOUT_MS);
- Log.v(TAG, " " + commandsExecuteUrl + " " + startSessionData + " " + responseS);
+ 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);
- Log.v(TAG, " " + getStateUrl + " " + response);
+ String response = SimpleHttpClient.httpPostWithHeader(getStateUrl, "", null, null, TIMEOUT_MS);
+ Log.v(TAG, " (" + getStateUrl + ") " + response);
if (response.length() > 0)
{
int apiLevel = 1;
String sessionId = null;
- JSONObject object = new JSONObject(response);
- try
- {
- apiLevel = object.getJSONObject("state").getInt("_apiVersion");
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
+ JSONObject object = new JSONObject(response);
+ try
+ {
+ apiLevel = object.getJSONObject("state").getInt("_apiVersion");
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
try
{
sessionId = object.getJSONObject("state").getString("sessionId");
{
e.printStackTrace();
}
- if (apiLevel != 2)
- {
- String setApiLevelData = "{\"name\":\"camera.setOptions\",\"parameters\":{" + "\"sessionId\" : \"" + sessionId + "\", \"options\":{ \"clientVersion\":2}}}";
- String response3 = SimpleHttpClient.httpPost(commandsExecuteUrl, setApiLevelData, TIMEOUT_MS);
- Log.v(TAG, " " + commandsExecuteUrl + " " + setApiLevelData + " " + response3);
- }
+ if (apiLevel != 2)
+ {
+ String setApiLevelData = "{\"name\":\"camera.setOptions\",\"parameters\":{" + "\"sessionId\" : \"" + sessionId + "\", \"options\":{ \"clientVersion\":2}}}";
+ String response3 = SimpleHttpClient.httpPostWithHeader(commandsExecuteUrl, setApiLevelData, null, "application/json;charset=utf-8", TIMEOUT_MS);
+ Log.v(TAG, " " + commandsExecuteUrl + " " + setApiLevelData + " " + response3);
+ }
onConnectNotify();
}
else
}
*/
- public void open(String liveviewUrl, String postData)
+ public void open(String liveviewUrl, String postData, String contentType)
{
OutputStream outputStream = null;
OutputStreamWriter writer = null;
mHttpConn = (HttpURLConnection) urlObj.openConnection();
mHttpConn.setRequestMethod("POST");
mHttpConn.setConnectTimeout(CONNECTION_TIMEOUT);
+ if (contentType != null)
+ {
+ mHttpConn.setRequestProperty("Content-Type", contentType);
+ }
{
mHttpConn.setDoInput(true);
mHttpConn.setDoOutput(true);
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
- ext.kotlin_version = '1.4.10'
+ ext.kotlin_version = '1.4.20'
repositories {
jcenter()
google()
}
dependencies {
- classpath 'com.android.tools.build:gradle:4.1.0'
+ classpath 'com.android.tools.build:gradle:4.1.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong