OSDN Git Service

English
authoryuji <yuji.k64613@gmail.com>
Sat, 12 Jan 2013 03:00:42 +0000 (12:00 +0900)
committeryuji <yuji.k64613@gmail.com>
Sat, 12 Jan 2013 03:00:42 +0000 (12:00 +0900)
21 files changed:
.gitignore
workspace/JuggleMaster/bin/JuggleMaster.apk
workspace/JuggleMaster/bin/classes.dex
workspace/JuggleMaster/bin/classes/com/jm/Edit$6.class
workspace/JuggleMaster/bin/classes/com/jm/GenPattern.class
workspace/JuggleMaster/bin/classes/com/jm/Menu1$1.class
workspace/JuggleMaster/bin/classes/com/jm/Menu1.class
workspace/JuggleMaster/bin/classes/com/jm/PatternList.class
workspace/JuggleMaster/bin/classes/com/jm/R$string.class
workspace/JuggleMaster/bin/classes/com/jm/db/Dao.class
workspace/JuggleMaster/bin/classes/com/jm/db/DatabaseHelper.class
workspace/JuggleMaster/bin/classes/com/jm/utility/AsyncTaskCommand.class
workspace/JuggleMaster/bin/classes/com/jm/utility/BaseActivity.class
workspace/JuggleMaster/bin/resources.ap_
workspace/JuggleMaster/gen/com/jm/R.java
workspace/JuggleMaster/res/values-ja/strings.xml
workspace/JuggleMaster/res/values/strings.xml
workspace/JuggleMaster/src/com/jm/Menu1.java
workspace/JuggleMaster/src/com/jm/PatternList.java
workspace/JuggleMaster/src/com/jm/db/Dao.java
workspace/JuggleMaster/src/com/jm/db/DatabaseHelper.java

index dde35d7..6f1e5ae 100644 (file)
@@ -1 +1,22 @@
-workspace/.metadata\r
+# built application files
+*.apk
+*.ap_
+
+# files for the dex VM
+*.dex
+
+# Java class files
+*.class
+
+# generated files
+bin/
+gen/
+
+# Local configuration file (sdk path, etc)
+local.properties
+
+# Eclipse project files
+#.classpath
+#.project
+
+.metadata
index 3d5fd78..dd90914 100644 (file)
Binary files a/workspace/JuggleMaster/bin/JuggleMaster.apk and b/workspace/JuggleMaster/bin/JuggleMaster.apk differ
index 041a5ff..bc677c2 100644 (file)
Binary files a/workspace/JuggleMaster/bin/classes.dex and b/workspace/JuggleMaster/bin/classes.dex differ
index 7834ae2..698b306 100644 (file)
Binary files a/workspace/JuggleMaster/bin/classes/com/jm/Edit$6.class and b/workspace/JuggleMaster/bin/classes/com/jm/Edit$6.class differ
index b643a95..7e98c6c 100644 (file)
Binary files a/workspace/JuggleMaster/bin/classes/com/jm/GenPattern.class and b/workspace/JuggleMaster/bin/classes/com/jm/GenPattern.class differ
index 4b7ee29..c8d2496 100644 (file)
Binary files a/workspace/JuggleMaster/bin/classes/com/jm/Menu1$1.class and b/workspace/JuggleMaster/bin/classes/com/jm/Menu1$1.class differ
index ec7ed6f..12fa512 100644 (file)
Binary files a/workspace/JuggleMaster/bin/classes/com/jm/Menu1.class and b/workspace/JuggleMaster/bin/classes/com/jm/Menu1.class differ
index 88ae701..1f36b6a 100644 (file)
Binary files a/workspace/JuggleMaster/bin/classes/com/jm/PatternList.class and b/workspace/JuggleMaster/bin/classes/com/jm/PatternList.class differ
index 03d5df8..f01dbd5 100644 (file)
Binary files a/workspace/JuggleMaster/bin/classes/com/jm/R$string.class and b/workspace/JuggleMaster/bin/classes/com/jm/R$string.class differ
index e2dd57a..3525650 100644 (file)
Binary files a/workspace/JuggleMaster/bin/classes/com/jm/db/Dao.class and b/workspace/JuggleMaster/bin/classes/com/jm/db/Dao.class differ
index d262b10..42c0897 100644 (file)
Binary files a/workspace/JuggleMaster/bin/classes/com/jm/db/DatabaseHelper.class and b/workspace/JuggleMaster/bin/classes/com/jm/db/DatabaseHelper.class differ
index af69905..2d4e1ff 100644 (file)
Binary files a/workspace/JuggleMaster/bin/classes/com/jm/utility/AsyncTaskCommand.class and b/workspace/JuggleMaster/bin/classes/com/jm/utility/AsyncTaskCommand.class differ
index 023291b..a65cb32 100644 (file)
Binary files a/workspace/JuggleMaster/bin/classes/com/jm/utility/BaseActivity.class and b/workspace/JuggleMaster/bin/classes/com/jm/utility/BaseActivity.class differ
index 881a80c..12910f1 100644 (file)
Binary files a/workspace/JuggleMaster/bin/resources.ap_ and b/workspace/JuggleMaster/bin/resources.ap_ differ
index 0897d99..23a97ac 100644 (file)
@@ -75,44 +75,46 @@ public final class R {
         public static final int menu2=0x7f030006;
     }
     public static final class string {
-        public static final int app_name=0x7f040000;
-        public static final int bheight=0x7f040017;
-        public static final int calculating=0x7f040012;
-        public static final int cancel=0x7f040008;
-        public static final int close=0x7f040009;
-        public static final int common_settings=0x7f04000f;
-        public static final int create=0x7f040011;
-        public static final int delete=0x7f040007;
-        public static final int error_unexpected=0x7f04001f;
-        public static final int generate=0x7f04001a;
-        public static final int handling=0x7f04000c;
-        public static final int height=0x7f04000d;
-        public static final int help=0x7f040005;
-        public static final int help1=0x7f040001;
-        public static final int help2=0x7f040002;
-        public static final int help3=0x7f040003;
-        public static final int help4=0x7f040004;
-        public static final int hold=0x7f04000e;
-        public static final int list0_1=0x7f040020;
-        public static final int list0_2=0x7f040021;
-        public static final int list0_3=0x7f040022;
-        public static final int list0_4=0x7f040023;
-        public static final int list0_5=0x7f040024;
-        public static final int list0_6=0x7f040025;
-        public static final int list0_7=0x7f040026;
-        public static final int message_delete_pattern=0x7f04001d;
-        public static final int message_nopattern=0x7f04001e;
-        public static final int normal=0x7f040014;
-        public static final int number=0x7f040016;
-        public static final int patternMax=0x7f040019;
-        public static final int patternTypes=0x7f040013;
-        public static final int pattern_name=0x7f04000a;
-        public static final int period=0x7f040018;
-        public static final int save=0x7f040006;
-        public static final int siteswap=0x7f04000b;
-        public static final int speed=0x7f040010;
-        public static final int synchronization=0x7f040015;
-        public static final int title_delete=0x7f04001c;
-        public static final int title_system_error=0x7f04001b;
+        public static final int app_name=0x7f040001;
+        public static final int bheight=0x7f040018;
+        public static final int calculating=0x7f040013;
+        public static final int cancel=0x7f040009;
+        public static final int close=0x7f04000a;
+        public static final int common_settings=0x7f040010;
+        public static final int create=0x7f040012;
+        public static final int delete=0x7f040008;
+        public static final int error_unexpected=0x7f040020;
+        public static final int generate=0x7f04001b;
+        public static final int handling=0x7f04000d;
+        public static final int height=0x7f04000e;
+        public static final int help=0x7f040006;
+        public static final int help1=0x7f040002;
+        public static final int help2=0x7f040003;
+        public static final int help3=0x7f040004;
+        public static final int help4=0x7f040005;
+        public static final int hold=0x7f04000f;
+        public static final int lang=0x7f040000;
+        public static final int list0_1=0x7f040021;
+        public static final int list0_2=0x7f040022;
+        public static final int list0_3=0x7f040023;
+        public static final int list0_4=0x7f040024;
+        public static final int list0_5=0x7f040025;
+        public static final int list0_6=0x7f040026;
+        public static final int list0_7=0x7f040027;
+        public static final int list0_8=0x7f040028;
+        public static final int message_delete_pattern=0x7f04001e;
+        public static final int message_nopattern=0x7f04001f;
+        public static final int normal=0x7f040015;
+        public static final int number=0x7f040017;
+        public static final int patternMax=0x7f04001a;
+        public static final int patternTypes=0x7f040014;
+        public static final int pattern_name=0x7f04000b;
+        public static final int period=0x7f040019;
+        public static final int save=0x7f040007;
+        public static final int siteswap=0x7f04000c;
+        public static final int speed=0x7f040011;
+        public static final int synchronization=0x7f040016;
+        public static final int title_delete=0x7f04001d;
+        public static final int title_system_error=0x7f04001c;
     }
 }
index 80d177f..afce1ad 100644 (file)
@@ -1,5 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 <resources>
+    <string name="lang">2</string>
+    
     <string name="app_name">JuggleMaster</string>
     <string name="help1">●リストを長押しすることで、パターンの編集ができます。</string>
     <string name="help2">●「[7]マイパターン」→「[新規作成]」を選択することで、新規のパターンを登録できます。</string>
     <string name="message_delete_pattern">このパターンを削除しますか</string>
     <string name="message_nopattern">パターンがありません</string>
     <string name="error_unexpected">予期しないエラーが発生しました</string>
+    
     <string name="list0_1">[1] 3ボール その1</string>
     <string name="list0_2">[2] 3ボール その2</string>
     <string name="list0_3">[3] 4ボール</string>
     <string name="list0_4">[4] 5ボール</string>
     <string name="list0_5">[5] 6ボール以上</string>
     <string name="list0_6">[6] トレーニング</string>
-    <string name="list0_7">[7] マイパターン"</string>
+    <string name="list0_7">[7] マイパターン</string>
+    <string name="list0_8">[8] パターン生成</string>
 </resources>
index 2276c70..d33209d 100644 (file)
@@ -1,5 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 <resources>
+    <string name="lang">1</string>
+    
     <string name="app_name">JuggleMaster</string>
     <string name="help1">●By holding down the list, you can edit the pattern.</string>
     <string name="help2">●By selecting 「[7]マイパターン」→「[新規作成]」, you can register a new pattern.</string>
     <string name="message_delete_pattern">Do you want to remove this pattern?</string>
     <string name="message_nopattern">Pattern was not found</string>
     <string name="error_unexpected">An unexpected error has occurred</string>
+    
+    <string name="list0_1">[1] 3ball part1</string>
+    <string name="list0_2">[2] 3ボール その2</string>
+    <string name="list0_3">[3] 4ボール</string>
+    <string name="list0_4">[4] 5ボール</string>
+    <string name="list0_5">[5] 6ボール以上</string>
+    <string name="list0_6">[6] トレーニング</string>
+    <string name="list0_7">[7] マイパターン</string>
+    <string name="list0_8">[8] パターン生成</string>
 </resources>
index 2652108..ddd8290 100644 (file)
@@ -19,7 +19,17 @@ public class Menu1 extends BaseActivity {
         super.onCreate(savedInstanceState);\r
         setContentView(R.layout.menu1);\r
 \r
-               CharSequence[] list = PatternList.PACKAGE_INDEX;\r
+               //CharSequence[] list = PatternList.PACKAGE_INDEX;\r
+        CharSequence[] list = new CharSequence[8];\r
+        list[0] = getString(com.jm.R.string.list0_1);\r
+        list[1] = getString(com.jm.R.string.list0_2);\r
+        list[2] = getString(com.jm.R.string.list0_3);\r
+        list[3] = getString(com.jm.R.string.list0_4);\r
+        list[4] = getString(com.jm.R.string.list0_5);\r
+        list[5] = getString(com.jm.R.string.list0_6);\r
+        list[6] = getString(com.jm.R.string.list0_7);\r
+        list[7] = getString(com.jm.R.string.list0_8);\r
+        \r
                ArrayAdapter<CharSequence> adapter = new ArrayAdapter<CharSequence>(this, android.R.layout.simple_list_item_1, list);\r
                ListView listView = (ListView)findViewById(R.id.Menu1);\r
                listView.setAdapter(adapter);\r
index ba7c770..f42f2cc 100644 (file)
@@ -2,21 +2,22 @@ package com.jm;
 \r
 import java.util.Vector;\r
 import com.jm.db.Dao;\r
+import com.jm.db.DatabaseHelper;\r
 import com.jm.utility.JmException;\r
 \r
 public class PatternList {\r
 \r
        public static JmPattern tempPattern = null;\r
-       public static final String[] PACKAGE_INDEX = {\r
-                                                                       "[1] 3ボール その1",\r
-                                                                       "[2] 3ボール その2",\r
-                                                                       "[3] 4ボール",\r
-                                                                       "[4] 5ボール",\r
-                                                                       "[5] 6ボール以上",\r
-                                                                       "[6] トレーニング",\r
-                                                                       "[7] マイパターン",\r
-                                                                       "[8] パターン生成"\r
-                                                                       };\r
+//     public static final String[] PACKAGE_INDEX = {\r
+//                                                                     "[1] 3ボール その1",\r
+//                                                                     "[2] 3ボール その2",\r
+//                                                                     "[3] 4ボール",\r
+//                                                                     "[4] 5ボール",\r
+//                                                                     "[5] 6ボール以上",\r
+//                                                                     "[6] トレーニング",\r
+//                                                                     "[7] マイパターン",\r
+//                                                                     "[8] パターン生成"\r
+//                                                                     };\r
 \r
 // edit {\r
 //     private boolean                 overwrited;\r
@@ -29,19 +30,29 @@ public class PatternList {
 \r
        // edit {\r
        public PatternList() throws JmException {\r
-               言語別に追加\r
+               //言語別設定追加\r
                \r
-               setPackage00();\r
-               setPackage01();\r
-               setPackage02();\r
-               setPackage03();\r
-               setPackage04();\r
-               setPackage05();\r
-               setPackage06();\r
+               DatabaseHelper helper = DatabaseHelper.getInstance();\r
+               switch (helper.getLangId()){\r
+               case DatabaseHelper.JAPANEASE_ID:\r
+                       setPackage00();\r
+                       setPackage01();\r
+                       setPackage02();\r
+                       setPackage03();\r
+                       setPackage04();\r
+                       setPackage05();\r
+                       setPackage06();\r
+                       break;\r
+               default:\r
+                       setPackage01En();\r
+                       setPackage06En();\r
+                       break;\r
+               }\r
        }\r
 \r
        // }\r
        \r
+       /*\r
     public PatternList(Runnable parent, int index) throws JmException {\r
 // edit\r
                //super(parent);\r
@@ -78,7 +89,8 @@ public class PatternList {
 //             setDisplayable(patternList);\r
 // }\r
     }\r
-\r
+        */\r
+       \r
 // edit {\r
 //     public void run() {\r
 //             if (!patterns.isEmpty()) {\r
@@ -503,4 +515,113 @@ public class PatternList {
                int type = 6;\r
                add(new JmPattern(type, "[新規作成]", "1"));\r
        }\r
+       \r
+       public void setPackage01En() throws JmException {\r
+               int type = 1;\r
+\r
+               add(new JmPattern(type, "531"));\r
+               add(new JmPattern(type, "450"));\r
+               add(new JmPattern(type, "5241"));\r
+               add(new JmPattern(type, "51414"));\r
+               add(new JmPattern(type, "72312"));\r
+               add(new JmPattern(type, "wide cascade", "3", 12, 50, new byte[][] { { 21,\r
+                               9, 18, 4 } }));\r
+               add(new JmPattern(type, "ワイドリバースカスケード", "3", new byte[][] { { -8, 0,\r
+                               12, 0 } }));\r
+               add(new JmPattern(type, "リーチオーバー連続", "3", 15, 50, new byte[][] {\r
+                               { 10, 0, 3, -2 }, { -13, 5, 13, 0 }, { 13, -3, 4, 0 } }));\r
+               add(new JmPattern(type, "リーチアンダー連続", "3", 15, 50, new byte[][] {\r
+                               { 10, 4, 3, 4 }, { -13, -5, 13, 0 }, { 13, 3, 4, 0 } }));\r
+               add(new JmPattern(type, "クロス アーム", "3",\r
+                               new byte[][] { { -4, 0, -12, 0 } }));\r
+               add(new JmPattern(type, "リンゴ食べ放題", "(2,4x)(4x,2)", 12, 50,\r
+                               new byte[][] { { 0, 7, -3, -3 }, { 12, 10, 0, 8 },\r
+                                               { 12, 10, 0, 8 }, { 0, 7, -3, -3 } }));\r
+\r
+               add(new JmPattern(type, "1アップ2アップ B", "(4,4)(0,4x)(4,4)(4x,0)", 14, 50,\r
+                               new byte[][] { o, o, { 14, 0, 0, 0 }, o, o, o, o,\r
+                                               { 14, 0, 0, 0 } }));\r
+               add(new JmPattern(type, "1アップ2アップ C",\r
+                               "(4,4)(0,4x)(4,4)(4,0)(4,4)(4x,0)(4,4)(0,4)", 14, 50,\r
+                               new byte[][] { o, o, { 14, 0, 14, 0 }, o, o, o, o, a, o, o, o,\r
+                                               { 14, 0, 14, 0 }, o, o, a, o }));\r
+               add(new JmPattern(type, "1アップ2アップ D", "(4,4)(0,4x)(4,4)(4x,0)", 14, 50,\r
+                               new byte[][] { { 12, 0, -6, 0 }, { -6, 0, 12, 0 }, a, d,\r
+                                               { -6, 0, 12, 0 }, { 12, 0, -6, 0 }, d, a }));\r
+               add(new JmPattern(type, "1アップ2アップ E", "(4,4)(0,4)", 14, 50,\r
+                               new byte[][] { f, f, { 13, 0, -13, 0 }, f }));\r
+               add(new JmPattern(type, "1アップ2アップ F", "(6,6)(0,2x)(4x,0)", 10, 50,\r
+                               new byte[][] { f, f, { 13, 7, 4, 0 }, f, f, { 4, 0, 13, 7 } }));\r
+\r
+               byte[] fake1 = { 10, -1, 10, 0 };\r
+               byte[] fake2 = { 0, -1, 0, 0 };\r
+               byte[] fake3 = { 10, 10, 10, 10 };\r
+               add(new JmPattern(type, "フェイク A", "(2,4)", 14, 50, new byte[][] {\r
+                               fake1, fake1, fake2, fake3 }));\r
+               add(new JmPattern(type, "フェイク B", "(2,4)", 14, 50, new byte[][] {\r
+                               fake2, fake1, fake1, fake3 }));\r
+               add(new JmPattern(type, "フェイク C", "(4,2)(4x,2)(2,4)(2,4x)", 13, 50,\r
+                               new byte[][] { fake1, fake1, fake3, fake2, fake1, fake1, fake2,\r
+                                               fake3 }));\r
+               add(new JmPattern(type, "ヨーヨーを一周", "(4,2)", 13, 50, new byte[][] {\r
+                               { 0, 2, 0, 3 }, fake2, { 0, 13, 0, 13 }, { 10, -1, -10, -1 } }));\r
+               add(new JmPattern(type, "ヨーヨー(トルネード)", "(2,4)", new byte[][] { e,\r
+                               { 15, 15, -15, 14 }, { -5, 0, -5, 0 }, { 15, 14, -15, 15 } }));\r
+               add(new JmPattern(type, "ヨーヨー(横断)", "(2,4)", new byte[][] { e,\r
+                               { 15, 12, 0, 12 }, { -5, 0, -5, 0 }, { -15, 12, 0, 12 } }));\r
+               add(new JmPattern(type, "(4x,2x)(2,4)"));\r
+               add(new JmPattern(type, "(4x,6)(0,2x)"));\r
+               add(new JmPattern(type, "テニス B", "(2,4)(2,4x)(4,2)(4x,2)", 14, 50,\r
+                               new byte[][] { e, e, { 15, 3, 15, 3 }, e, e, e, e,\r
+                                               { 15, 3, 15, 3 } }));\r
+               add(new JmPattern(type, "自由の女神 B", "3", 14, 50, new byte[][] {\r
+                               { 3, 4, 12, 0 }, { 10, 17, 9, 19 } }));\r
+               add(new JmPattern(type, "441", 13, 50));\r
+               add(new JmPattern(type, "441 外回り", "441", 13, 50, new byte[][] { r, r,\r
+                               { 4, 0, 0, 0 } }));\r
+               add(new JmPattern(type, "441 シャッフル", "441", 10, 50, new byte[][] {\r
+                               { 5, -2, 5, -2 }, d, { 15, 4, 9, 10 } }));\r
+               add(new JmPattern(type, "ボスサイドスラム", "(4x,2x)(2,4x)(2x,4x)(4x,2)", 10,\r
+                               50, new byte[][] { { 6, 0, 12, 10 }, b, { 10, 0, 4, 0 }, d, b,\r
+                                               { 6, 0, 12, 10 }, d, { 10, 0, 4, 0 } }));\r
+               add(new JmPattern(type, "イクスチェンジ", "2334", 13, 50, new byte[][] {\r
+                               { 0, 11, 10, 11 }, { 10, 0, 0, 0 }, { 0, 12, -10, 12 },\r
+                               { 10, 0, 0, 0 } }));\r
+\r
+               byte[] eb = { 3, 0, 10, 0 };\r
+               add(new JmPattern(type, "ハーフシャワー B", "5223", shower));\r
+               add(new JmPattern(type, "腕の下シャワー", "(2x,4x)", new byte[][] {\r
+                               { 5, 0, -10, 0 }, { 3, 4, -3, 4 } }));\r
+               add(new JmPattern(type, "腕の下シャワー(交互)", "(2x,4x)", new byte[][] { eb,\r
+                               { 5, 4, 0, 4 }, { 3, 0, -10, 0 }, { 5, 4, 0, 4 } }));\r
+               add(new JmPattern(type, "シンクロシャワー", "(2x,4x)", shower));\r
+               add(new JmPattern(type, "ハイローシャワー A", "7131", shower));\r
+               add(new JmPattern(type, "ハイローシャワー B", "(2x,6x)(2x,2x)", 15, 50,\r
+                               new byte[][] { { 6, 0, 12, 3 }, { 6, 3, 6, 0 }, { 6, 0, 6, 3 },\r
+                                               { 12, 3, 6, 0 } }));\r
+               add(new JmPattern(type, "ハイローシャワー C", "315171", shower));\r
+               add(new JmPattern(type, "ハーフメス", "3", 13, 50, new byte[][] { c,\r
+                               { 0, 0, -12, -3 }, { 0, 2, -12, 2 }, { 0, -3, -6, 0 } }));\r
+               add(new JmPattern(type, "ミルズメス 423", "423", millsmess));\r
+               add(new JmPattern(type, "ミルズメス 414", "414", millsmess));\r
+               add(new JmPattern(type, "ミルズメス 315", "315", millsmess));\r
+               add(new JmPattern(type, "ミルズメス 44133", "44133", 13, 50, new byte[][] {\r
+                               { -2, 0, -12, 5 }, { 2, -2, 12, 0 }, { 0, 2, -3, 0 },\r
+                               { 10, 0, 10, 2 }, { 7, -2, -10, -3 } }));\r
+               add(new JmPattern(type, "ミルズメス ボックス", "612", millsmess));\r
+               add(new JmPattern(type, "ボックスもどき A", "126", 15, 50));\r
+               add(new JmPattern(type, "ボックスもどき B", "630", 15, 50));\r
+               add(new JmPattern(type, "ダブルボックス", "(4x,2x)(4,2x)(2x,4x)(2x,4)", 11,\r
+                               50, new byte[][] { { 14, 0, 7, 0 }, a, { 14, 0, 0, 0 },\r
+                                               { 0, 0, 14, 0 }, a, { 14, 0, 7, 0 }, { 0, 0, 14, 0 },\r
+                                               { 14, 0, 0, 0 } }));\r
+               add(new JmPattern(type, "拡張ボックス",\r
+                               "(2x,8)(2x,4)(0,2x)(8,2x)(4,2x)(2x,0)", new byte[][] { eb, h,\r
+                                               eb, h, h, eb, h, eb, h, eb, eb, h }));\r
+       }\r
+       \r
+       public void setPackage06En() throws JmException {\r
+               int type = 6;\r
+               add(new JmPattern(type, "[Create]", "1"));\r
+       }\r
 }\r
index 2c99663..605c67e 100644 (file)
@@ -123,7 +123,7 @@ public class Dao {
                try {\r
                        DatabaseHelper helper = DatabaseHelper.getInstance();\r
                        SQLiteDatabase db = helper.getReadableDatabase();\r
-                       String selection = "lang = " + helper.getLangId() + " type = " + type;\r
+                       String selection = "lang = " + helper.getLangId() + " and type = " + type;\r
                        Cursor c = db.query(\r
                                        "pattern",\r
                                        new String[] {\r
@@ -161,7 +161,7 @@ public class Dao {
                try {\r
                        DatabaseHelper helper = DatabaseHelper.getInstance();\r
                        SQLiteDatabase db = helper.getReadableDatabase();\r
-                       String selection = "id = " + id + " lang = " + helper.getLangId();\r
+                       String selection = "id = " + id + " and lang = " + helper.getLangId();\r
                        Cursor c = db.query(\r
                                        "pattern",\r
                                        new String[] {\r
index 3ed1a88..276048a 100644 (file)
@@ -11,8 +11,8 @@ import com.jm.utility.JmException;
 \r
 public class DatabaseHelper extends SQLiteOpenHelper {\r
        public final static int ENGLISH_ID = 1;\r
-       public final static int JAPANEASE_ID = 1;\r
-       public static int langId = -1;\r
+       public final static int JAPANEASE_ID = 2;\r
+       private static int langId = -1;\r
        \r
        private static DatabaseHelper instance = null;\r
 \r
@@ -58,13 +58,16 @@ public class DatabaseHelper extends SQLiteOpenHelper {
 \r
        @Override\r
        public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\r
-               if (oldVersion == 1 && newVersion == 2){\r
-                       db.execSQL("ALTER TABLE pattern ADD COLUMN lang integer;");\r
-                       db.execSQL("UPDATE pattern set LANG = " + JAPANEASE_ID + ";");\r
-                       db.execSQL("create index langindex on pattern(lang);");\r
+               try {\r
+                       if (oldVersion == 1 && newVersion == 2) {\r
+                               db.execSQL("ALTER TABLE pattern ADD COLUMN lang integer;");\r
+                               db.execSQL("UPDATE pattern set LANG = " + JAPANEASE_ID + ";");\r
+                               db.execSQL("create index langindex on pattern(lang);");\r
+                       }\r
+               } catch (Exception e) {\r
+                       e.printStackTrace();\r
                }\r
-       }\r
-       \r
+       }       \r
        \r
        public void setLangId(Context context){\r
                if (langId < 0){\r