svnno****@sourc*****
svnno****@sourc*****
2012年 7月 15日 (日) 23:26:17 JST
Revision: 162
http://sourceforge.jp/projects/smartupload/scm/svn/commits/162
Author: youthfulday23
Date: 2012-07-15 23:26:16 +0900 (Sun, 15 Jul 2012)
Log Message:
-----------
Y.Narisawa
Add new class
Modified Paths:
--------------
trunk/src/Android/SmartUpLoad_main/.classpath
trunk/src/Android/SmartUpLoad_main/project.properties
trunk/src/Android/SmartUpLoad_main/src/smartUpLoad/or/jp/SmartUpLoad_Application.java
trunk/src/Android/SmartUpLoad_main/src/smartUpLoad/or/jp/SmartUpLoad_mainActivity.java
Added Paths:
-----------
trunk/src/Android/SmartUpLoad_main/src/smartUpLoad/or/jp/SmartUpLoad_Common.java
-------------- next part --------------
Modified: trunk/src/Android/SmartUpLoad_main/.classpath
===================================================================
--- trunk/src/Android/SmartUpLoad_main/.classpath 2012-07-15 07:05:41 UTC (rev 161)
+++ trunk/src/Android/SmartUpLoad_main/.classpath 2012-07-15 14:26:16 UTC (rev 162)
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
+ <classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
+ <classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
<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>
Modified: trunk/src/Android/SmartUpLoad_main/project.properties
===================================================================
--- trunk/src/Android/SmartUpLoad_main/project.properties 2012-07-15 07:05:41 UTC (rev 161)
+++ trunk/src/Android/SmartUpLoad_main/project.properties 2012-07-15 14:26:16 UTC (rev 162)
@@ -8,4 +8,4 @@
# project structure.
# Project target.
-target=android-10
+target=android-15
Modified: trunk/src/Android/SmartUpLoad_main/src/smartUpLoad/or/jp/SmartUpLoad_Application.java
===================================================================
--- trunk/src/Android/SmartUpLoad_main/src/smartUpLoad/or/jp/SmartUpLoad_Application.java 2012-07-15 07:05:41 UTC (rev 161)
+++ trunk/src/Android/SmartUpLoad_main/src/smartUpLoad/or/jp/SmartUpLoad_Application.java 2012-07-15 14:26:16 UTC (rev 162)
@@ -3,6 +3,8 @@
import java.util.concurrent.Executors;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.ThreadPoolExecutor;
+import java.util.concurrent.TimeUnit;
+
import android.app.Application;
/**
@@ -52,6 +54,20 @@
public void setmAplExec(ExecutorService mAplExec) {
this.mAplExec = mAplExec;
}
+
+ /**
+ * タスクを実行する
+ * @param exec ExecutorService
+ * @param task SmtMtrCancelable
+ * @param timeOut タイムアウト時間
+ * @param unit TimeUnit
+ */
+ public void executeTask(ExecutorService exec, SmartUpLoad_Cancelable task, int timeOut, TimeUnit unit) {
+ extendLog.Log_D();
+ SmartUpLoad_Cancelable canceller = new SmartUpLoad_CancellingTask(exec, task, timeOut, unit);
+ mAplExec.execute(canceller);
+ extendLog.Log_D();
+ }
/* =============== メンバメソッド 終了 =============== */
Added: trunk/src/Android/SmartUpLoad_main/src/smartUpLoad/or/jp/SmartUpLoad_Common.java
===================================================================
--- trunk/src/Android/SmartUpLoad_main/src/smartUpLoad/or/jp/SmartUpLoad_Common.java (rev 0)
+++ trunk/src/Android/SmartUpLoad_main/src/smartUpLoad/or/jp/SmartUpLoad_Common.java 2012-07-15 14:26:16 UTC (rev 162)
@@ -0,0 +1,12 @@
+package smartUpLoad.or.jp;
+
+
+public class SmartUpLoad_Common {
+ /* =============== メンバ変数 開始 =============== */
+ /** トークン保存時のキー */
+ public static final String KEY_USER_ID ="UserID";
+ public static final String KEY_PASSWORD ="Password";
+ /* =============== メンバ変数 終了 =============== */
+
+};
+
Modified: trunk/src/Android/SmartUpLoad_main/src/smartUpLoad/or/jp/SmartUpLoad_mainActivity.java
===================================================================
--- trunk/src/Android/SmartUpLoad_main/src/smartUpLoad/or/jp/SmartUpLoad_mainActivity.java 2012-07-15 07:05:41 UTC (rev 161)
+++ trunk/src/Android/SmartUpLoad_main/src/smartUpLoad/or/jp/SmartUpLoad_mainActivity.java 2012-07-15 14:26:16 UTC (rev 162)
@@ -1,5 +1,7 @@
package smartUpLoad.or.jp;
+import android.app.Activity;
+import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.widget.ImageButton;
@@ -12,6 +14,7 @@
/* ======================================================= */
// メンバー変数一覧
/* ======================================================= */
+ /** クリックListener */
private View.OnClickListener mClickListener = new OnClickListener() {
// クリック判定
public void onClick(View v) {
@@ -28,7 +31,23 @@
extendLog.Log_D();
}
};
+ private class AppConfirm implements SmartUpLoad_Cancelable {
+ @Override
+ public void run() {
+ // visible ProgressBar
+ setProgressBarIndeterminateVisibility(true);
+
+ }
+
+ @Override
+ public void cancel() {
+ // TODO 自動生成されたメソッド・スタブ
+
+ }
+ };
+
+
@Override
void init() {
@@ -37,9 +56,22 @@
@Override
void onSubCreate() {
- // リソースの設定
+ // set resource
setContentView(R.layout.main);
((ImageButton)findViewById(R.id.imageButton_start)).setOnClickListener(mClickListener);
+ // read password & ID
+ Context appContext = getApplicationContext();
+ SharedPreferences pref = appContext.getSharedPreferences(SmartUpLoad_Common.KEY_USER_ID, Activity.MODE_PRIVATE);
+ String userID = pref.getString(SmartUpLoad_Common.KEY_USER_ID, null);
+ String password = pref.getString(SmartUpLoad_Common.KEY_PASSWORD, null);
+ /* password & userID check */
+ if ((null != userID) && (null != password)) {
+ /* 非同期処理でserverに接続する */
+ SmartUpLoad_Cancelable appConfirm = new AppConfirm();
+ SmartUpLoad_Application app = (SmartUpLoad_Application)getApplication();
+ app.executeTask(app.getmAplExec(), appConfirm, 0, null);
+
+ }
}
@Override