diff --git a/ProyectoAndroid/ChessTrack/AndroidManifest.xml b/ProyectoAndroid/ChessTrack/AndroidManifest.xml index c9b12a57560385e229ed4d238e768692bc40ebdc..ec4ede675a0383c7122aaaf4a7ddd40d99822091 100644 --- a/ProyectoAndroid/ChessTrack/AndroidManifest.xml +++ b/ProyectoAndroid/ChessTrack/AndroidManifest.xml @@ -3,15 +3,51 @@ android:versionCode="1" android:versionName="1.0" > - <uses-sdk - android:minSdkVersion="9" - android:targetSdkVersion="10" /> + +<!-- <application --> +<!-- android:allowBackup="true" --> +<!-- android:icon="@drawable/ic_launcher" --> +<!-- android:label="@string/app_name" --> +<!-- android:theme="@style/AppTheme" > --> +<!-- </application> --> + + + <application - android:allowBackup="true" - android:icon="@drawable/ic_launcher" + android:allowBackup="true" android:label="@string/app_name" - android:theme="@style/AppTheme" > + android:icon="@drawable/ic_launcher" + android:theme="@android:style/Theme.NoTitleBar.Fullscreen" > + + <activity android:name="ChessTrackActivity" + android:label="@string/app_name" + android:screenOrientation="landscape" + android:configChanges="keyboardHidden|orientation"> + <intent-filter> + <action android:name="android.intent.action.MAIN" /> + <category android:name="android.intent.category.LAUNCHER" /> + </intent-filter> + </activity> </application> + + + <supports-screens android:resizeable="true" + android:smallScreens="true" + android:normalScreens="true" + android:largeScreens="true" + android:anyDensity="true" /> + + + <uses-sdk + android:minSdkVersion="9" + android:targetSdkVersion="10" /> + + <uses-permission android:name="android.permission.CAMERA"/> + + <uses-feature android:name="android.hardware.camera" android:required="false"/> + <uses-feature android:name="android.hardware.camera.autofocus" android:required="false"/> + <uses-feature android:name="android.hardware.camera.front" android:required="false"/> + <uses-feature android:name="android.hardware.camera.front.autofocus" android:required="false"/> </manifest> diff --git a/ProyectoAndroid/ChessTrack/bin/AndroidManifest.xml b/ProyectoAndroid/ChessTrack/bin/AndroidManifest.xml index c9b12a57560385e229ed4d238e768692bc40ebdc..ec4ede675a0383c7122aaaf4a7ddd40d99822091 100644 --- a/ProyectoAndroid/ChessTrack/bin/AndroidManifest.xml +++ b/ProyectoAndroid/ChessTrack/bin/AndroidManifest.xml @@ -3,15 +3,51 @@ android:versionCode="1" android:versionName="1.0" > - <uses-sdk - android:minSdkVersion="9" - android:targetSdkVersion="10" /> + +<!-- <application --> +<!-- android:allowBackup="true" --> +<!-- android:icon="@drawable/ic_launcher" --> +<!-- android:label="@string/app_name" --> +<!-- android:theme="@style/AppTheme" > --> +<!-- </application> --> + + + <application - android:allowBackup="true" - android:icon="@drawable/ic_launcher" + android:allowBackup="true" android:label="@string/app_name" - android:theme="@style/AppTheme" > + android:icon="@drawable/ic_launcher" + android:theme="@android:style/Theme.NoTitleBar.Fullscreen" > + + <activity android:name="ChessTrackActivity" + android:label="@string/app_name" + android:screenOrientation="landscape" + android:configChanges="keyboardHidden|orientation"> + <intent-filter> + <action android:name="android.intent.action.MAIN" /> + <category android:name="android.intent.category.LAUNCHER" /> + </intent-filter> + </activity> </application> + + + <supports-screens android:resizeable="true" + android:smallScreens="true" + android:normalScreens="true" + android:largeScreens="true" + android:anyDensity="true" /> + + + <uses-sdk + android:minSdkVersion="9" + android:targetSdkVersion="10" /> + + <uses-permission android:name="android.permission.CAMERA"/> + + <uses-feature android:name="android.hardware.camera" android:required="false"/> + <uses-feature android:name="android.hardware.camera.autofocus" android:required="false"/> + <uses-feature android:name="android.hardware.camera.front" android:required="false"/> + <uses-feature android:name="android.hardware.camera.front.autofocus" android:required="false"/> </manifest> diff --git a/ProyectoAndroid/ChessTrack/gen/uy/edu/fing/chesstrack/R.java b/ProyectoAndroid/ChessTrack/gen/uy/edu/fing/chesstrack/R.java index dc999cc3aa84b46691289c61ccd62cb944eff877..0a5c7c0f32c0c049cb7bd20bb2f5ff7b10b6ea3d 100644 --- a/ProyectoAndroid/ChessTrack/gen/uy/edu/fing/chesstrack/R.java +++ b/ProyectoAndroid/ChessTrack/gen/uy/edu/fing/chesstrack/R.java @@ -9,12 +9,49 @@ package uy.edu.fing.chesstrack; public final class R { public static final class attr { + /** <p>May be an integer value, such as "<code>100</code>". +<p>This may also be a reference to a resource (in the form +"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or +theme attribute (in the form +"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") +containing a value of this type. +<p>May be one of the following constant values.</p> +<table> +<colgroup align="left" /> +<colgroup align="left" /> +<colgroup align="left" /> +<tr><th>Constant</th><th>Value</th><th>Description</th></tr> +<tr><td><code>any</code></td><td>-1</td><td></td></tr> +<tr><td><code>back</code></td><td>99</td><td></td></tr> +<tr><td><code>front</code></td><td>98</td><td></td></tr> +</table> + */ + public static final int camera_id=0x7f010001; + /** <p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>". +<p>This may also be a reference to a resource (in the form +"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or +theme attribute (in the form +"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") +containing a value of this type. + */ + public static final int show_fps=0x7f010000; } public static final class drawable { public static final int ic_launcher=0x7f020000; } + public static final class id { + public static final int any=0x7f040000; + public static final int back=0x7f040001; + public static final int chess_track_layout=0x7f040003; + public static final int front=0x7f040002; + } + public static final class layout { + public static final int chess_track_layout=0x7f030000; + } public static final class string { - public static final int app_name=0x7f030000; + public static final int app_name=0x7f050000; + public static final int menu_start_new_game=0x7f050002; + public static final int menu_toggle_tile_numbers=0x7f050001; } public static final class style { /** @@ -27,10 +64,65 @@ public final class R { backward-compatibility can go here. */ - public static final int AppBaseTheme=0x7f040000; + public static final int AppBaseTheme=0x7f060000; /** Application theme. All customizations that are NOT specific to a particular API-level can go here. */ - public static final int AppTheme=0x7f040001; + public static final int AppTheme=0x7f060001; } + public static final class styleable { + /** Attributes that can be used with a CameraBridgeViewBase. + <p>Includes the following attributes:</p> + <table> + <colgroup align="left" /> + <colgroup align="left" /> + <tr><th>Attribute</th><th>Description</th></tr> + <tr><td><code>{@link #CameraBridgeViewBase_camera_id uy.edu.fing.chesstrack:camera_id}</code></td><td></td></tr> + <tr><td><code>{@link #CameraBridgeViewBase_show_fps uy.edu.fing.chesstrack:show_fps}</code></td><td></td></tr> + </table> + @see #CameraBridgeViewBase_camera_id + @see #CameraBridgeViewBase_show_fps + */ + public static final int[] CameraBridgeViewBase = { + 0x7f010000, 0x7f010001 + }; + /** + <p>This symbol is the offset where the {@link uy.edu.fing.chesstrack.R.attr#camera_id} + attribute's value can be found in the {@link #CameraBridgeViewBase} array. + + + <p>May be an integer value, such as "<code>100</code>". +<p>This may also be a reference to a resource (in the form +"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or +theme attribute (in the form +"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") +containing a value of this type. +<p>May be one of the following constant values.</p> +<table> +<colgroup align="left" /> +<colgroup align="left" /> +<colgroup align="left" /> +<tr><th>Constant</th><th>Value</th><th>Description</th></tr> +<tr><td><code>any</code></td><td>-1</td><td></td></tr> +<tr><td><code>back</code></td><td>99</td><td></td></tr> +<tr><td><code>front</code></td><td>98</td><td></td></tr> +</table> + @attr name uy.edu.fing.chesstrack:camera_id + */ + public static final int CameraBridgeViewBase_camera_id = 1; + /** + <p>This symbol is the offset where the {@link uy.edu.fing.chesstrack.R.attr#show_fps} + attribute's value can be found in the {@link #CameraBridgeViewBase} array. + + + <p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>". +<p>This may also be a reference to a resource (in the form +"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or +theme attribute (in the form +"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") +containing a value of this type. + @attr name uy.edu.fing.chesstrack:show_fps + */ + public static final int CameraBridgeViewBase_show_fps = 0; + }; } diff --git a/ProyectoAndroid/ChessTrack/lint.xml b/ProyectoAndroid/ChessTrack/lint.xml new file mode 100644 index 0000000000000000000000000000000000000000..ee0eead5bb7d90f91387b589a7940b0fcd1f16f5 --- /dev/null +++ b/ProyectoAndroid/ChessTrack/lint.xml @@ -0,0 +1,3 @@ +<?xml version="1.0" encoding="UTF-8"?> +<lint> +</lint> \ No newline at end of file diff --git a/ProyectoAndroid/ChessTrack/project.properties b/ProyectoAndroid/ChessTrack/project.properties index b7c2081d560fdc20da7de29311a09e6cfa7defb8..a04cd2483d682d4eb048c4ed131fa9f9ae3fb461 100644 --- a/ProyectoAndroid/ChessTrack/project.properties +++ b/ProyectoAndroid/ChessTrack/project.properties @@ -12,3 +12,5 @@ # Project target. target=android-10 +android.library=false +android.library.reference.1=../../../../Android/OpenCV4Android/OpenCV-2.4.9-android-sdk/sdk/java diff --git a/ProyectoAndroid/ChessTrack/res/layout/chess_track_layout b/ProyectoAndroid/ChessTrack/res/layout/chess_track_layout new file mode 100644 index 0000000000000000000000000000000000000000..0567cc63053478a097f9794ee47225f1c71e06eb --- /dev/null +++ b/ProyectoAndroid/ChessTrack/res/layout/chess_track_layout @@ -0,0 +1,15 @@ +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools" + xmlns:opencv="http://schemas.android.com/apk/res-auto" + android:layout_width="match_parent" + android:layout_height="match_parent" > + + <org.opencv.android.JavaCameraView + android:layout_width="fill_parent" + android:layout_height="fill_parent" + android:visibility="gone" + android:id="@+id/chess_track_layout" + opencv:show_fps="true" + opencv:camera_id="any" /> + +</LinearLayout> \ No newline at end of file diff --git a/ProyectoAndroid/ChessTrack/res/values/strings.xml b/ProyectoAndroid/ChessTrack/res/values/strings.xml index 7ecd48b3b4bde6bc2b1140cf23f26f8782ad036c..13afd37f377ecdcd6679059555546a47418d5208 100644 --- a/ProyectoAndroid/ChessTrack/res/values/strings.xml +++ b/ProyectoAndroid/ChessTrack/res/values/strings.xml @@ -1,5 +1,5 @@ <resources> - <string name="app_name">ChessTrack</string> - + <string name="menu_toggle_tile_numbers">Show/hide tile numbers</string> + <string name="menu_start_new_game">Start new game</string> </resources> diff --git a/ProyectoAndroid/ChessTrack/src/uy/edu/fing/chesstrack/ChessTrackActivity.java b/ProyectoAndroid/ChessTrack/src/uy/edu/fing/chesstrack/ChessTrackActivity.java new file mode 100644 index 0000000000000000000000000000000000000000..e2ad12e51c1f8badd6b3e19f8d936637ab1b4f3f --- /dev/null +++ b/ProyectoAndroid/ChessTrack/src/uy/edu/fing/chesstrack/ChessTrackActivity.java @@ -0,0 +1,95 @@ +package uy.edu.fing.chesstrack; + + +import org.opencv.android.BaseLoaderCallback; +import org.opencv.android.CameraBridgeViewBase; +import org.opencv.android.CameraBridgeViewBase.CvCameraViewFrame; +import org.opencv.android.CameraBridgeViewBase.CvCameraViewListener; +import org.opencv.android.LoaderCallbackInterface; +import org.opencv.android.OpenCVLoader; +import org.opencv.core.Mat; + +import android.app.Activity; +import android.os.Bundle; +import android.util.Log; +import android.view.SurfaceView; +import android.view.WindowManager; + +public class ChessTrackActivity extends Activity implements CvCameraViewListener { + + private static final String TAG = "CHESSTRACK::Activity"; + + private CameraBridgeViewBase mOpenCvCameraView; + + private final BaseLoaderCallback mLoaderCallback = new BaseLoaderCallback(this) { + @Override + public void onManagerConnected(int status) { + switch (status) { + case LoaderCallbackInterface.SUCCESS: + { + Log.i(TAG, "OpenCV loaded successfully"); + mOpenCvCameraView.enableView(); + } break; + default: + { + super.onManagerConnected(status); + } break; + } + } + }; + + + @Override + public void onResume() + { + super.onResume(); + OpenCVLoader.initAsync(OpenCVLoader.OPENCV_VERSION_2_4_9, this, mLoaderCallback); + } + + @Override + public void onCreate(Bundle savedInstanceState) { + Log.i(TAG, "called onCreate"); + super.onCreate(savedInstanceState); + getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); + setContentView(R.layout.chess_track_layout); + mOpenCvCameraView = (CameraBridgeViewBase) findViewById(R.id.chess_track_layout); + mOpenCvCameraView.setVisibility(SurfaceView.VISIBLE); + mOpenCvCameraView.setCvCameraViewListener(this); + } + + @Override + public void onPause() + { + super.onPause(); + if (mOpenCvCameraView != null) { + mOpenCvCameraView.disableView(); + } + } + + @Override + public void onDestroy() { + super.onDestroy(); + if (mOpenCvCameraView != null) { + mOpenCvCameraView.disableView(); + } + } + + @Override + public void onCameraViewStarted(int width, int height) { + } + + @Override + public void onCameraViewStopped() { + } + + public Mat onCameraFrame(CvCameraViewFrame inputFrame) { + return inputFrame.rgba(); + } + + @Override + public Mat onCameraFrame(Mat inputFrame) { + // TODO Auto-generated method stub + return null; + } + +} diff --git a/ProyectoAndroid/ChessTrack/src/uy/edu/fing/chesstrack/modulovision/Adquisicion.java b/ProyectoAndroid/ChessTrack/src/uy/edu/fing/chesstrack/modulovision/Adquisicion.java new file mode 100644 index 0000000000000000000000000000000000000000..4a6fee200f58c87212c33a69125b46ebb25b86e5 --- /dev/null +++ b/ProyectoAndroid/ChessTrack/src/uy/edu/fing/chesstrack/modulovision/Adquisicion.java @@ -0,0 +1,6 @@ +package uy.edu.fing.chesstrack.modulovision; + + +public class Adquisicion { + +}