--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="src" path="gen"/>
+ <classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
+ <classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
+ <classpathentry kind="output" path="bin/classes"/>
+</classpath>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>ECC_evenodd</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>com.android.ide.eclipse.adt.ApkBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>com.android.ide.eclipse.adt.AndroidNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
--- /dev/null
+eclipse.preferences.version=1
+encoding/<project>=UTF-8
+separateDerivedEncodings=true
--- /dev/null
+#Sun Jun 17 03:23:20 JST 2012
+eclipse.preferences.version=1
+line.separator=\n
--- /dev/null
+eclipse.preferences.version=1
+org.eclipse.jdt.core.codeComplete.argumentPrefixes=
+org.eclipse.jdt.core.codeComplete.argumentSuffixes=
+org.eclipse.jdt.core.codeComplete.fieldPrefixes=
+org.eclipse.jdt.core.codeComplete.fieldSuffixes=
+org.eclipse.jdt.core.codeComplete.localPrefixes=
+org.eclipse.jdt.core.codeComplete.localSuffixes=
+org.eclipse.jdt.core.codeComplete.staticFieldPrefixes=
+org.eclipse.jdt.core.codeComplete.staticFieldSuffixes=
+org.eclipse.jdt.core.codeComplete.staticFinalFieldPrefixes=
+org.eclipse.jdt.core.codeComplete.staticFinalFieldSuffixes=
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
+org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_assignment=0
+org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
+org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
+org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
+org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
+org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80
+org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16
+org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_after_package=1
+org.eclipse.jdt.core.formatter.blank_lines_before_field=0
+org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
+org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
+org.eclipse.jdt.core.formatter.blank_lines_before_method=1
+org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
+org.eclipse.jdt.core.formatter.blank_lines_before_package=0
+org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
+org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
+org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
+org.eclipse.jdt.core.formatter.comment.format_block_comments=true
+org.eclipse.jdt.core.formatter.comment.format_header=false
+org.eclipse.jdt.core.formatter.comment.format_html=true
+org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
+org.eclipse.jdt.core.formatter.comment.format_line_comments=true
+org.eclipse.jdt.core.formatter.comment.format_source_code=true
+org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
+org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
+org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
+org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert
+org.eclipse.jdt.core.formatter.comment.line_length=80
+org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true
+org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true
+org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false
+org.eclipse.jdt.core.formatter.compact_else_if=true
+org.eclipse.jdt.core.formatter.continuation_indentation=2
+org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
+org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off
+org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on
+org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
+org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
+org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_empty_lines=false
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
+org.eclipse.jdt.core.formatter.indentation.size=4
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert
+org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
+org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.join_lines_in_comments=true
+org.eclipse.jdt.core.formatter.join_wrapped_lines=true
+org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.lineSplit=80
+org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
+org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
+org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
+org.eclipse.jdt.core.formatter.tabulation.char=tab
+org.eclipse.jdt.core.formatter.tabulation.size=4
+org.eclipse.jdt.core.formatter.use_on_off_tags=false
+org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
+org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true
+org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true
--- /dev/null
+eclipse.preferences.version=1
+editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
+formatter_profile=org.eclipse.jdt.ui.default.eclipse_profile
+formatter_settings_version=12
+org.eclipse.jdt.ui.exception.name=e
+org.eclipse.jdt.ui.gettersetter.use.is=true
+org.eclipse.jdt.ui.ignorelowercasenames=true
+org.eclipse.jdt.ui.importorder=java;javax;org;com;
+org.eclipse.jdt.ui.keywordthis=false
+org.eclipse.jdt.ui.ondemandthreshold=99
+org.eclipse.jdt.ui.overrideannotation=true
+org.eclipse.jdt.ui.staticondemandthreshold=99
+sp_cleanup.add_default_serial_version_id=true
+sp_cleanup.add_generated_serial_version_id=false
+sp_cleanup.add_missing_annotations=true
+sp_cleanup.add_missing_deprecated_annotations=true
+sp_cleanup.add_missing_methods=false
+sp_cleanup.add_missing_nls_tags=false
+sp_cleanup.add_missing_override_annotations=true
+sp_cleanup.add_missing_override_annotations_interface_methods=true
+sp_cleanup.add_serial_version_id=false
+sp_cleanup.always_use_blocks=true
+sp_cleanup.always_use_parentheses_in_expressions=false
+sp_cleanup.always_use_this_for_non_static_field_access=false
+sp_cleanup.always_use_this_for_non_static_method_access=false
+sp_cleanup.convert_to_enhanced_for_loop=false
+sp_cleanup.correct_indentation=false
+sp_cleanup.format_source_code=true
+sp_cleanup.format_source_code_changes_only=false
+sp_cleanup.make_local_variable_final=false
+sp_cleanup.make_parameters_final=false
+sp_cleanup.make_private_fields_final=true
+sp_cleanup.make_type_abstract_if_missing_method=false
+sp_cleanup.make_variable_declarations_final=true
+sp_cleanup.never_use_blocks=false
+sp_cleanup.never_use_parentheses_in_expressions=true
+sp_cleanup.on_save_use_additional_actions=false
+sp_cleanup.organize_imports=true
+sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
+sp_cleanup.remove_private_constructors=true
+sp_cleanup.remove_trailing_whitespaces=false
+sp_cleanup.remove_trailing_whitespaces_all=true
+sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
+sp_cleanup.remove_unnecessary_casts=true
+sp_cleanup.remove_unnecessary_nls_tags=false
+sp_cleanup.remove_unused_imports=false
+sp_cleanup.remove_unused_local_variables=false
+sp_cleanup.remove_unused_private_fields=true
+sp_cleanup.remove_unused_private_members=false
+sp_cleanup.remove_unused_private_methods=true
+sp_cleanup.remove_unused_private_types=true
+sp_cleanup.sort_members=false
+sp_cleanup.sort_members_all=false
+sp_cleanup.use_blocks=false
+sp_cleanup.use_blocks_only_for_return_and_throw=false
+sp_cleanup.use_parentheses_in_expressions=false
+sp_cleanup.use_this_for_non_static_field_access=false
+sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+sp_cleanup.use_this_for_non_static_method_access=false
+sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="jp.ac.titech.sharp4k.cuten"
+ android:versionCode="1"
+ android:versionName="1.0" >
+
+ <uses-sdk android:minSdkVersion="13" />
+
+ <application
+ android:icon="@drawable/ic_launcher"
+ android:label="@string/app_name" >
+ <activity
+ android:name=".ECCActivity"
+ android:label="@string/app_name"
+ android:configChanges="orientation|screenSize" >
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN" />
+
+ <category android:name="android.intent.category.LAUNCHER" />
+ </intent-filter>
+ </activity>
+ </application>
+
+</manifest>
\ No newline at end of file
--- /dev/null
+jp.ac.titech.sharp4k.cuten.sampletask.ECCTask
--- /dev/null
+require 'pathname'
+require_relative '../tools/lib/cuten_app'
+
+APP_NAME = Pathname.new('.').realpath.basename
+project = Android::Project.new APP_NAME
+sdk = Android::Sdk.new ENV['ANDROID_HOME'], project
+Rake::CutenAppTask.new(sdk).define_all
--- /dev/null
+# To enable ProGuard in your project, edit project.properties
+# to define the proguard.config property as described in that file.
+#
+# Add project specific ProGuard rules here.
+# By default, the flags in this file are appended to flags specified
+# in ${sdk.dir}/tools/proguard/proguard-android.txt
+# You can edit the include path and order by changing the ProGuard
+# include property in project.properties.
+#
+# For more details, see
+# http://developer.android.com/guide/developing/tools/proguard.html
+
+# Add any project specific keep options here:
+
+# 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 *;
+#}
--- /dev/null
+# This file is automatically generated by Android Tools.
+# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
+#
+# This file must be checked in Version Control Systems.
+#
+# To customize properties used by the Ant build system edit
+# "ant.properties", and override values to adapt the script to your
+# project structure.
+#
+# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
+#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
+
+# Project target.
+target=android-13
+android.library.reference.1=../CUTEnLib
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:orientation="vertical" >
+
+</LinearLayout>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+
+ <array name="questions">
+ <item>@array/q1</item>
+ <item>@array/q2</item>
+ <item>@array/q3</item>
+ </array>
+ <array name="q1">
+ <item>@integer/q1_row</item>
+ <item>@integer/q1_col</item>
+ <item>@integer/q1_checkrow</item>
+ <item>@integer/q1_checkcol</item>
+ <item>@array/q1_code</item>
+ <item>@array/q1_answer</item>
+ </array>
+
+ <integer name="q1_row">5</integer>
+ <integer name="q1_col">8</integer>
+ <integer name="q1_checkrow">5</integer>
+ <integer name="q1_checkcol">8</integer>
+
+ <array name="q1_code">
+ <item>@array/q1_row1</item>
+ <item>@array/q1_row2</item>
+ <item>@array/q1_row3</item>
+ <item>@array/q1_row4</item>
+ <item>@array/q1_row5</item>
+ </array>
+
+ <string-array name="q1_row1">
+ <item>1</item>
+ <item>0</item>
+ <item>1</item>
+ <item>0</item>
+ <item>1</item>
+ <item>1</item>
+ <item>0</item>
+ <item>0</item>
+ </string-array>
+ <string-array name="q1_row2">
+ <item>0</item>
+ <item>1</item>
+ <item>0</item>
+ <item>0</item>
+ <item>1</item>
+ <item>0</item>
+ <item>1</item>
+ <item>0</item>
+ </string-array>
+ <string-array name="q1_row3">
+ <item>0</item>
+ <item>0</item>
+ <item>1</item>
+ <item>1</item>
+ <item>1</item>
+ <item>0</item>
+ <item>0</item>
+ <item>1</item>
+ </string-array>
+ <string-array name="q1_row4">
+ <item>1</item>
+ <item>0</item>
+ <item>0</item>
+ <item>0</item>
+ <item>0</item>
+ <item>0</item>
+ <item>1</item>
+ <item>1</item>
+ </string-array>
+ <string-array name="q1_row5">
+ <item>0</item>
+ <item>1</item>
+ <item>1</item>
+ <item>1</item>
+ <item>1</item>
+ <item>0</item>
+ <item>0</item>
+ <item>0</item>
+ </string-array>
+
+ <array name="q1_answer">
+ <item>@array/q1_ans1</item>
+ <item>@array/q1_ans2</item>
+ </array>
+
+ <integer-array name="q1_ans1">
+ <item>2</item>
+ <item>3</item>
+ </integer-array>
+ <integer-array name="q1_ans2">
+ <item>4</item>
+ <item>6</item>
+ </integer-array>
+
+ <array name="q2">
+ <item>@integer/q2_row</item>
+ <item>@integer/q2_col</item>
+ <item>@integer/q2_checkrow</item>
+ <item>@integer/q2_checkcol</item>
+ <item>@array/q2_code</item>
+ <item>@array/q2_answer</item>
+ </array>
+
+ <integer name="q2_row">6</integer>
+ <integer name="q2_col">8</integer>
+ <integer name="q2_checkrow">1</integer>
+ <integer name="q2_checkcol">1</integer>
+
+ <array name="q2_code">
+ <item>@array/q2_row1</item>
+ <item>@array/q2_row2</item>
+ <item>@array/q2_row3</item>
+ <item>@array/q2_row4</item>
+ <item>@array/q2_row5</item>
+ <item>@array/q2_row6</item>
+ </array>
+
+ <string-array name="q2_row1">
+ <item>1</item>
+ <item>0</item>
+ <item>1</item>
+ <item>0</item>
+ <item>0</item>
+ <item>0</item>
+ <item>1</item>
+ <item>1</item>
+ </string-array>
+ <string-array name="q2_row2">
+ <item>1</item>
+ <item>1</item>
+ <item>0</item>
+ <item>0</item>
+ <item>1</item>
+ <item>1</item>
+ <item>0</item>
+ <item>1</item>
+ </string-array>
+ <string-array name="q2_row3">
+ <item>1</item>
+ <item>1</item>
+ <item>0</item>
+ <item>1</item>
+ <item>0</item>
+ <item>1</item>
+ <item>0</item>
+ <item>0</item>
+ </string-array>
+ <string-array name="q2_row4">
+ <item>0</item>
+ <item>0</item>
+ <item>1</item>
+ <item>1</item>
+ <item>1</item>
+ <item>0</item>
+ <item>1</item>
+ <item>0</item>
+ </string-array>
+ <string-array name="q2_row5">
+ <item>0</item>
+ <item>1</item>
+ <item>1</item>
+ <item>0</item>
+ <item>1</item>
+ <item>0</item>
+ <item>0</item>
+ <item>1</item>
+ </string-array>
+ <string-array name="q2_row6">
+ <item>1</item>
+ <item>1</item>
+ <item>1</item>
+ <item>0</item>
+ <item>1</item>
+ <item>1</item>
+ <item>0</item>
+ <item>1</item>
+ </string-array>
+
+ <array name="q2_answer">
+ <item>@array/q2_ans1</item>
+ <item>@array/q2_ans2</item>
+ <item>@array/q2_ans3</item>
+ </array>
+
+ <integer-array name="q2_ans1">
+ <item>2</item>
+ <item>6</item>
+ </integer-array>
+ <integer-array name="q2_ans2">
+ <item>4</item>
+ <item>5</item>
+ </integer-array>
+ <integer-array name="q2_ans3">
+ <item>5</item>
+ <item>2</item>
+ </integer-array>
+
+ <array name="q3">
+ <item>@integer/q3_row</item>
+ <item>@integer/q3_col</item>
+ <item>@integer/q3_checkrow</item>
+ <item>@integer/q3_checkcol</item>
+ <item>@array/q3_code</item>
+ <item>@array/q3_answer</item>
+ </array>
+
+ <integer name="q3_row">4</integer>
+ <integer name="q3_col">6</integer>
+ <integer name="q3_checkrow">4</integer>
+ <integer name="q3_checkcol">6</integer>
+
+ <array name="q3_code">
+ <item>@array/q3_row1</item>
+ <item>@array/q3_row2</item>
+ <item>@array/q3_row3</item>
+ <item>@array/q3_row4</item>
+ </array>
+
+ <string-array name="q3_row1">
+ <item>1</item>
+ <item>0</item>
+ <item>1</item>
+ <item>0</item>
+ <item>1</item>
+ <item>1</item>
+ </string-array>
+ <string-array name="q3_row2">
+ <item>0</item>
+ <item>1</item>
+ <item>1</item>
+ <item>1</item>
+ <item>0</item>
+ <item>1</item>
+ </string-array>
+ <string-array name="q3_row3">
+ <item>0</item>
+ <item>0</item>
+ <item>1</item>
+ <item>0</item>
+ <item>0</item>
+ <item>1</item>
+ </string-array>
+ <string-array name="q3_row4">
+ <item>1</item>
+ <item>1</item>
+ <item>1</item>
+ <item>1</item>
+ <item>1</item>
+ <item>1</item>
+ </string-array>
+
+ <array name="q3_answer">
+ </array>
+
+</resources>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <string name="app_name">ECC</string>
+ <string name="text">符号!</string>
+</resources>
\ No newline at end of file
--- /dev/null
+package jp.ac.titech.sharp4k.cuten;
+
+import jp.ac.titech.sharp4k.cuten.sampletask.ECCTask;
+import android.app.Activity;
+import android.os.Bundle;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.widget.Button;
+import android.widget.LinearLayout;
+import android.widget.Toast;
+
+public class ECCActivity extends Activity implements ResultSender,
+ OnClickListener {
+ private BaseApp taskApp;
+
+ /** Called when the activity is first created. */
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ taskApp = new ECCTask();
+ taskApp.setSender(this);
+ taskApp.setCloseRequester(new CloseRequester() {
+ @Override
+ public void close() {
+
+ }
+ });
+ LinearLayout layout = new LinearLayout(this);
+ layout.setOrientation(LinearLayout.VERTICAL);
+ Button b = new Button(this);
+ b.setOnClickListener(this);
+ layout.addView(b);
+ layout.addView(taskApp.createView(this, this.getResources()));
+ setContentView(layout);
+ }
+
+ @Override
+ public void onClick(View v) {
+ taskApp.onClose();
+ }
+
+ @Override
+ public void send(int[] results) {
+ String str = "";
+ for (Integer i : results) {
+ str += i.toString() + ",";
+ }
+ Toast.makeText(this, str, Toast.LENGTH_SHORT).show();
+ }
+}
\ No newline at end of file
--- /dev/null
+package jp.ac.titech.sharp4k.cuten.sampletask;
+
+import jp.ac.titech.sharp4k.cuten.BaseApp;
+import jp.ac.titech.sharp4k.cuten.R;
+import android.content.Context;
+import android.content.res.Resources;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.view.ViewGroup;
+import android.widget.Button;
+import android.widget.RelativeLayout;
+import android.widget.TextView;
+
+public class ECCTask extends BaseApp {
+ final private int TEXT_VIEW = 1;
+ final private int MATRIX_VIEW = 2;
+ final private int RESET_BUTTON = 3;
+ final private int NEXT_BUTTON = 4;
+ private Context ctx;
+ private Resources res;
+ private RelativeLayout reLay;
+ private MatrixView mv;
+ private int cnt;
+ private int[] result;
+
+ @Override
+ protected View createView(Context ctx, Resources res) {
+ this.ctx = ctx;
+ this.res = res;
+ result = new int[res.obtainTypedArray(R.array.questions).length()];
+ cnt = 0;
+
+ // set layout
+ reLay = new RelativeLayout(ctx);
+
+ // textview
+ TextView tv = new TextView(ctx);
+ tv.setText("たいとる");
+ tv.setTextSize(50);
+ tv.setId(TEXT_VIEW);
+ RelativeLayout.LayoutParams tvParam = new RelativeLayout.LayoutParams(
+ ViewGroup.LayoutParams.WRAP_CONTENT,
+ ViewGroup.LayoutParams.WRAP_CONTENT);
+ tvParam.addRule(RelativeLayout.ALIGN_PARENT_TOP, -1);
+ tvParam.addRule(RelativeLayout.CENTER_HORIZONTAL, -1);
+ reLay.addView(tv, tvParam);
+
+ // button
+ Button start = new Button(ctx);
+ start.setText("start");
+ RelativeLayout.LayoutParams startParam = new RelativeLayout.LayoutParams(
+ ViewGroup.LayoutParams.WRAP_CONTENT,
+ ViewGroup.LayoutParams.WRAP_CONTENT);
+ startParam.addRule(RelativeLayout.BELOW, TEXT_VIEW);
+ startParam.addRule(RelativeLayout.CENTER_HORIZONTAL, -1);
+ reLay.addView(start, startParam);
+
+ start.setOnClickListener(new OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ nextLayout();
+ }
+ });
+
+ return reLay;
+ }
+
+ void nextLayout() {
+ int qNum = res.obtainTypedArray(R.array.questions).length();
+ if (cnt == qNum) {
+ reLay.removeAllViews();
+ // textview
+ TextView tv = new TextView(ctx);
+ tv.setText("おわり");
+ tv.setTextSize(50);
+ RelativeLayout.LayoutParams tvParam = new RelativeLayout.LayoutParams(
+ ViewGroup.LayoutParams.WRAP_CONTENT,
+ ViewGroup.LayoutParams.WRAP_CONTENT);
+ tvParam.addRule(RelativeLayout.CENTER_VERTICAL, -1);
+ tvParam.addRule(RelativeLayout.CENTER_HORIZONTAL, -1);
+ reLay.addView(tv, tvParam);
+ } else if (cnt < qNum) {
+ reLay.removeAllViews();
+ // textview
+ TextView tv = new TextView(ctx);
+ tv.setText(res.getString(R.string.text));
+ tv.setTextSize(30);
+ tv.setId(TEXT_VIEW);
+ RelativeLayout.LayoutParams tvParam = new RelativeLayout.LayoutParams(
+ ViewGroup.LayoutParams.WRAP_CONTENT,
+ ViewGroup.LayoutParams.WRAP_CONTENT);
+ tvParam.addRule(RelativeLayout.ALIGN_PARENT_TOP, -1);
+ tvParam.addRule(RelativeLayout.ALIGN_PARENT_LEFT, -1);
+ reLay.addView(tv, tvParam);
+ // reset button
+ Button reset = new Button(ctx);
+ reset.setText("reset");
+ reset.setId(RESET_BUTTON);
+ RelativeLayout.LayoutParams resetParam = new RelativeLayout.LayoutParams(
+ ViewGroup.LayoutParams.WRAP_CONTENT,
+ ViewGroup.LayoutParams.WRAP_CONTENT);
+ resetParam.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM, -1);
+ resetParam.addRule(RelativeLayout.ALIGN_PARENT_LEFT, -1);
+ reLay.addView(reset, resetParam);
+ // next button
+ Button next = new Button(ctx);
+ next.setText("next");
+ next.setId(NEXT_BUTTON);
+ RelativeLayout.LayoutParams nextParam = new RelativeLayout.LayoutParams(
+ ViewGroup.LayoutParams.WRAP_CONTENT,
+ ViewGroup.LayoutParams.WRAP_CONTENT);
+ nextParam.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM, -1);
+ nextParam.addRule(RelativeLayout.ALIGN_PARENT_RIGHT, -1);
+ reLay.addView(next, nextParam);
+ // Matrix View
+ mv = new MatrixView(ctx, res, res.obtainTypedArray(
+ R.array.questions).getResourceId(cnt, -1));
+ mv.setId(MATRIX_VIEW);
+ RelativeLayout.LayoutParams mvParam = new RelativeLayout.LayoutParams(
+ ViewGroup.LayoutParams.FILL_PARENT,
+ ViewGroup.LayoutParams.FILL_PARENT);
+ mvParam.addRule(RelativeLayout.BELOW, TEXT_VIEW);
+ mvParam.addRule(RelativeLayout.ABOVE, RESET_BUTTON);
+ reLay.addView(mv, mvParam);
+
+ reset.setOnClickListener(new OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ mv.reset();
+ }
+ });
+ next.setOnClickListener(new OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ result[cnt] = mv.mark();
+ cnt += 1;
+ nextLayout();
+ }
+ });
+ }
+
+ }
+
+ @Override
+ protected void onClose() {
+ sendResult(result);
+ super.onClose();
+ }
+}
--- /dev/null
+package jp.ac.titech.sharp4k.cuten.sampletask;
+
+import java.util.HashSet;
+
+import android.content.Context;
+import android.content.res.Resources;
+import android.content.res.TypedArray;
+import android.graphics.Canvas;
+import android.graphics.Color;
+import android.graphics.Paint;
+import android.graphics.Paint.FontMetrics;
+import android.graphics.Paint.Style;
+import android.util.Pair;
+import android.view.MotionEvent;
+import android.view.View;
+
+public class MatrixView extends View {
+ private Resources res;
+ private float width, height;
+ private int row, col, checkrow, checkcol;
+ private HashSet<Pair<Integer, Integer>> cAnswer, uAnswer;
+ private String[][] bits;
+ private TypedArray question;
+
+ public MatrixView(Context ctx, Resources res, int questionId) {
+ super(ctx);
+ setFocusable(true);
+ setFocusableInTouchMode(true);
+ this.res = res;
+ question = res.obtainTypedArray(questionId);
+ row = question.getInteger(0, -1);
+ col = question.getInteger(1, -1);
+ checkrow = question.getInteger(2, -1);
+ checkcol = question.getInteger(3, -1);
+ TypedArray code = res.obtainTypedArray(question.getResourceId(4, -1));
+ bits = new String[code.length()][];
+ for (int i = 0; i < code.length(); i++) {
+ bits[i] = res.getStringArray(code.getResourceId(i, -1));
+ }
+ cAnswer = new HashSet<Pair<Integer, Integer>>();
+ TypedArray answer = res.obtainTypedArray(question.getResourceId(5, -1));
+ for (int i = 0; i < answer.length(); i++) {
+ cAnswer.add(new Pair<Integer, Integer>(res.getIntArray(answer
+ .getResourceId(i, -1))[0], res.getIntArray(answer
+ .getResourceId(i, -1))[1]));
+ }
+ uAnswer = new HashSet<Pair<Integer, Integer>>();
+ }
+
+ @Override
+ protected void onSizeChanged(int w, int h, int oldw, int oldh) {
+ width = w / (col + 2);
+ height = h / (row + 2);
+ super.onSizeChanged(w, h, oldw, oldh);
+ }
+
+ @Override
+ protected void onDraw(Canvas canvas) {
+ // draw matrix line
+ Paint line = new Paint();
+ line.setColor(Color.GRAY);
+ for (int i = 1; i < row + 2; i++) {
+ canvas.drawLine(width, i * height, width * (col + 1), i * height,
+ line);
+ }
+ for (int i = 1; i < col + 2; i++) {
+ canvas.drawLine(i * width, height, i * width, height * (row + 1),
+ line);
+ }
+
+ // draw checksum line
+ Paint cline = new Paint();
+ cline.setColor(Color.RED);
+ canvas.drawLine(width, checkrow * height, width * (col + 1), checkrow
+ * height, cline);
+ canvas.drawLine(width, (checkrow + 1) * height, width * (col + 1),
+ (checkrow + 1) * height, cline);
+ canvas.drawLine(width, checkrow * height, width, (checkrow + 1)
+ * height, cline);
+ canvas.drawLine(width * (col + 1), checkrow * height,
+ width * (col + 1), (checkrow + 1) * height, cline);
+ canvas.drawLine(checkcol * width, height, checkcol * width, (row + 1)
+ * height, cline);
+ canvas.drawLine((checkcol + 1) * width, height, (checkcol + 1) * width,
+ (row + 1) * height, cline);
+ canvas.drawLine(checkcol * width, height, (checkcol + 1) * width,
+ height, cline);
+ canvas.drawLine(checkcol * width, (row + 1) * height, (checkcol + 1)
+ * width, (row + 1) * height, cline);
+
+ // selRects
+ Paint selected = new Paint();
+ selected.setColor(Color.CYAN);
+ for (Pair<Integer, Integer> i : uAnswer) {
+ canvas.drawRect(i.second * width, i.first * height, i.second
+ * width + width, i.first * height + height, selected);
+ }
+
+ // bits
+ Paint foreground = new Paint(Paint.ANTI_ALIAS_FLAG);
+ foreground.setColor(Color.GRAY);
+ foreground.setStyle(Style.FILL);
+ foreground.setTextSize(height * 0.75f);
+ foreground.setTextScaleX(width / height);
+ foreground.setTextAlign(Paint.Align.CENTER);
+ FontMetrics fm = foreground.getFontMetrics();
+ float x = width / 2;
+ float y = height / 2 - (fm.ascent + fm.descent) / 2;
+ for (int i = 1; i < row + 1; i++) {
+ for (int j = 1; j < col + 1; j++) {
+ canvas.drawText(bits[i - 1][j - 1], j * width + x, i * height
+ + y, foreground);
+ }
+ }
+ }
+
+ @Override
+ public boolean onTouchEvent(MotionEvent event) {
+ if (event.getAction() != MotionEvent.ACTION_DOWN) {
+ return super.onTouchEvent(event);
+ } else {
+ // position
+ int selX, selY;
+ selX = (int) (event.getX() / width);
+ selY = (int) (event.getY() / height);
+ if (selX <= 0 || selY <= 0 || selX > col || selY > row
+ || selX == checkcol || selY == checkrow) {
+ return true;
+ }
+ // add user answer and inverse bit
+ Pair<Integer, Integer> tmpAns = new Pair<Integer, Integer>(selY,
+ selX);
+ if (!uAnswer.remove(tmpAns)) {
+ uAnswer.add(tmpAns);
+ }
+ if (bits[selY - 1][selX - 1].equals("0")) {
+ bits[selY - 1][selX - 1] = "1";
+ } else {
+ bits[selY - 1][selX - 1] = "0";
+ }
+ invalidate();
+ }
+ return true;
+ }
+
+ public void reset() {
+ TypedArray code = res.obtainTypedArray(question.getResourceId(4, -1));
+ bits = new String[code.length()][];
+ for (int i = 0; i < code.length(); i++) {
+ bits[i] = res.getStringArray(code.getResourceId(i, -1));
+ }
+ uAnswer = new HashSet<Pair<Integer, Integer>>();
+ invalidate();
+ }
+
+ public int mark() {
+ if (uAnswer.equals(cAnswer)) {
+ return 100;
+ } else {
+ return 0;
+ }
+ }
+}
\ No newline at end of file