diff options
author | Teddy <ted.sybil@gmail.com> | 2013-08-23 21:15:01 +0800 |
---|---|---|
committer | Teddy <ted.sybil@gmail.com> | 2013-08-23 21:15:01 +0800 |
commit | 9f239db4b690e648db9c3a2df6b0ee7f26edb0c2 (patch) | |
tree | ea4f14c857608acb637ddd27f1251d55d244b231 /client | |
parent | 12b1d4bc7e56c7de8bf325f702cff1ae114c4db0 (diff) | |
parent | e76d8dc824fddada5912eb838a49d77e7f73641e (diff) |
Merge branch 'master' of github.com:Determinant/piztor
Diffstat (limited to 'client')
86 files changed, 1260 insertions, 2 deletions
diff --git a/client/Socket-demo/Login.java b/client/Socket-demo/Login.java new file mode 100644 index 0000000..2dd386c --- /dev/null +++ b/client/Socket-demo/Login.java @@ -0,0 +1,6 @@ +package com.example.test; + +public class Login{ + void success(int t){} + void failed(){} +}
\ No newline at end of file diff --git a/client/Socket-demo/Transam.java b/client/Socket-demo/Transam.java index 6f0fb44..b5e2381 100644 --- a/client/Socket-demo/Transam.java +++ b/client/Socket-demo/Transam.java @@ -12,6 +12,7 @@ import android.os.Message; public class Transam implements Runnable { public Timer timer; public boolean flag = true; + public boolean reqlog = false; public int cnt = 4; public int port; public String ip; @@ -19,6 +20,16 @@ public class Transam implements Runnable { Myrequest req; Myrespond res; Controller core; + Login log; + + + Transam(String i,int p,Myrequest r,Login l){ + port = p; + ip = i; + req = r; + log = l; + reqlog = true; + } Transam(String i,int p,Myrequest r,Controller c){ port = p; @@ -43,8 +54,19 @@ public class Transam implements Runnable { public void run() { try{ SocketClient client = new SocketClient(ip,port); - res = client.sendMsg(req); + res = client.sendMsg(req); + if(!reqlog){ core.recieveInfo(res); + } + else{ + if((Integer) res.contain.get(2)==0){ + int t = (Integer) res.contain.get(1); + log.success(t); + } + else{ + log.failed(); + } + } Message msg = new Message(); msg.what = 1; handler.sendMessage(msg); @@ -63,10 +85,15 @@ public class Transam implements Runnable { case 1: flag = true; break; - case 2: + case 2: + if(!reqlog){ res = new Myrespond(); res.wrong = msg.obj.toString(); core.recieveInfo(res); + } + else{ + log.failed(); + } break; case 3: final thd t = new thd(); diff --git a/client/activity-demo/Piztor.rar b/client/activity-demo/Piztor.rar Binary files differnew file mode 100644 index 0000000..5ebf80c --- /dev/null +++ b/client/activity-demo/Piztor.rar diff --git a/client/activity-demo/Piztor/.classpath b/client/activity-demo/Piztor/.classpath new file mode 100644 index 0000000..5176974 --- /dev/null +++ b/client/activity-demo/Piztor/.classpath @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/> + <classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/> + <classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/> + <classpathentry kind="src" path="src"/> + <classpathentry kind="src" path="gen"/> + <classpathentry kind="output" path="bin/classes"/> +</classpath> diff --git a/client/activity-demo/Piztor/.project b/client/activity-demo/Piztor/.project new file mode 100644 index 0000000..97100ec --- /dev/null +++ b/client/activity-demo/Piztor/.project @@ -0,0 +1,33 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>Piztor</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> diff --git a/client/activity-demo/Piztor/.settings/org.eclipse.jdt.core.prefs b/client/activity-demo/Piztor/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..b080d2d --- /dev/null +++ b/client/activity-demo/Piztor/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,4 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/client/activity-demo/Piztor/AndroidManifest.xml b/client/activity-demo/Piztor/AndroidManifest.xml new file mode 100644 index 0000000..10e170f --- /dev/null +++ b/client/activity-demo/Piztor/AndroidManifest.xml @@ -0,0 +1,37 @@ +<?xml version="1.0" encoding="utf-8"?> +<manifest xmlns:android="http://schemas.android.com/apk/res/android" + package="com.example.piztor" + android:versionCode="1" + android:versionName="1.0" > + + <uses-permission android:name="android.permission.INTERNET" /> + <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> + <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/> + <uses-permission android:name="android.permission.WAKE_LOCK"/> + <uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/> + + <uses-sdk + android:minSdkVersion="9" + android:targetSdkVersion="17" /> + + <application + android:allowBackup="true" + android:icon="@drawable/ic_launcher" + android:label="@string/app_name" + android:theme="@style/AppTheme" > + <activity + android:name="com.example.piztor.MainActivity" + android:label="@string/app_name" > + <intent-filter> + <action android:name="android.intent.action.MAIN" /> + + <category android:name="android.intent.category.LAUNCHER" /> + </intent-filter> + </activity> + <activity + android:name="com.example.piztor.Running" + android:label="@string/title_activity_running" > + </activity> + </application> + +</manifest> diff --git a/client/activity-demo/Piztor/bin/AndroidManifest.xml b/client/activity-demo/Piztor/bin/AndroidManifest.xml new file mode 100644 index 0000000..10e170f --- /dev/null +++ b/client/activity-demo/Piztor/bin/AndroidManifest.xml @@ -0,0 +1,37 @@ +<?xml version="1.0" encoding="utf-8"?> +<manifest xmlns:android="http://schemas.android.com/apk/res/android" + package="com.example.piztor" + android:versionCode="1" + android:versionName="1.0" > + + <uses-permission android:name="android.permission.INTERNET" /> + <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> + <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/> + <uses-permission android:name="android.permission.WAKE_LOCK"/> + <uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/> + + <uses-sdk + android:minSdkVersion="9" + android:targetSdkVersion="17" /> + + <application + android:allowBackup="true" + android:icon="@drawable/ic_launcher" + android:label="@string/app_name" + android:theme="@style/AppTheme" > + <activity + android:name="com.example.piztor.MainActivity" + android:label="@string/app_name" > + <intent-filter> + <action android:name="android.intent.action.MAIN" /> + + <category android:name="android.intent.category.LAUNCHER" /> + </intent-filter> + </activity> + <activity + android:name="com.example.piztor.Running" + android:label="@string/title_activity_running" > + </activity> + </application> + +</manifest> diff --git a/client/activity-demo/Piztor/bin/Piztor.apk b/client/activity-demo/Piztor/bin/Piztor.apk Binary files differnew file mode 100644 index 0000000..a27d301 --- /dev/null +++ b/client/activity-demo/Piztor/bin/Piztor.apk diff --git a/client/activity-demo/Piztor/bin/classes.dex b/client/activity-demo/Piztor/bin/classes.dex Binary files differnew file mode 100644 index 0000000..0c22f74 --- /dev/null +++ b/client/activity-demo/Piztor/bin/classes.dex diff --git a/client/activity-demo/Piztor/bin/classes/com/example/piztor/BuildConfig.class b/client/activity-demo/Piztor/bin/classes/com/example/piztor/BuildConfig.class Binary files differnew file mode 100644 index 0000000..05d2e99 --- /dev/null +++ b/client/activity-demo/Piztor/bin/classes/com/example/piztor/BuildConfig.class diff --git a/client/activity-demo/Piztor/bin/classes/com/example/piztor/Controller.class b/client/activity-demo/Piztor/bin/classes/com/example/piztor/Controller.class Binary files differnew file mode 100644 index 0000000..e9b16d2 --- /dev/null +++ b/client/activity-demo/Piztor/bin/classes/com/example/piztor/Controller.class diff --git a/client/activity-demo/Piztor/bin/classes/com/example/piztor/GPSTracker$1.class b/client/activity-demo/Piztor/bin/classes/com/example/piztor/GPSTracker$1.class Binary files differnew file mode 100644 index 0000000..997b8f5 --- /dev/null +++ b/client/activity-demo/Piztor/bin/classes/com/example/piztor/GPSTracker$1.class diff --git a/client/activity-demo/Piztor/bin/classes/com/example/piztor/GPSTracker$2.class b/client/activity-demo/Piztor/bin/classes/com/example/piztor/GPSTracker$2.class Binary files differnew file mode 100644 index 0000000..a01d5ea --- /dev/null +++ b/client/activity-demo/Piztor/bin/classes/com/example/piztor/GPSTracker$2.class diff --git a/client/activity-demo/Piztor/bin/classes/com/example/piztor/GPSTracker.class b/client/activity-demo/Piztor/bin/classes/com/example/piztor/GPSTracker.class Binary files differnew file mode 100644 index 0000000..ae89879 --- /dev/null +++ b/client/activity-demo/Piztor/bin/classes/com/example/piztor/GPSTracker.class diff --git a/client/activity-demo/Piztor/bin/classes/com/example/piztor/Login.class b/client/activity-demo/Piztor/bin/classes/com/example/piztor/Login.class Binary files differnew file mode 100644 index 0000000..dd08b6f --- /dev/null +++ b/client/activity-demo/Piztor/bin/classes/com/example/piztor/Login.class diff --git a/client/activity-demo/Piztor/bin/classes/com/example/piztor/MainActivity$1.class b/client/activity-demo/Piztor/bin/classes/com/example/piztor/MainActivity$1.class Binary files differnew file mode 100644 index 0000000..b99a90c --- /dev/null +++ b/client/activity-demo/Piztor/bin/classes/com/example/piztor/MainActivity$1.class diff --git a/client/activity-demo/Piztor/bin/classes/com/example/piztor/MainActivity.class b/client/activity-demo/Piztor/bin/classes/com/example/piztor/MainActivity.class Binary files differnew file mode 100644 index 0000000..e8f5052 --- /dev/null +++ b/client/activity-demo/Piztor/bin/classes/com/example/piztor/MainActivity.class diff --git a/client/activity-demo/Piztor/bin/classes/com/example/piztor/MyView.class b/client/activity-demo/Piztor/bin/classes/com/example/piztor/MyView.class Binary files differnew file mode 100644 index 0000000..441b92c --- /dev/null +++ b/client/activity-demo/Piztor/bin/classes/com/example/piztor/MyView.class diff --git a/client/activity-demo/Piztor/bin/classes/com/example/piztor/Myrequest.class b/client/activity-demo/Piztor/bin/classes/com/example/piztor/Myrequest.class Binary files differnew file mode 100644 index 0000000..80893f6 --- /dev/null +++ b/client/activity-demo/Piztor/bin/classes/com/example/piztor/Myrequest.class diff --git a/client/activity-demo/Piztor/bin/classes/com/example/piztor/Myrespond.class b/client/activity-demo/Piztor/bin/classes/com/example/piztor/Myrespond.class Binary files differnew file mode 100644 index 0000000..a475cee --- /dev/null +++ b/client/activity-demo/Piztor/bin/classes/com/example/piztor/Myrespond.class diff --git a/client/activity-demo/Piztor/bin/classes/com/example/piztor/R$attr.class b/client/activity-demo/Piztor/bin/classes/com/example/piztor/R$attr.class Binary files differnew file mode 100644 index 0000000..bf7ee98 --- /dev/null +++ b/client/activity-demo/Piztor/bin/classes/com/example/piztor/R$attr.class diff --git a/client/activity-demo/Piztor/bin/classes/com/example/piztor/R$dimen.class b/client/activity-demo/Piztor/bin/classes/com/example/piztor/R$dimen.class Binary files differnew file mode 100644 index 0000000..a0d6549 --- /dev/null +++ b/client/activity-demo/Piztor/bin/classes/com/example/piztor/R$dimen.class diff --git a/client/activity-demo/Piztor/bin/classes/com/example/piztor/R$drawable.class b/client/activity-demo/Piztor/bin/classes/com/example/piztor/R$drawable.class Binary files differnew file mode 100644 index 0000000..0438e22 --- /dev/null +++ b/client/activity-demo/Piztor/bin/classes/com/example/piztor/R$drawable.class diff --git a/client/activity-demo/Piztor/bin/classes/com/example/piztor/R$id.class b/client/activity-demo/Piztor/bin/classes/com/example/piztor/R$id.class new file mode 100644 index 0000000..9139bf3 - |