OSDN Git Service

initial.
authorMRSa <mrsa@myad.jp>
Fri, 12 Apr 2019 15:43:15 +0000 (00:43 +0900)
committerMRSa <mrsa@myad.jp>
Fri, 12 Apr 2019 15:43:15 +0000 (00:43 +0900)
45 files changed:
.gitignore [new file with mode: 0644]
.idea/vcs.xml [new file with mode: 0644]
app/.gitignore [new file with mode: 0644]
app/build.gradle [new file with mode: 0644]
app/proguard-rules.pro [new file with mode: 0644]
app/src/main/AndroidManifest.xml [new file with mode: 0644]
app/src/main/java/net/osdn/gokigen/cameratest/MainActivity.java [new file with mode: 0644]
app/src/main/java/net/osdn/gokigen/cameratest/camtest/CamTest.java [new file with mode: 0644]
app/src/main/java/net/osdn/gokigen/cameratest/fuji/Communication.java [new file with mode: 0644]
app/src/main/java/net/osdn/gokigen/cameratest/fuji/Connection.java [new file with mode: 0644]
app/src/main/java/net/osdn/gokigen/cameratest/fuji/MessageSequence.java [new file with mode: 0644]
app/src/main/java/net/osdn/gokigen/cameratest/fuji/Properties.java [new file with mode: 0644]
app/src/main/java/net/osdn/gokigen/cameratest/fuji/PropertyValues.java [new file with mode: 0644]
app/src/main/java/net/osdn/gokigen/cameratest/pages/SectionsPagerAdapter.java [new file with mode: 0644]
app/src/main/java/net/osdn/gokigen/cameratest/pages/TestViewFragment.java [new file with mode: 0644]
app/src/main/res/drawable-v24/ic_launcher_foreground.xml [new file with mode: 0644]
app/src/main/res/drawable/aoi.jpg [new file with mode: 0644]
app/src/main/res/drawable/cameratest.jpg [new file with mode: 0644]
app/src/main/res/drawable/ic_cloud_queue_black_24dp.xml [new file with mode: 0644]
app/src/main/res/drawable/ic_launcher_background.xml [new file with mode: 0644]
app/src/main/res/layout/activity_main.xml [new file with mode: 0644]
app/src/main/res/layout/fragment_main.xml [new file with mode: 0644]
app/src/main/res/menu/menu_main.xml [new file with mode: 0644]
app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml [new file with mode: 0644]
app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml [new file with mode: 0644]
app/src/main/res/mipmap-hdpi/ic_launcher.png [new file with mode: 0644]
app/src/main/res/mipmap-hdpi/ic_launcher_round.png [new file with mode: 0644]
app/src/main/res/mipmap-mdpi/ic_launcher.png [new file with mode: 0644]
app/src/main/res/mipmap-mdpi/ic_launcher_round.png [new file with mode: 0644]
app/src/main/res/mipmap-xhdpi/ic_launcher.png [new file with mode: 0644]
app/src/main/res/mipmap-xhdpi/ic_launcher_round.png [new file with mode: 0644]
app/src/main/res/mipmap-xxhdpi/ic_launcher.png [new file with mode: 0644]
app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png [new file with mode: 0644]
app/src/main/res/mipmap-xxxhdpi/ic_launcher.png [new file with mode: 0644]
app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png [new file with mode: 0644]
app/src/main/res/values-w820dp/dimens.xml [new file with mode: 0644]
app/src/main/res/values/colors.xml [new file with mode: 0644]
app/src/main/res/values/dimens.xml [new file with mode: 0644]
app/src/main/res/values/strings.xml [new file with mode: 0644]
app/src/main/res/values/styles.xml [new file with mode: 0644]
build.gradle [new file with mode: 0644]
gradle.properties [new file with mode: 0644]
gradlew [new file with mode: 0644]
gradlew.bat [new file with mode: 0644]
settings.gradle [new file with mode: 0644]

diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..2b75303
--- /dev/null
@@ -0,0 +1,13 @@
+*.iml
+.gradle
+/local.properties
+/.idea/caches
+/.idea/libraries
+/.idea/modules.xml
+/.idea/workspace.xml
+/.idea/navEditor.xml
+/.idea/assetWizardSettings.xml
+.DS_Store
+/build
+/captures
+.externalNativeBuild
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100644 (file)
index 0000000..94a25f7
--- /dev/null
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="VcsDirectoryMappings">
+    <mapping directory="$PROJECT_DIR$" vcs="Git" />
+  </component>
+</project>
\ No newline at end of file
diff --git a/app/.gitignore b/app/.gitignore
new file mode 100644 (file)
index 0000000..796b96d
--- /dev/null
@@ -0,0 +1 @@
+/build
diff --git a/app/build.gradle b/app/build.gradle
new file mode 100644 (file)
index 0000000..0cc8718
--- /dev/null
@@ -0,0 +1,25 @@
+apply plugin: 'com.android.application'
+
+android {
+    compileSdkVersion 28
+    defaultConfig {
+        applicationId "net.osdn.gokigen.cameratest"
+        minSdkVersion 14
+        targetSdkVersion 28
+        versionCode 10000
+        versionName "1.0.0"
+    }
+    buildTypes {
+        release {
+            minifyEnabled false
+            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
+        }
+    }
+}
+
+dependencies {
+    implementation fileTree(dir: 'libs', include: ['*.jar'])
+    implementation 'androidx.appcompat:appcompat:1.1.0-alpha03'
+    implementation 'com.google.android.material:material:1.1.0-alpha04'
+    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
+}
diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro
new file mode 100644 (file)
index 0000000..f1b4245
--- /dev/null
@@ -0,0 +1,21 @@
+# Add project specific ProGuard rules here.
+# You can control the set of applied configuration files using the
+# proguardFiles setting in build.gradle.
+#
+# For more details, see
+#   http://developer.android.com/guide/developing/tools/proguard.html
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+#   public *;
+#}
+
+# Uncomment this to preserve the line number information for
+# debugging stack traces.
+#-keepattributes SourceFile,LineNumberTable
+
+# If you keep the line number information, uncomment this to
+# hide the original source file name.
+#-renamesourcefileattribute SourceFile
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
new file mode 100644 (file)
index 0000000..54f90f3
--- /dev/null
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:dist="http://schemas.android.com/apk/distribution"
+    package="net.osdn.gokigen.cameratest">
+
+    <dist:module dist:instant="true" />
+
+    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
+    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
+    <uses-permission android:name="android.permission.INTERNET"/>
+    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
+    <uses-permission android:name="android.permission.VIBRATE" />
+
+
+    <application
+        android:allowBackup="true"
+        android:icon="@mipmap/ic_launcher"
+        android:label="@string/app_name"
+        android:roundIcon="@mipmap/ic_launcher_round"
+        android:usesCleartextTraffic="true"
+        android:supportsRtl="true"
+        android:theme="@style/AppTheme">
+        <activity
+            android:name="net.osdn.gokigen.cameratest.MainActivity"
+            android:label="@string/app_name"
+            android:theme="@style/AppTheme.NoActionBar">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+
+                <category android:name="android.intent.category.LAUNCHER" />
+            </intent-filter>
+        </activity>
+        <meta-data android:name="android.max_aspect" android:value="ratio_float"/>
+    </application>
+
+</manifest>
\ No newline at end of file
diff --git a/app/src/main/java/net/osdn/gokigen/cameratest/MainActivity.java b/app/src/main/java/net/osdn/gokigen/cameratest/MainActivity.java
new file mode 100644 (file)
index 0000000..e8c22de
--- /dev/null
@@ -0,0 +1,183 @@
+package net.osdn.gokigen.cameratest;
+
+import com.google.android.material.floatingactionbutton.FloatingActionButton;
+
+import androidx.annotation.NonNull;
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.appcompat.widget.Toolbar;
+
+import androidx.core.app.ActivityCompat;
+import androidx.core.content.ContextCompat;
+import androidx.viewpager.widget.ViewPager;
+
+import android.Manifest;
+import android.content.Intent;
+import android.content.pm.PackageManager;
+import android.os.Bundle;
+import android.provider.Settings;
+import android.util.Log;
+import android.view.Menu;
+import android.view.MenuItem;
+import android.view.View;
+import android.view.WindowManager;
+
+import net.osdn.gokigen.cameratest.camtest.CamTest;
+import net.osdn.gokigen.cameratest.pages.SectionsPagerAdapter;
+
+public class MainActivity extends AppCompatActivity
+{
+    private final String TAG = toString();
+    private SectionsPagerAdapter mSectionsPagerAdapter;
+    private ViewPager mViewPager;
+    private CamTest testTarget;
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState)
+    {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.activity_main);
+
+        testTarget = new CamTest(this);
+
+        Toolbar toolbar = findViewById(R.id.toolbar);
+        setSupportActionBar(toolbar);
+
+        getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
+
+        // Create the adapter that will return a fragment for each of the three
+        // primary sections of the activity.
+        mSectionsPagerAdapter = new SectionsPagerAdapter(getSupportFragmentManager(), testTarget);
+
+        // Set up the ViewPager with the sections adapter.
+        mViewPager = findViewById(R.id.container);
+        mViewPager.setAdapter(mSectionsPagerAdapter);
+
+        FloatingActionButton fab = findViewById(R.id.fab);
+        fab.setOnClickListener(new View.OnClickListener()
+        {
+            @Override
+            public void onClick(View view)
+            {
+                testTarget.connect();
+            }
+        });
+
+        // パーミッション群のオプトイン
+        final int REQUEST_NEED_PERMISSIONS = 1010;
+        if ((ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) ||
+                (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_NETWORK_STATE) != PackageManager.PERMISSION_GRANTED) ||
+                (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_WIFI_STATE) != PackageManager.PERMISSION_GRANTED) ||
+                (ContextCompat.checkSelfPermission(this, Manifest.permission.VIBRATE) != PackageManager.PERMISSION_GRANTED) ||
+                (ContextCompat.checkSelfPermission(this, Manifest.permission.INTERNET) != PackageManager.PERMISSION_GRANTED)) {
+            ActivityCompat.requestPermissions(this,
+                    new String[]{
+                            Manifest.permission.WRITE_EXTERNAL_STORAGE,
+                            Manifest.permission.ACCESS_NETWORK_STATE,
+                            Manifest.permission.ACCESS_WIFI_STATE,
+                            Manifest.permission.VIBRATE,
+                            Manifest.permission.INTERNET,
+                    },
+                    REQUEST_NEED_PERMISSIONS);
+        }
+        initializeClass();
+        prepareClass();
+        onReadyClass();
+
+    }
+
+    @Override
+    public void onRequestPermissionsResult(int requestCode, @NonNull String permissions[], @NonNull int[] grantResults)
+    {
+        super.onRequestPermissionsResult(requestCode, permissions, grantResults);
+        prepareClass();
+        onReadyClass();
+    }
+
+    @Override
+    public boolean onCreateOptionsMenu(Menu menu)
+    {
+        // Inflate the menu; this adds items to the action bar if it is present.
+        getMenuInflater().inflate(R.menu.menu_main, menu);
+        return true;
+    }
+
+    @Override
+    public boolean onOptionsItemSelected(MenuItem item)
+    {
+        // Handle action bar item clicks here. The action bar will
+        // automatically handle clicks on the Home/Up button, so long
+        // as you specify a parent activity in AndroidManifest.xml.
+        int id = item.getItemId();
+
+        //noinspection SimplifiableIfStatement
+        if (id == R.id.action_settings)
+        {
+            testTarget.settings();
+            return (true);
+        }
+        if (id == R.id.action_wifi_settings)
+        {
+            try
+            {
+                // Wifi 設定画面を表示する
+                startActivity(new Intent(Settings.ACTION_WIFI_SETTINGS));
+                return (true);
+            }
+            catch (Exception e)
+            {
+                e.printStackTrace();
+            }
+            return (true);
+        }
+        return super.onOptionsItemSelected(item);
+    }
+
+    /**
+     * クラスの初期化 (instantiate)
+     */
+    private void initializeClass()
+    {
+        try
+        {
+            Log.v(TAG, "Initialize ...");
+
+
+        }
+        catch (Exception e)
+        {
+            e.printStackTrace();
+        }
+    }
+
+    /**
+     * クラスの準備 (prepare)
+     */
+    private void prepareClass()
+    {
+        try
+        {
+            Log.v(TAG, "Prepare ...");
+        }
+        catch (Exception e)
+        {
+            e.printStackTrace();
+        }
+    }
+
+    /**
+     * クラスの準備完了 (onReady)
+     */
+    private void onReadyClass()
+    {
+        try
+        {
+            Log.v(TAG, "on Ready ...");
+        }
+        catch (Exception e)
+        {
+            e.printStackTrace();
+        }
+    }
+
+
+}
diff --git a/app/src/main/java/net/osdn/gokigen/cameratest/camtest/CamTest.java b/app/src/main/java/net/osdn/gokigen/cameratest/camtest/CamTest.java
new file mode 100644 (file)
index 0000000..e1878d7
--- /dev/null
@@ -0,0 +1,100 @@
+package net.osdn.gokigen.cameratest.camtest;
+
+import android.app.Activity;
+import android.util.Log;
+import android.view.View;
+import android.widget.TextView;
+
+import com.google.android.material.snackbar.Snackbar;
+
+import net.osdn.gokigen.cameratest.R;
+import net.osdn.gokigen.cameratest.fuji.Connection;
+
+import androidx.annotation.NonNull;
+
+public class CamTest implements View.OnClickListener
+{
+    private String TAG = toString();
+    private final Activity activity;
+    private TextView textview;
+    private Connection connection;
+    public CamTest(@NonNull Activity activity)
+    {
+        this.activity = activity;
+        this.connection = new Connection();
+    }
+
+    public void connect()
+    {
+        Log.v(TAG, "connect request");
+        try
+        {
+            Snackbar.make(activity.findViewById(R.id.constraintLayout), R.string.connect, Snackbar.LENGTH_SHORT).show();
+
+            showMessageText("START CONNECT");
+            Thread thread = new Thread(new Runnable() {
+                @Override
+                public void run() {
+                    boolean ret = connection.start_connect();
+                    if (!ret)
+                    {
+                        showMessageText("CONNECT FAILURE...");
+                    }
+                }
+            });
+            thread.start();
+        }
+        catch (Exception e)
+        {
+            e.printStackTrace();
+        }
+    }
+
+    public void settings()
+    {
+        Log.v(TAG, "settings menu");
+
+        showMessageText("BBBB");
+    }
+
+    private void showMessageText(final String message)
+    {
+        activity.runOnUiThread(new Runnable() {
+            @Override
+            public void run() {
+                try {
+                    if (textview == null) {
+                        textview = activity.findViewById(R.id.show_information);
+                    }
+                    if (textview != null) {
+                        textview.setText(message);
+                    }
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+            }
+        });
+    }
+
+    @Override
+    public void onClick(View v)
+    {
+        Log.v(TAG, "onClick : " + v.getId());
+        int id = v.getId();
+        switch (id)
+        {
+            case R.id.button1:
+                showMessageText("Button1");
+                break;
+            case R.id.button2:
+                showMessageText("Button2");
+                break;
+            case R.id.button3:
+                showMessageText("Button3");
+                break;
+            default:
+                showMessageText("Unknown : " + id);
+                break;
+        }
+    }
+}
diff --git a/app/src/main/java/net/osdn/gokigen/cameratest/fuji/Communication.java b/app/src/main/java/net/osdn/gokigen/cameratest/fuji/Communication.java
new file mode 100644 (file)
index 0000000..1ef6ed1
--- /dev/null
@@ -0,0 +1,239 @@
+package net.osdn.gokigen.cameratest.fuji;
+
+import android.util.Log;
+
+import java.io.BufferedInputStream;
+import java.io.BufferedReader;
+import java.io.DataInputStream;
+import java.io.DataOutputStream;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.net.Socket;
+import java.util.Arrays;
+
+class Communication
+{
+    private final String TAG = toString();
+    private static final int BUFFER_SIZE = 131072 + 4;
+
+    private String camera_ip = "192.168.0.1";
+    private int camera_port = 55740;
+
+//private final int control_server_port = 55740;
+//private final int async_response_server_port = 55741;
+//private final int jpg_stream_server_port = 55742;
+
+    private Socket socket = null;
+    private DataOutputStream dos = null;
+    private DataInputStream dis = null;
+
+    Communication()
+    {
+
+
+    }
+
+    void connect_socket()
+    {
+        try
+        {
+            socket = new Socket(camera_ip, camera_port);
+        }
+        catch (Exception e)
+        {
+            e.printStackTrace();
+        }
+    }
+
+    void disconnect_socket()
+    {
+        // ストリームを閉じる
+        try
+        {
+            dos.close();
+        }
+        catch (Exception e)
+        {
+            e.printStackTrace();
+        }
+        dos = null;
+        try
+        {
+            dis.close();
+
+        }
+        catch (Exception e)
+        {
+            e.printStackTrace();
+        }
+        dis = null;
+        try
+        {
+            socket.close();
+
+        }
+        catch (Exception e)
+        {
+            e.printStackTrace();
+        }
+        socket = null;
+        System.gc();
+    }
+
+    void send_to_camera(byte[] byte_array)
+    {
+        Log.v(TAG, "send_to_camera() : " + byte_array.length + " bytes.");
+        try
+        {
+            dos = new DataOutputStream(socket.getOutputStream());
+
+            // 最初に4バイトのレングス長をつけて送る
+            byte[] sendData = new byte[byte_array.length + 4];
+
+            sendData[0] = 0x00;
+            sendData[1] = 0x00;
+            sendData[2] = 0x00;
+            sendData[3] = (byte) (byte_array.length + 4);
+            System.arraycopy(byte_array,0,sendData,4, byte_array.length);
+
+            Log.v(TAG, "send_to_camera() : WRITE " + sendData.length + " bytes.");
+            dump_bytes("WRITE ", sendData);
+
+            // (データを)送信
+            dos.write(sendData);
+            dos.flush();
+        }
+        catch (Exception e)
+        {
+            e.printStackTrace();
+        }
+    }
+
+    byte[] receive_from_camera()
+    {
+        int receive_bytes = 0;
+        byte[] byte_array = new byte[BUFFER_SIZE];
+        try
+        {
+            InputStream is = socket.getInputStream();
+            if (is == null)
+            {
+                Log.v(TAG, "input stream is null.");
+                return (new byte[0]);
+            }
+
+            BufferedReader reader = new BufferedReader(new InputStreamReader(socket.getInputStream()));
+            int data = 0x00;
+            int read_bytes = 0;
+            while ((data = reader.read()) != -1 )
+            {
+                byte_array[read_bytes] = (byte) data;
+                read_bytes++;
+            }
+            receive_bytes = read_bytes;
+
+
+/*
+            dis = new DataInputStream(socket.getInputStream());
+            //BufferedInputStream stream = new BufferedInputStream(is);
+            while (receive_bytes < BUFFER_SIZE)
+            {
+                int data = dis.read();
+                if (data < 0)
+                {
+                    break;
+                }
+                //byte data = dis.readByte();
+                byte_array[receive_bytes] = (byte )data;
+                receive_bytes++;
+            }
+*/
+        }
+        catch (Exception e)
+        {
+            e.printStackTrace();
+        }
+        if (receive_bytes > 0)
+        {
+            dump_bytes("RECEIVE ", byte_array);
+        }
+        Log.v(TAG, " received : " + receive_bytes + " bytes.");
+        if (receive_bytes < 4)
+        {
+            return (new byte[0]);
+        }
+        return (Arrays.copyOfRange(byte_array, 4, (byte_array.length - 3)));
+    }
+
+
+    private void dump_bytes(String header, byte[] data)
+    {
+        int index = 0;
+        StringBuffer message;
+        message = new StringBuffer();
+        for (byte item : data)
+        {
+            index++;
+            message.append(String.format("%02x ", item));
+            if (index >= 8)
+            {
+                Log.v(TAG, header + " " + message);
+                index = 0;
+                message = new StringBuffer();
+            }
+        }
+        if (index != 0)
+        {
+            Log.v(TAG, header + " " + message);
+        }
+        System.gc();
+    }
+
+
+/*
+    boolean send_message(byte[] byte_array)
+    {
+        send_to_camera(byte_array);
+
+    }
+*/
+/*    bool fuji_message(native_socket const sockfd, uint32_t const id, void const* message,
+                      size_t size) {
+        fuji_send(sockfd, message, size);
+
+        uint8_t buffer[8];
+        size_t receivedBytes = fuji_receive_log(sockfd, buffer);
+
+        if (!is_success_response(id, buffer, receivedBytes)) {
+            log(LOG_DEBUG, string_format("received %zd bytes ", receivedBytes).append(hex_format(buffer, receivedBytes)));
+            return false;
+        }
+
+        return true;
+    }
+*/
+
+/*
+bool is_success_response(uint32_t const id, void const* buffer,
+                         size_t const size) {
+  if (size != 8) return false;
+
+  struct response_success {
+    uint8_t const type[4] = {0x03, 0x00, 0x01, 0x20};
+    uint32_t id;
+  };
+
+  response_success success = {};
+  success.id = id;
+  bool const result = memcmp(&success, buffer, 8) == 0;
+  if (!result) {
+    log(LOG_WARN, std::string("expected: ").append(hex_format(&success, 8)));
+    log(LOG_WARN, std::string("actual: ").append(hex_format(buffer, 8)));
+  }
+  return result;
+}
+
+ */
+
+
+}
diff --git a/app/src/main/java/net/osdn/gokigen/cameratest/fuji/Connection.java b/app/src/main/java/net/osdn/gokigen/cameratest/fuji/Connection.java
new file mode 100644 (file)
index 0000000..df16469
--- /dev/null
@@ -0,0 +1,93 @@
+package net.osdn.gokigen.cameratest.fuji;
+
+import android.util.Log;
+
+public class Connection
+{
+    private final String TAG = toString();
+    private final MessageSequence sequence;
+    private final Communication comm;
+
+    public Connection()
+    {
+        this.comm = new Communication();
+        this.sequence = new MessageSequence();
+    }
+
+    public boolean start_connect()
+    {
+        boolean ret = false;
+
+        ret = connect_to_camera();
+
+        return (ret);
+    }
+
+
+    private boolean connect_to_camera()
+    {
+
+        try
+        {
+            int indexNumber = 0;
+            comm.connect_socket();
+
+            comm.send_to_camera(sequence.registration_message());
+
+            byte[] rx_bytes = comm.receive_from_camera();
+            dump_bytes(indexNumber, rx_bytes);
+            indexNumber++;
+/*
+            応答エラーの場合は この値が返ってくるはず  = {0x05, 0x00, 0x00, 0x00, 0x19, 0x20, 0x00, 0x00};
+*/
+            comm.send_to_camera(sequence.start_message());
+            rx_bytes = comm.receive_from_camera();
+            dump_bytes(indexNumber, rx_bytes);
+            //indexNumber++;
+/*
+            応答OKの場合は、8バイト ({0x03, 0x00, 0x01, 0x20} + {0x10, 0x02, 0x00, 0x00} )が応答されるはず
+
+*/
+
+
+/*
+            auto const msg4_1 =
+                make_static_message(message_type::two_part, 0x01, 0xdf, 0x00, 0x00);
+            auto const msg4_2 = make_static_message_followup(msg4_1, 0x05, 0x00);
+            fuji_twopart_message(sockfd, msg4_1, msg4_2);
+*/
+
+
+            return (true);
+        }
+        catch (Exception e)
+        {
+            e.printStackTrace();
+        }
+        return (false);
+    }
+
+
+    private void dump_bytes(int indexNumber, byte[] data)
+    {
+        int index = 0;
+        StringBuffer message;
+        message = new StringBuffer();
+        for (byte item : data)
+        {
+            index++;
+            message.append(String.format("%02x ", item));
+            if (index >= 8)
+            {
+                Log.v(TAG, " RX [" + indexNumber + "] " + message);
+                index = 0;
+                message = new StringBuffer();
+            }
+        }
+        if (index != 0)
+        {
+            Log.v(TAG, " RX [" + indexNumber + "] "  + message);
+        }
+        System.gc();
+    }
+}
diff --git a/app/src/main/java/net/osdn/gokigen/cameratest/fuji/MessageSequence.java b/app/src/main/java/net/osdn/gokigen/cameratest/fuji/MessageSequence.java
new file mode 100644 (file)
index 0000000..1d62374
--- /dev/null
@@ -0,0 +1,98 @@
+package net.osdn.gokigen.cameratest.fuji;
+
+class MessageSequence
+{
+    static final int HELLO = 0x0000;
+
+    static final int START = 0x1002;
+    static final int STOP = 0x1003;
+
+    static final int IMAGE_INFO = 0x1008;
+    static final int THUMBNAIL = 0x100a;
+
+    static final int SHUTTER = 0x100e;
+
+    static final int SINGLE_PART = 0x1015;
+    static final int DOUBLE_PART = 0x1016;
+
+    static final int FULL_IMAGE = 0x101b;
+    static final int CAMERA_REMOTE = 0x101c;
+
+    static final int CAMERA_LAST_IMAGE = 0x9022;
+
+    static final int FOCUS_POINT = 0x9026;
+    static final int FOCUS_UNLOCK = 0x9027;
+
+    static final int CAMERA_CAPABILITIES = 0x902b;
+
+    static final int SHUTTER_SPEED = 0x902c;
+    static final int APERTURE = 0x902d;
+    static final int EXPOSURE_CORRECTION = 0x902e;
+
+    byte[] registration_message()
+    {
+        return (new byte[] {
+                // length byte :  (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
+                // header
+                (byte)0x01, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0xf2, (byte)0xe4, (byte)0x53, (byte)0x8f,
+                (byte)0xad, (byte)0xa5, (byte)0x48, (byte)0x5d, (byte)0x87, (byte)0xb2, (byte)0x7f, (byte)0x0b,
+                (byte)0xd3, (byte)0xd5, (byte)0xde, (byte)0xd0, (byte)0x02, (byte)0x78, (byte)0xa8, (byte)0xc0,
+                // device_name 'GOKIGEN device 0'
+                (byte)0x47, (byte)0x00, (byte)0x4f, (byte)0x00, (byte)0x4b, (byte)0x00, (byte)0x49, (byte)0x00,
+                (byte)0x47, (byte)0x00, (byte)0x45, (byte)0x00, (byte)0x4e, (byte)0x00, (byte)0x00, (byte)0x00,
+                (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
+                (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
+                (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
+                (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
+                (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
+        });
+    }
+
+    byte[] hello_message()
+    {
+        return (new byte[] {
+                // HELLO (0x0000)
+                0x00, 0x00,
+        });
+    }
+
+    byte[] start_message()
+    {
+        return (new byte[] {
+                // START (0x1002)
+                (byte)0x10, (byte)0x02,
+                // index
+                (byte)0x00, (byte)0x01,
+                // data
+                (byte)0x01, (byte)0x00, (byte)0x00, (byte)0x00,
+        });
+    }
+
+    byte[] two_part_message_One()
+    {
+        return (new byte[] {
+                // TWO PART (0x1016)
+                (byte)0x10, (byte)0x16,
+                // index
+                (byte)0x00, (byte)0x01,
+                // data
+                (byte)0x01, (byte)0xdf, (byte)0x00, (byte)0x00,
+        });
+    }
+
+    byte[] two_part_message_Two()
+    {
+        return (new byte[] {
+                // TWO PART (0x1016)
+                (byte)0x10, (byte)0x16,
+                // index
+                (byte)0x00, (byte)0x02,
+                // data
+                (byte)0x05, (byte)0x00, (byte)0x00, (byte)0x00,
+        });
+    }
+
+
+
+
+}
diff --git a/app/src/main/java/net/osdn/gokigen/cameratest/fuji/Properties.java b/app/src/main/java/net/osdn/gokigen/cameratest/fuji/Properties.java
new file mode 100644 (file)
index 0000000..bf030ec
--- /dev/null
@@ -0,0 +1,28 @@
+package net.osdn.gokigen.cameratest.fuji;
+
+public class Properties
+{
+    static final int WHITE_BALANCE = 0x5005;
+    static final int APERTURE = 0x5007;
+    static final int FOCUS_MODE            = 0x500a;
+    static final int SHOOTING_MODE         = 0x500e;
+    static final int FLASH                 = 0x500c;
+    static final int EXPOSURE_COMPENSATION = 0x5010;
+    static final int SELF_TIMER            = 0x5012;
+    static final int FILM_SIMULATION       = 0xd001;
+    static final int IMAGE_FORMAT          = 0xd018;
+    static final int RECMODE_ENABLE        = 0xd019;
+    static final int F_SS_CONTROL          = 0xd028;
+    static final int ISO                   = 0xd02a;
+    static final int MOVIE_ISO             = 0xd02b;
+    static final int FOCUS_POINT           = 0xd17c;
+    static final int FOCUS_LOCK            = 0xd209;
+    static final int DEVICE_ERROR          = 0xd21b;
+    static final int SDCARD_REMAIN_SIZE        = 0xd229;
+    static final int MOVIE_REMAINING_TIME  = 0xd22a;
+    static final int SHUTTER_SPEED         = 0xd240;
+    static final int IMAGE_ASPECT          = 0xd241;
+    static final int BATTERY_LEVEL         = 0xd242;
+    static final int UNKNOWN  = 0xffff;
+
+}
diff --git a/app/src/main/java/net/osdn/gokigen/cameratest/fuji/PropertyValues.java b/app/src/main/java/net/osdn/gokigen/cameratest/fuji/PropertyValues.java
new file mode 100644 (file)
index 0000000..e3902dd
--- /dev/null
@@ -0,0 +1,93 @@
+package net.osdn.gokigen.cameratest.fuji;
+
+public class PropertyValues
+{
+    static final int IMAGE_FORMAT_FINE =2;
+    static final int IMAGE_FORMAT_NORMAL =3;
+    static final int IMAGE_FORMAT_FINE_RAW  =4;
+    static final int IMAGE_FORMAT_NORMAL_RAW  =5;
+    static final int IMAGE_ASPECT_S_3x2  =2;
+    static final int IMAGE_ASPECT_S_16x9  =3;
+    static final int IMAGE_ASPECT_S_1x1  =4;
+    static final int IMAGE_ASPECT_M_3x2  =6;
+    static final int IMAGE_ASPECT_M_16x9  =7;
+    static final int IMAGE_ASPECT_M_1x1  =8;
+    static final int IMAGE_ASPECT_L_3x2  =10;
+    static final int IMAGE_ASPECT_L_16x9  =11;
+    static final int IMAGE_ASPECT_L_1x1  =12;
+    static final int FOCUS_MANUAL  =1;
+    static final int FOCUS_SINGLE_AUTO  =32769;
+    static final int FOCUS_CONTINUOUS_AUTO  =32770;
+    static final int TIMER_OFF  =0;
+    static final int TIMER_1SEC  =1;
+    static final int TIMER_2SEC  =2;
+    static final int TIMER_5SEC  =3;
+    static final int TIMER_10SEC  =4;
+    static final int FILM_SIMULATION_PROVIA  =1;
+    static final int FILM_SIMULATION_VELVIA  =2;
+    static final int FILM_SIMULATION_ASTIA  =3;
+    static final int FILM_SIMULATION_MONOCHROME  =4;
+    static final int FILM_SIMULATION_SEPIA  =5;
+    static final int FILM_SIMULATION_PRO_NEG_HI  =6;
+    static final int FILM_SIMULATION_PRO_NEG_STD  =7;
+    static final int FILM_SIMULATION_MONOCHROME_Y_FILTER  =8;
+    static final int FILM_SIMULATION_MONOCHROME_R_FILTER  =9;
+    static final int FILM_SIMULATION_MONOCHROME_G_FILTER  =10;
+    static final int FILM_SIMULATION_CLASSIC_CHROME  =11;
+    static final int FILM_SIMULATION_ACROS  =12;
+    static final int FILM_SIMULATION_ACROS_Y  =13;
+    static final int FILM_SIMULATION_ACROS_R  =14;
+    static final int FILM_SIMULATION_ACROS_G  =15;
+    static final int FILM_SIMULATION_ETERNA  =16;
+    static final int WHITE_BALANCE_AUTO  =2;
+    static final int WHITE_BALANCE_FINE  =4;
+    static final int WHITE_BALANCE_INCANDESCENT  =6;
+    static final int WHITE_BALANCE_FLUORESCENT_1  =0X8001;
+    static final int WHITE_BALANCE_FLUORESCENT_2  =0X8002;
+    static final int WHITE_BALANCE_FLUORESCENT_3  =0X8003;
+    static final int WHITE_BALANCE_SHADE  =0X8006;
+    static final int WHITE_BALANCE_UNDERWATER  =0X800a;
+    static final int WHITE_BALANCE_TEMPERATURE  =0X800b;
+    static final int WHITE_BALANCE_CUSTOM  =0X800c;
+    static final int MOVIE_BUTTON_UNAVAILABLE  =0;
+    static final int MOVIE_BUTTON_AVAILABLE  =1;
+    static final int SHOOTING_MANUAL  =1;
+    static final int SHOOTING_PROGRAM  =2;
+    static final int SHOOTING_APERTURE_PRIORITY  =3;
+    static final int SHOOTING_SHUTTER_PRIORITY  =4;
+    static final int SHOOTING_AUTO  =6;
+    static final int BATTERY_CRITICAL  =1;
+    static final int BATTERY_ONE_BAR  =2;
+    static final int BATTERY_TWO_BAR  =3;
+    static final int BATTERY_FULL  =4;
+    static final int BATTERY_126S_CRITICAL  =6;
+    static final int BATTERY_126S_ONE_BAR  =7;
+    static final int BATTERY_126S_TWO_BAR  =8;
+    static final int BATTERY_126S_THREE_BAR  =9;
+    static final int BATTERY_126S_FOUR_BAR  =10;
+    static final int BATTERY_126S_FULL  =11;
+    static final int FLASH_AUTO  =1;
+    static final int FLASH_OFF  =2;
+    static final int FLASH_FILL  =3;
+    static final int FLASH_REDEYE_AUTO  =4;
+    static final int FLASH_REDEYE_FILL  =5;
+    static final int FLASH_EXTERNAL_SYNC  =6;
+    static final int FLASH_ON  =32769;
+    static final int FLASH_REDEYE  =32770;
+    static final int FLASH_REDEYE_ON  =32771;
+    static final int FLASH_REDEYE_SYNC  =32772;
+    static final int FLASH_REDEYE_REAR  =32773;
+    static final int FLASH_SLOW_SYNC  =32774;
+    static final int FLASH_REAR_SYNC  =32775;
+    static final int FLASH_COMMANDER  =32776;
+    static final int FLASH_DISABLE  =32777;
+    static final int FLASH_ENABLE  =32778;
+    static final int F_SS_CTRL_BOTH  =0;
+    static final int F_SS_CTRL_F  =1;
+    static final int F_SS_CTRL_SS  =2;
+    static final int F_SS_CTRL_NONE  =3;
+    static final int FOCUS_LOCK_OFF  =0;
+    static final int FOCUS_LOCK_ON  =1;
+    static final int DEVICE_ERROR_NONE =0;
+
+}
diff --git a/app/src/main/java/net/osdn/gokigen/cameratest/pages/SectionsPagerAdapter.java b/app/src/main/java/net/osdn/gokigen/cameratest/pages/SectionsPagerAdapter.java
new file mode 100644 (file)
index 0000000..ec0b71d
--- /dev/null
@@ -0,0 +1,36 @@
+package net.osdn.gokigen.cameratest.pages;
+
+import net.osdn.gokigen.cameratest.camtest.CamTest;
+
+import androidx.fragment.app.Fragment;
+import androidx.fragment.app.FragmentManager;
+import androidx.fragment.app.FragmentPagerAdapter;
+
+/**
+ * A {@link FragmentPagerAdapter} that returns a fragment corresponding to
+ * one of the sections/tabs/pages.
+ */
+public class SectionsPagerAdapter extends FragmentPagerAdapter
+{
+    private final CamTest testTarget;
+    public SectionsPagerAdapter(FragmentManager fm, CamTest testTarget)
+    {
+        super(fm);
+        this.testTarget = testTarget;
+    }
+
+    @Override
+    public Fragment getItem(int position)
+    {
+        // getItem is called to instantiate the fragment for the given page.
+        // Return a TestViewFragment (defined as a static inner class below).
+        return TestViewFragment.newInstance((position + 1), testTarget);
+    }
+
+    @Override
+    public int getCount()
+    {
+        // Show only one page.
+        return 1;
+    }
+}
diff --git a/app/src/main/java/net/osdn/gokigen/cameratest/pages/TestViewFragment.java b/app/src/main/java/net/osdn/gokigen/cameratest/pages/TestViewFragment.java
new file mode 100644 (file)
index 0000000..4983668
--- /dev/null
@@ -0,0 +1,72 @@
+package net.osdn.gokigen.cameratest.pages;
+
+import android.os.Bundle;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.Button;
+import android.widget.TextView;
+
+import net.osdn.gokigen.cameratest.R;
+import net.osdn.gokigen.cameratest.camtest.CamTest;
+
+import androidx.annotation.NonNull;
+import androidx.fragment.app.Fragment;
+
+/**
+ * A placeholder fragment containing a simple view.
+ */
+public class TestViewFragment extends Fragment
+{
+    /**
+     * The fragment argument representing the section number for this
+     * fragment.
+     */
+    private static final String ARG_SECTION_NUMBER = "section_number";
+
+    private CamTest testTarget;
+    public TestViewFragment()
+    {
+        super();
+    }
+
+    /**
+     * Returns a new instance of this fragment for the given section
+     * number.
+     */
+    static TestViewFragment newInstance(int sectionNumber, CamTest testTarget)
+    {
+        TestViewFragment fragment = new TestViewFragment();
+        Bundle args = new Bundle();
+        args.putInt(ARG_SECTION_NUMBER, sectionNumber);
+        fragment.testTarget = testTarget;
+        fragment.setArguments(args);
+        return (fragment);
+    }
+
+    @Override
+    public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
+    {
+        View rootView = inflater.inflate(R.layout.fragment_main, container, false);
+        TextView textView = rootView.findViewById(R.id.section_label);
+        textView.setText(getString(R.string.section_format, getArguments().getInt(ARG_SECTION_NUMBER)));
+
+        try
+        {
+            if (testTarget != null)
+            {
+                Button btn1 = rootView.findViewById(R.id.button1);
+                Button btn2 = rootView.findViewById(R.id.button2);
+                Button btn3 = rootView.findViewById(R.id.button3);
+                btn1.setOnClickListener(testTarget);
+                btn2.setOnClickListener(testTarget);
+                btn3.setOnClickListener(testTarget);
+            }
+        }
+        catch (Exception e)
+        {
+            e.printStackTrace();
+        }
+        return (rootView);
+    }
+}
diff --git a/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/app/src/main/res/drawable-v24/ic_launcher_foreground.xml
new file mode 100644 (file)
index 0000000..1f6bb29
--- /dev/null
@@ -0,0 +1,34 @@
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:aapt="http://schemas.android.com/aapt"
+    android:width="108dp"
+    android:height="108dp"
+    android:viewportWidth="108"
+    android:viewportHeight="108">
+    <path
+        android:fillType="evenOdd"
+        android:pathData="M32,64C32,64 38.39,52.99 44.13,50.95C51.37,48.37 70.14,49.57 70.14,49.57L108.26,87.69L108,109.01L75.97,107.97L32,64Z"
+        android:strokeWidth="1"
+        android:strokeColor="#00000000">
+        <aapt:attr name="android:fillColor">
+            <gradient
+                android:endX="78.5885"
+                android:endY="90.9159"
+                android:startX="48.7653"
+                android:startY="61.0927"
+                android:type="linear">
+                <item
+                    android:color="#44000000"
+                    android:offset="0.0" />
+                <item
+                    android:color="#00000000"
+                    android:offset="1.0" />
+            </gradient>
+        </aapt:attr>
+    </path>
+    <path
+        android:fillColor="#FFFFFF"
+        android:fillType="nonZero"
+        android:pathData="M66.94,46.02L66.94,46.02C72.44,50.07 76,56.61 76,64L32,64C32,56.61 35.56,50.11 40.98,46.06L36.18,41.19C35.45,40.45 35.45,39.3 36.18,38.56C36.91,37.81 38.05,37.81 38.78,38.56L44.25,44.05C47.18,42.57 50.48,41.71 54,41.71C57.48,41.71 60.78,42.57 63.68,44.05L69.11,38.56C69.84,37.81 70.98,37.81 71.71,38.56C72.44,39.3 72.44,40.45 71.71,41.19L66.94,46.02ZM62.94,56.92C64.08,56.92 65,56.01 65,54.88C65,53.76 64.08,52.85 62.94,52.85C61.8,52.85 60.88,53.76 60.88,54.88C60.88,56.01 61.8,56.92 62.94,56.92ZM45.06,56.92C46.2,56.92 47.13,56.01 47.13,54.88C47.13,53.76 46.2,52.85 45.06,52.85C43.92,52.85 43,53.76 43,54.88C43,56.01 43.92,56.92 45.06,56.92Z"
+        android:strokeWidth="1"
+        android:strokeColor="#00000000" />
+</vector>
diff --git a/app/src/main/res/drawable/aoi.jpg b/app/src/main/res/drawable/aoi.jpg
new file mode 100644 (file)
index 0000000..b5b81f0
Binary files /dev/null and b/app/src/main/res/drawable/aoi.jpg differ
diff --git a/app/src/main/res/drawable/cameratest.jpg b/app/src/main/res/drawable/cameratest.jpg
new file mode 100644 (file)
index 0000000..fa5c365
Binary files /dev/null and b/app/src/main/res/drawable/cameratest.jpg differ
diff --git a/app/src/main/res/drawable/ic_cloud_queue_black_24dp.xml b/app/src/main/res/drawable/ic_cloud_queue_black_24dp.xml
new file mode 100644 (file)
index 0000000..0ca5119
--- /dev/null
@@ -0,0 +1,9 @@
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+        android:width="24dp"
+        android:height="24dp"
+        android:viewportWidth="24.0"
+        android:viewportHeight="24.0">
+    <path
+        android:fillColor="#FF000000"
+        android:pathData="M19.35,10.04C18.67,6.59 15.64,4 12,4 9.11,4 6.6,5.64 5.35,8.04 2.34,8.36 0,10.91 0,14c0,3.31 2.69,6 6,6h13c2.76,0 5,-2.24 5,-5 0,-2.64 -2.05,-4.78 -4.65,-4.96zM19,18H6c-2.21,0 -4,-1.79 -4,-4s1.79,-4 4,-4h0.71C7.37,7.69 9.48,6 12,6c3.04,0 5.5,2.46 5.5,5.5v0.5H19c1.66,0 3,1.34 3,3s-1.34,3 -3,3z"/>
+</vector>
diff --git a/app/src/main/res/drawable/ic_launcher_background.xml b/app/src/main/res/drawable/ic_launcher_background.xml
new file mode 100644 (file)
index 0000000..0d025f9
--- /dev/null
@@ -0,0 +1,170 @@
+<?xml version="1.0" encoding="utf-8"?>
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+    android:width="108dp"
+    android:height="108dp"
+    android:viewportWidth="108"
+    android:viewportHeight="108">
+    <path
+        android:fillColor="#008577"
+        android:pathData="M0,0h108v108h-108z" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M9,0L9,108"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M19,0L19,108"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M29,0L29,108"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M39,0L39,108"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M49,0L49,108"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M59,0L59,108"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M69,0L69,108"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M79,0L79,108"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M89,0L89,108"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M99,0L99,108"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M0,9L108,9"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M0,19L108,19"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M0,29L108,29"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M0,39L108,39"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M0,49L108,49"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M0,59L108,59"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M0,69L108,69"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M0,79L108,79"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M0,89L108,89"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M0,99L108,99"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M19,29L89,29"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M19,39L89,39"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M19,49L89,49"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M19,59L89,59"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M19,69L89,69"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M19,79L89,79"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M29,19L29,89"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M39,19L39,89"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M49,19L49,89"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M59,19L59,89"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M69,19L69,89"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+    <path
+        android:fillColor="#00000000"
+        android:pathData="M79,19L79,89"
+        android:strokeWidth="0.8"
+        android:strokeColor="#33FFFFFF" />
+</vector>
diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml
new file mode 100644 (file)
index 0000000..70e351c
--- /dev/null
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="utf-8"?>
+<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:id="@+id/main_content"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:fitsSystemWindows="true"
+    tools:context=".MainActivity">
+
+    <com.google.android.material.appbar.AppBarLayout
+        android:id="@+id/appbar"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:paddingTop="@dimen/appbar_padding_top"
+        android:theme="@style/AppTheme.AppBarOverlay">
+
+        <androidx.appcompat.widget.Toolbar
+            android:id="@+id/toolbar"
+            android:layout_width="match_parent"
+            android:layout_height="?attr/actionBarSize"
+            android:layout_weight="1"
+            android:background="?attr/colorPrimary"
+            app:layout_scrollFlags="scroll|enterAlways"
+            app:popupTheme="@style/AppTheme.PopupOverlay"
+            app:title="@string/app_name">
+
+        </androidx.appcompat.widget.Toolbar>
+
+    </com.google.android.material.appbar.AppBarLayout>
+
+    <androidx.viewpager.widget.ViewPager
+        android:id="@+id/container"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        app:layout_behavior="@string/appbar_scrolling_view_behavior" />
+
+    <com.google.android.material.floatingactionbutton.FloatingActionButton
+        android:id="@+id/fab"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_gravity="end|bottom"
+        android:layout_margin="@dimen/fab_margin"
+        android:src="@drawable/ic_cloud_queue_black_24dp" />
+
+</androidx.coordinatorlayout.widget.CoordinatorLayout>
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_main.xml b/app/src/main/res/layout/fragment_main.xml
new file mode 100644 (file)
index 0000000..73e7faf
--- /dev/null
@@ -0,0 +1,103 @@
+<?xml version="1.0" encoding="utf-8"?>
+<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:id="@+id/constraintLayout"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    tools:context=".MainActivity">
+
+    <TextView
+        android:id="@+id/section_label"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginStart="@dimen/activity_horizontal_margin"
+        android:layout_marginTop="@dimen/activity_vertical_margin"
+        android:layout_marginEnd="@dimen/activity_horizontal_margin"
+        android:layout_marginBottom="@dimen/activity_vertical_margin"
+        app:layout_constraintLeft_toLeftOf="parent"
+        app:layout_constraintTop_toTopOf="@id/constraintLayout"
+        tools:layout_constraintLeft_creator="1"
+        tools:layout_constraintTop_creator="1" />
+
+    <TextView
+        android:id="@+id/show_information"
+        android:layout_width="wrap_content"
+        android:layout_height="22dp"
+        android:layout_marginStart="8dp"
+        android:layout_marginLeft="8dp"
+        android:layout_marginTop="8dp"
+        android:layout_marginEnd="8dp"
+        android:layout_marginRight="8dp"
+        android:text="@string/blank"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toBottomOf="@id/section_label" />
+
+    <Button
+        android:id="@+id/button1"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginStart="8dp"
+        android:layout_marginLeft="8dp"
+        android:layout_marginBottom="60dp"
+        android:text="@string/label_button1"
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintStart_toStartOf="parent" />
+
+    <Button
+        android:id="@+id/button2"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginStart="8dp"
+        android:layout_marginLeft="8dp"
+        android:layout_marginBottom="8dp"
+        android:text="@string/label_button2"
+        app:layout_constraintBottom_toTopOf="@id/button1"
+        app:layout_constraintStart_toStartOf="parent" />
+
+    <Button
+        android:id="@+id/button3"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginStart="8dp"
+        android:layout_marginLeft="8dp"
+        android:layout_marginBottom="8dp"
+        android:text="@string/label_button3"
+        app:layout_constraintBottom_toTopOf="@id/button2"
+        app:layout_constraintStart_toStartOf="parent" />
+
+    <ImageView
+        android:id="@+id/imageView"
+        android:layout_width="wrap_content"
+        android:layout_height="440dp"
+        android:layout_marginTop="2dp"
+        android:contentDescription="@string/blank"
+        android:scaleType="fitCenter"
+        android:src="@drawable/cameratest"
+        android:visibility="visible"
+        app:layout_constraintBottom_toTopOf="@id/button3"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toBottomOf="@id/show_information" />
+
+    <ImageView
+        android:id="@+id/information-view"
+        android:layout_width="300dp"
+        android:layout_height="150dp"
+        android:layout_marginStart="2dp"
+        android:layout_marginLeft="2dp"
+        android:layout_marginEnd="2dp"
+        android:layout_marginRight="2dp"
+        android:layout_marginBottom="2dp"
+        android:contentDescription="@string/blank"
+        android:scaleType="fitCenter"
+        android:src="@drawable/aoi"
+        android:visibility="visible"
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintStart_toEndOf="@+id/button2"
+        app:layout_constraintTop_toBottomOf="@+id/imageView"
+        app:layout_constraintVertical_bias="0.0" />
+
+</androidx.constraintlayout.widget.ConstraintLayout>
diff --git a/app/src/main/res/menu/menu_main.xml b/app/src/main/res/menu/menu_main.xml
new file mode 100644 (file)
index 0000000..7947add
--- /dev/null
@@ -0,0 +1,15 @@
+<menu xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    xmlns:tools="http://schemas.android.com/tools"
+    tools:context="net.osdn.gokigen.cameratest.MainActivity">
+    <item
+    android:id="@+id/action_settings"
+    android:orderInCategory="100"
+    android:title="@string/action_settings"
+    app:showAsAction="never" />
+    <item
+        android:id="@+id/action_wifi_settings"
+        android:orderInCategory="100"
+        android:title="@string/action_wifi_settings"
+        app:showAsAction="never" />
+</menu>
diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
new file mode 100644 (file)
index 0000000..eca70cf
--- /dev/null
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
+    <background android:drawable="@drawable/ic_launcher_background" />
+    <foreground android:drawable="@drawable/ic_launcher_foreground" />
+</adaptive-icon>
\ No newline at end of file
diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
new file mode 100644 (file)
index 0000000..eca70cf
--- /dev/null
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
+    <background android:drawable="@drawable/ic_launcher_background" />
+    <foreground android:drawable="@drawable/ic_launcher_foreground" />
+</adaptive-icon>
\ No newline at end of file
diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher.png b/app/src/main/res/mipmap-hdpi/ic_launcher.png
new file mode 100644 (file)
index 0000000..898f3ed
Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/ic_launcher.png differ
diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher_round.png b/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
new file mode 100644 (file)
index 0000000..dffca36
Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/ic_launcher_round.png differ
diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher.png b/app/src/main/res/mipmap-mdpi/ic_launcher.png
new file mode 100644 (file)
index 0000000..64ba76f
Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/ic_launcher.png differ
diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher_round.png b/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
new file mode 100644 (file)
index 0000000..dae5e08
Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/ic_launcher_round.png differ
diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/app/src/main/res/mipmap-xhdpi/ic_launcher.png
new file mode 100644 (file)
index 0000000..e5ed465
Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ
diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
new file mode 100644 (file)
index 0000000..14ed0af
Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png differ
diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
new file mode 100644 (file)
index 0000000..b0907ca
Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ
diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
new file mode 100644 (file)
index 0000000..d8ae031
Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png differ
diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
new file mode 100644 (file)
index 0000000..2c18de9
Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ
diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
new file mode 100644 (file)
index 0000000..beed3cd
Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png differ
diff --git a/app/src/main/res/values-w820dp/dimens.xml b/app/src/main/res/values-w820dp/dimens.xml
new file mode 100644 (file)
index 0000000..63fc816
--- /dev/null
@@ -0,0 +1,6 @@
+<resources>
+    <!-- Example customization of dimensions originally defined in res/values/dimens.xml
+         (such as screen margins) for screens with more than 820dp of available width. This
+         would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively). -->
+    <dimen name="activity_horizontal_margin">64dp</dimen>
+</resources>
diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml
new file mode 100644 (file)
index 0000000..69b2233
--- /dev/null
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+    <color name="colorPrimary">#008577</color>
+    <color name="colorPrimaryDark">#00574B</color>
+    <color name="colorAccent">#D81B60</color>
+</resources>
diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml
new file mode 100644 (file)
index 0000000..cef3abc
--- /dev/null
@@ -0,0 +1,7 @@
+<resources>
+    <!-- Default screen margins, per the Android Design guidelines. -->
+    <dimen name="activity_horizontal_margin">16dp</dimen>
+    <dimen name="activity_vertical_margin">16dp</dimen>
+    <dimen name="fab_margin">16dp</dimen>
+    <dimen name="appbar_padding_top">8dp</dimen>
+</resources>
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
new file mode 100644 (file)
index 0000000..b551028
--- /dev/null
@@ -0,0 +1,13 @@
+<resources>
+    <string name="app_name">CameraTest</string>
+    <string name="blank"> </string>
+    <string name="action_settings">Settings</string>
+    <string name="action_wifi_settings">WiFi Settings</string>
+    <string name="section_format">Hello World from section: %1$d</string>
+    <string name="connect">Try connect</string>
+    <string name="label_button1">1</string>
+    <string name="label_button2">2</string>
+    <string name="label_button3">3</string>
+    <string name="label_button4">4</string>
+    <string name="label_button5">5</string>
+</resources>
diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml
new file mode 100644 (file)
index 0000000..545b9c6
--- /dev/null
@@ -0,0 +1,20 @@
+<resources>
+
+    <!-- Base application theme. -->
+    <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
+        <!-- Customize your theme here. -->
+        <item name="colorPrimary">@color/colorPrimary</item>
+        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
+        <item name="colorAccent">@color/colorAccent</item>
+    </style>
+
+    <style name="AppTheme.NoActionBar">
+        <item name="windowActionBar">false</item>
+        <item name="windowNoTitle">true</item>
+    </style>
+
+    <style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
+
+    <style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
+
+</resources>
diff --git a/build.gradle b/build.gradle
new file mode 100644 (file)
index 0000000..e11a5b3
--- /dev/null
@@ -0,0 +1,27 @@
+// Top-level build file where you can add configuration options common to all sub-projects/modules.
+
+buildscript {
+    repositories {
+        google()
+        jcenter()
+        
+    }
+    dependencies {
+        classpath 'com.android.tools.build:gradle:3.3.2'
+        
+        // NOTE: Do not place your application dependencies here; they belong
+        // in the individual module build.gradle files
+    }
+}
+
+allprojects {
+    repositories {
+        google()
+        jcenter()
+        
+    }
+}
+
+task clean(type: Delete) {
+    delete rootProject.buildDir
+}
diff --git a/gradle.properties b/gradle.properties
new file mode 100644 (file)
index 0000000..199d16e
--- /dev/null
@@ -0,0 +1,20 @@
+# Project-wide Gradle settings.
+# IDE (e.g. Android Studio) users:
+# Gradle settings configured through the IDE *will override*
+# any settings specified in this file.
+# For more details on how to configure your build environment visit
+# http://www.gradle.org/docs/current/userguide/build_environment.html
+# Specifies the JVM arguments used for the daemon process.
+# The setting is particularly useful for tweaking memory settings.
+org.gradle.jvmargs=-Xmx1536m
+# When configured, Gradle will run in incubating parallel mode.
+# This option should only be used with decoupled projects. More details, visit
+# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
+# org.gradle.parallel=true
+# AndroidX package structure to make it clearer which packages are bundled with the
+# Android operating system, and which are packaged with your app's APK
+# https://developer.android.com/topic/libraries/support-library/androidx-rn
+android.useAndroidX=true
+# Automatically convert third-party libraries to use AndroidX
+android.enableJetifier=true
+
diff --git a/gradlew b/gradlew
new file mode 100644 (file)
index 0000000..cccdd3d
--- /dev/null
+++ b/gradlew
@@ -0,0 +1,172 @@
+#!/usr/bin/env sh
+
+##############################################################################
+##
+##  Gradle start up script for UN*X
+##
+##############################################################################
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+    ls=`ls -ld "$PRG"`
+    link=`expr "$ls" : '.*-> \(.*\)$'`
+    if expr "$link" : '/.*' > /dev/null; then
+        PRG="$link"
+    else
+        PRG=`dirname "$PRG"`"/$link"
+    fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn () {
+    echo "$*"
+}
+
+die () {
+    echo
+    echo "$*"
+    echo
+    exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+nonstop=false
+case "`uname`" in
+  CYGWIN* )
+    cygwin=true
+    ;;
+  Darwin* )
+    darwin=true
+    ;;
+  MINGW* )
+    msys=true
+    ;;
+  NONSTOP* )
+    nonstop=true
+    ;;
+esac
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+    if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+        # IBM's JDK on AIX uses strange locations for the executables
+        JAVACMD="$JAVA_HOME/jre/sh/java"
+    else
+        JAVACMD="$JAVA_HOME/bin/java"
+    fi
+    if [ ! -x "$JAVACMD" ] ; then
+        die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+    fi
+else
+    JAVACMD="java"
+    which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
+    MAX_FD_LIMIT=`ulimit -H -n`
+    if [ $? -eq 0 ] ; then
+        if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+            MAX_FD="$MAX_FD_LIMIT"
+        fi
+        ulimit -n $MAX_FD
+        if [ $? -ne 0 ] ; then
+            warn "Could not set maximum file descriptor limit: $MAX_FD"
+        fi
+    else
+        warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+    fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+    GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin ; then
+    APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+    CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+    JAVACMD=`cygpath --unix "$JAVACMD"`
+
+    # We build the pattern for arguments to be converted via cygpath
+    ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+    SEP=""
+    for dir in $ROOTDIRSRAW ; do
+        ROOTDIRS="$ROOTDIRS$SEP$dir"
+        SEP="|"
+    done
+    OURCYGPATTERN="(^($ROOTDIRS))"
+    # Add a user-defined pattern to the cygpath arguments
+    if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+        OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+    fi
+    # Now convert the arguments - kludge to limit ourselves to /bin/sh
+    i=0
+    for arg in "$@" ; do
+        CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+        CHECK2=`echo "$arg"|egrep -c "^-"`                                 ### Determine if an option
+
+        if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then                    ### Added a condition
+            eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+        else
+            eval `echo args$i`="\"$arg\""
+        fi
+        i=$((i+1))
+    done
+    case $i in
+        (0) set -- ;;
+        (1) set -- "$args0" ;;
+        (2) set -- "$args0" "$args1" ;;
+        (3) set -- "$args0" "$args1" "$args2" ;;
+        (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+        (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+        (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+        (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+        (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+        (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+    esac
+fi
+
+# Escape application args
+save () {
+    for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
+    echo " "
+}
+APP_ARGS=$(save "$@")
+
+# Collect all arguments for the java command, following the shell quoting and substitution rules
+eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
+
+# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
+if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
+  cd "$(dirname "$0")"
+fi
+
+exec "$JAVACMD" "$@"
diff --git a/gradlew.bat b/gradlew.bat
new file mode 100644 (file)
index 0000000..f955316
--- /dev/null
@@ -0,0 +1,84 @@
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem  Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS=
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windows variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if  not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/settings.gradle b/settings.gradle
new file mode 100644 (file)
index 0000000..e7b4def
--- /dev/null
@@ -0,0 +1 @@
+include ':app'