新增优博讯适配器的部分代码
This commit is contained in:
6
.idea/vcs.xml
generated
Normal file
6
.idea/vcs.xml
generated
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="VcsDirectoryMappings">
|
||||||
|
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
BIN
app/libs/urobo.jar
Normal file
BIN
app/libs/urobo.jar
Normal file
Binary file not shown.
@ -61,6 +61,8 @@ import java.io.IOException;
|
|||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
|
import android.device.ScanManager;
|
||||||
|
import android.device.scanner.configuration.Triggering;
|
||||||
/**
|
/**
|
||||||
* 富力叶不兼容版本代码
|
* 富力叶不兼容版本代码
|
||||||
* import com.olc.scan.IScanCallBack;
|
* import com.olc.scan.IScanCallBack;
|
||||||
@ -70,6 +72,10 @@ import java.util.*;
|
|||||||
/*
|
/*
|
||||||
* DecodeInfoCallBack 接口 是seuic的 扫描 后 的 回调接口
|
* DecodeInfoCallBack 接口 是seuic的 扫描 后 的 回调接口
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单据窗口
|
||||||
|
*/
|
||||||
public class DjActivity extends TabActivity implements OnInitListener, DecodeInfoCallBack,
|
public class DjActivity extends TabActivity implements OnInitListener, DecodeInfoCallBack,
|
||||||
BarcodeReader.BarcodeListener,
|
BarcodeReader.BarcodeListener,
|
||||||
BarcodeReader.TriggerListener {
|
BarcodeReader.TriggerListener {
|
||||||
@ -136,24 +142,7 @@ public class DjActivity extends TabActivity implements OnInitListener, DecodeInf
|
|||||||
ttsNr = null;
|
ttsNr = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};// 声音提示停止接口
|
};
|
||||||
// /* 单据内容查询 */
|
|
||||||
// public Runnable downloadRun = new Runnable() {
|
|
||||||
// public void run() {
|
|
||||||
// Object ob;
|
|
||||||
// try {
|
|
||||||
// ob = getWeather(formlx);
|
|
||||||
// Message message = new Message();
|
|
||||||
// message.obj = ob;
|
|
||||||
// handler.sendMessage(message);
|
|
||||||
// } catch (Exception e) {
|
|
||||||
// Message message = new Message();
|
|
||||||
// message.obj = e.toString();
|
|
||||||
// message.what = -1;
|
|
||||||
// handler.sendMessage(message);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// };
|
|
||||||
/* 菜单栏查询 */
|
/* 菜单栏查询 */
|
||||||
Runnable menuRun = new Runnable() {
|
Runnable menuRun = new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
@ -180,7 +169,6 @@ public class DjActivity extends TabActivity implements OnInitListener, DecodeInf
|
|||||||
// 当有消息发送出来的时候就执行Handler的这个方法
|
// 当有消息发送出来的时候就执行Handler的这个方法
|
||||||
public void handleMessage(Message msg) {
|
public void handleMessage(Message msg) {
|
||||||
super.handleMessage(msg);
|
super.handleMessage(msg);
|
||||||
System.out.println("=========sd=================================" + msg.what);
|
|
||||||
if (msg.what == -1) {
|
if (msg.what == -1) {
|
||||||
if (pd != null) {
|
if (pd != null) {
|
||||||
pd.cancel();
|
pd.cancel();
|
||||||
@ -244,12 +232,6 @@ public class DjActivity extends TabActivity implements OnInitListener, DecodeInf
|
|||||||
pd.cancel();
|
pd.cancel();
|
||||||
DialogUtil.builder(DjActivity.this, "错误信息", "检索方案内容解析失败!", 0);
|
DialogUtil.builder(DjActivity.this, "错误信息", "检索方案内容解析失败!", 0);
|
||||||
}
|
}
|
||||||
// String sql = msg.obj.toString();
|
|
||||||
// String return_one = sql.substring(0, 1);
|
|
||||||
// sql = sql.substring(1, sql.length());
|
|
||||||
// Map map = SqlUtil.regSql(sql, hzTab, pageMap);
|
|
||||||
// pd.setMessage("正在执行检索方案");
|
|
||||||
// runSearch(map, return_one);
|
|
||||||
} else if (msg.arg1 == 1) {
|
} else if (msg.arg1 == 1) {
|
||||||
String sql = null;
|
String sql = null;
|
||||||
try {
|
try {
|
||||||
@ -260,15 +242,6 @@ public class DjActivity extends TabActivity implements OnInitListener, DecodeInf
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Map map = SqlUtil.regSql(sql, hzTab, pageMap);
|
Map map = SqlUtil.regSql(sql, hzTab, pageMap);
|
||||||
// if (mxData.size() > 0) {
|
|
||||||
// map.put("mxSql", mxSql);
|
|
||||||
// map.put("mxData",
|
|
||||||
// DjUtil.organizationMxData(mxData,
|
|
||||||
// pageMap.get("GZID")));
|
|
||||||
// } else {
|
|
||||||
// map.put("mxSql", "");
|
|
||||||
// map.put("mxData", null);
|
|
||||||
// }
|
|
||||||
map.put("gzid", pageMap.get("GZID"));
|
map.put("gzid", pageMap.get("GZID"));
|
||||||
map.put("mxTempTable", mxTempTable);
|
map.put("mxTempTable", mxTempTable);
|
||||||
Map hzData = DjUtil.organizationHzData(hzTab, pageMap.get("GZID"));
|
Map hzData = DjUtil.organizationHzData(hzTab, pageMap.get("GZID"));
|
||||||
@ -315,25 +288,12 @@ public class DjActivity extends TabActivity implements OnInitListener, DecodeInf
|
|||||||
super.handleMessage(msg);
|
super.handleMessage(msg);
|
||||||
View rootview = DjActivity.this.getWindow().getDecorView();
|
View rootview = DjActivity.this.getWindow().getDecorView();
|
||||||
View aaa = rootview.findFocus();
|
View aaa = rootview.findFocus();
|
||||||
// View bbb =
|
|
||||||
// hzTab.findViewWithTag(defaultFocus2.toUpperCase().trim());
|
|
||||||
// if (aaa == bbb && defaultFocus2 != null) {
|
|
||||||
// DjUtil.setFocus(hzTab, defaultFocus2);
|
|
||||||
// }
|
|
||||||
if (aaa instanceof SelfEditText) {
|
if (aaa instanceof SelfEditText) {
|
||||||
m_view = aaa;
|
m_view = aaa;
|
||||||
SelfEditText set = (SelfEditText)aaa;
|
SelfEditText set = (SelfEditText) aaa;
|
||||||
if (set.getText().length() > 0)
|
if (set.getText().length() > 0)
|
||||||
set.selectAll();
|
set.selectAll();
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
if (defaultFocus2 != null) {
|
|
||||||
View bbb = hzTab.findViewWithTag(defaultFocus2.toUpperCase().trim());
|
|
||||||
if (bbb instanceof SelfEditText) {
|
|
||||||
if (((SelfEditText)bbb).getText().length() > 0)
|
|
||||||
DjUtil.setFocus(hzTab, defaultFocus2);
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
if (msg.what == -1) {
|
if (msg.what == -1) {
|
||||||
pd.cancel();
|
pd.cancel();
|
||||||
DialogUtil.builder(DjActivity.this, "错误信息", "检索方案执行失败:" + msg.obj.toString(), 0);
|
DialogUtil.builder(DjActivity.this, "错误信息", "检索方案执行失败:" + msg.obj.toString(), 0);
|
||||||
@ -368,12 +328,9 @@ public class DjActivity extends TabActivity implements OnInitListener, DecodeInf
|
|||||||
}
|
}
|
||||||
String speakFld = (map.get("audioFld")).toString();
|
String speakFld = (map.get("audioFld")).toString();
|
||||||
if (map.get("return_one").equals("Y") && len < 2) {
|
if (map.get("return_one").equals("Y") && len < 2) {
|
||||||
// System.out.println("检索方案");
|
|
||||||
// if (len > 0) {
|
|
||||||
Map paramValueMap = (Map) dg.getTableData().get(0);
|
Map paramValueMap = (Map) dg.getTableData().get(0);
|
||||||
play(paramValueMap, speakFld);
|
play(paramValueMap, speakFld);
|
||||||
DjUtil.setUiValue(hzTab, paramValueMap, pageMap, imgHandler);
|
DjUtil.setUiValue(hzTab, paramValueMap, pageMap, imgHandler);
|
||||||
// }
|
|
||||||
} else {
|
} else {
|
||||||
Intent intent = new Intent();
|
Intent intent = new Intent();
|
||||||
intent.setClass(getApplicationContext(), ParamActivity.class);
|
intent.setClass(getApplicationContext(), ParamActivity.class);
|
||||||
@ -387,31 +344,7 @@ public class DjActivity extends TabActivity implements OnInitListener, DecodeInf
|
|||||||
}
|
}
|
||||||
pd.cancel();
|
pd.cancel();
|
||||||
} else if (msg.arg1 == 2) {// 页面修改方案
|
} else if (msg.arg1 == 2) {// 页面修改方案
|
||||||
// byte[] bb = org.kobjects.base64.Base64.decode(msg.obj
|
|
||||||
// .toString());
|
|
||||||
Object ob = msg.obj;
|
Object ob = msg.obj;
|
||||||
// try {
|
|
||||||
// ob = IoUtil.byte_obj(bb);
|
|
||||||
// } catch (Exception e) {
|
|
||||||
// DialogUtil.builder(DjActivity.this, "提示信息",
|
|
||||||
// "数据转换失败");
|
|
||||||
// }
|
|
||||||
// if (ob instanceof Map) {
|
|
||||||
// Map map = (Map) ob;
|
|
||||||
// DjUtil.setUiValue(hzTab, (List) map.get("hz"),
|
|
||||||
// pageMap, imgHandler);
|
|
||||||
// // mxData.clear();
|
|
||||||
// // mxData.addAll((List) map.get("mx"));
|
|
||||||
// // mxAdapter.notifyDataSetChanged();
|
|
||||||
// // System.out.println(map.get("msg"));
|
|
||||||
// if (map.get("msg") != null) {
|
|
||||||
// DialogUtil.builder(DjActivity.this, "提示信息", map
|
|
||||||
// .get("msg").toString());
|
|
||||||
// }
|
|
||||||
// } else {
|
|
||||||
// DialogUtil.builder(DjActivity.this, "提示信息",
|
|
||||||
// ob.toString());
|
|
||||||
// }
|
|
||||||
if (ob instanceof Map) {
|
if (ob instanceof Map) {
|
||||||
Map map = (Map) ob;
|
Map map = (Map) ob;
|
||||||
List<Map<String, Object>> list = (List<Map<String, Object>>) map.get("hz");
|
List<Map<String, Object>> list = (List<Map<String, Object>>) map.get("hz");
|
||||||
@ -422,10 +355,6 @@ public class DjActivity extends TabActivity implements OnInitListener, DecodeInf
|
|||||||
} else if ("MESSAGE_AUDIO".equals(tm.get("fieldname")))
|
} else if ("MESSAGE_AUDIO".equals(tm.get("fieldname")))
|
||||||
paramValueMap = tm;
|
paramValueMap = tm;
|
||||||
}
|
}
|
||||||
// Map paramValueMap = (Map)
|
|
||||||
// dg.getTableData().get(0);
|
|
||||||
// String speakFld =
|
|
||||||
// (map.get("audioFld")).toString();
|
|
||||||
play(paramValueMap, "fieldValue");
|
play(paramValueMap, "fieldValue");
|
||||||
DjUtil.setUiValue(hzTab, (List) map.get("hz"), pageMap, imgHandler);
|
DjUtil.setUiValue(hzTab, (List) map.get("hz"), pageMap, imgHandler);
|
||||||
|
|
||||||
@ -468,14 +397,6 @@ public class DjActivity extends TabActivity implements OnInitListener, DecodeInf
|
|||||||
String mess = msg.obj.toString();
|
String mess = msg.obj.toString();
|
||||||
if (mess.substring(0, 2).equals("ok")) {
|
if (mess.substring(0, 2).equals("ok")) {
|
||||||
String djbh = mess.substring(2, mess.length());
|
String djbh = mess.substring(2, mess.length());
|
||||||
// if(pageMap.containsKey("DJBH")){
|
|
||||||
// djbh=pageMap.get("DJBH").toString();
|
|
||||||
// }else{
|
|
||||||
// View et=hzTab.findViewWithTag("DJBH");
|
|
||||||
// if(et instanceof InputInterface){
|
|
||||||
// djbh=((InputInterface)et).getText().toString();
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
mxData.clear();
|
mxData.clear();
|
||||||
mxAdapter.notifyDataSetChanged();
|
mxAdapter.notifyDataSetChanged();
|
||||||
hzTab.setCurrentTab(0);
|
hzTab.setCurrentTab(0);
|
||||||
@ -492,7 +413,6 @@ public class DjActivity extends TabActivity implements OnInitListener, DecodeInf
|
|||||||
pd.cancel();
|
pd.cancel();
|
||||||
} else if (msg.arg1 == 4) {
|
} else if (msg.arg1 == 4) {
|
||||||
if (tabhost.getCurrentTab() != 0) {
|
if (tabhost.getCurrentTab() != 0) {
|
||||||
// hzTab.setCurrentTab(0);
|
|
||||||
hzTab.clearAllTabs();
|
hzTab.clearAllTabs();
|
||||||
mxData.clear();
|
mxData.clear();
|
||||||
fangAMap.clear();
|
fangAMap.clear();
|
||||||
@ -524,17 +444,12 @@ public class DjActivity extends TabActivity implements OnInitListener, DecodeInf
|
|||||||
|
|
||||||
}
|
}
|
||||||
if (nextFocusTag != null) {
|
if (nextFocusTag != null) {
|
||||||
// System.out.println(nextFocusTag
|
|
||||||
// + "----------------------------");
|
|
||||||
setNextFocus(nextFocusTag);
|
setNextFocus(nextFocusTag);
|
||||||
nextFocusTag = null;
|
nextFocusTag = null;
|
||||||
}
|
}
|
||||||
if (isLinghtScreen) {
|
if (isLinghtScreen) {
|
||||||
releaseLinghtScreen();
|
releaseLinghtScreen();
|
||||||
}
|
}
|
||||||
// if (dc != null) {
|
|
||||||
// dc.start();
|
|
||||||
// }
|
|
||||||
if (newScanControler != null) {
|
if (newScanControler != null) {
|
||||||
newScanControler.scanOnce();// 如果PDA是ht518 则一进入单据就打开扫描
|
newScanControler.scanOnce();// 如果PDA是ht518 则一进入单据就打开扫描
|
||||||
}
|
}
|
||||||
@ -551,7 +466,9 @@ public class DjActivity extends TabActivity implements OnInitListener, DecodeInf
|
|||||||
androidHandheldTerminal.start();
|
androidHandheldTerminal.start();
|
||||||
if (nr510ScanControl != null)
|
if (nr510ScanControl != null)
|
||||||
nr510ScanControl.start(DjActivity.this);
|
nr510ScanControl.start(DjActivity.this);
|
||||||
|
if(uroBoScannerControl!=null){
|
||||||
|
uroBoScannerControl.start();
|
||||||
|
}
|
||||||
if (barcodeReader != null) {
|
if (barcodeReader != null) {
|
||||||
continuousScanning(true);
|
continuousScanning(true);
|
||||||
}
|
}
|
||||||
@ -564,17 +481,6 @@ public class DjActivity extends TabActivity implements OnInitListener, DecodeInf
|
|||||||
reReadCode = true;
|
reReadCode = true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
/*
|
|
||||||
* mt35a 扫描所需变量 private DeviceControl DevCtrl; private SerialPort
|
|
||||||
* mSerialPort; public int fd; private ReadThread mReadThread; private
|
|
||||||
* static final String TAG = "SerialPort"; private boolean key_start =
|
|
||||||
* true;// 指明scan键的状态 private boolean Powered = false;// 指明扫头是否上电 private
|
|
||||||
* boolean Opened = false;// // 指明串口是否打开 private Timer timer = new Timer();
|
|
||||||
* private Timer retrig_timer = new Timer(); private SoundPool soundPool;
|
|
||||||
* private int soundId; private Handler succeed_handler = null; private
|
|
||||||
* Handler t_handler = null; private Handler n_handler = null; private
|
|
||||||
* boolean ops = false;// 指明程序是否初始化**
|
|
||||||
*/
|
|
||||||
/* 事件 */
|
/* 事件 */
|
||||||
public OnFocusChangeEvent focusEvent;
|
public OnFocusChangeEvent focusEvent;
|
||||||
public OnClickEvent clickEvent;
|
public OnClickEvent clickEvent;
|
||||||
@ -601,7 +507,6 @@ public class DjActivity extends TabActivity implements OnInitListener, DecodeInf
|
|||||||
try {
|
try {
|
||||||
DanJuEntity dj = (DanJuEntity) IoUtil.byte_obj2(danju.getFORM());
|
DanJuEntity dj = (DanJuEntity) IoUtil.byte_obj2(danju.getFORM());
|
||||||
if (SysData.is_lx) {// 如果是离线单据就在PDA上生成临时表
|
if (SysData.is_lx) {// 如果是离线单据就在PDA上生成临时表
|
||||||
System.out.println(danju.getFORMbs() + "-----" + formlx);
|
|
||||||
String tableName = "CR_DJBS_".concat(danju.getFORMbs()).concat(formlx);
|
String tableName = "CR_DJBS_".concat(danju.getFORMbs()).concat(formlx);
|
||||||
String createMxTableSql = "create table ".concat(tableName).concat("(gzid char(11),dj_sn int null default 0,");
|
String createMxTableSql = "create table ".concat(tableName).concat("(gzid char(11),dj_sn int null default 0,");
|
||||||
HashMap mxFiledMap = null;
|
HashMap mxFiledMap = null;
|
||||||
@ -626,7 +531,6 @@ public class DjActivity extends TabActivity implements OnInitListener, DecodeInf
|
|||||||
}
|
}
|
||||||
createMxTableSql = createMxTableSql.concat(" CONSTRAINT cr_").concat(danju.getFORMbs()).concat("_").concat(formlx)
|
createMxTableSql = createMxTableSql.concat(" CONSTRAINT cr_").concat(danju.getFORMbs()).concat("_").concat(formlx)
|
||||||
.concat("_PK PRIMARY KEY (gzid,dj_sn))");
|
.concat("_PK PRIMARY KEY (gzid,dj_sn))");
|
||||||
System.out.println(dj.mxzdArray.size() + "------------sql:" + createMxTableSql);
|
|
||||||
if (dbManager.existsTable(tableName) > 0) {
|
if (dbManager.existsTable(tableName) > 0) {
|
||||||
dbManager.exeSql("drop table ".concat(tableName));
|
dbManager.exeSql("drop table ".concat(tableName));
|
||||||
}
|
}
|
||||||
@ -641,13 +545,6 @@ public class DjActivity extends TabActivity implements OnInitListener, DecodeInf
|
|||||||
Dom4jUtil.testParseXMLData(in, DjActivity.this);
|
Dom4jUtil.testParseXMLData(in, DjActivity.this);
|
||||||
if (dj.mxzdArray.size() > 0) {
|
if (dj.mxzdArray.size() > 0) {
|
||||||
mxTitle.setText(((Map) dj.mxzdArray.get(0)).get("chnname").toString().trim());
|
mxTitle.setText(((Map) dj.mxzdArray.get(0)).get("chnname").toString().trim());
|
||||||
// mxAdapter = new SimpleAdapter(
|
|
||||||
// DjActivity.this,
|
|
||||||
// mxData,
|
|
||||||
// R.layout.activity_menu,
|
|
||||||
// new String[] { ((Map) dj.mxzdArray.get(0))
|
|
||||||
// .get("fdname").toString().trim().toUpperCase() },
|
|
||||||
// new int[] { R.id.title });
|
|
||||||
if (mxAdapter != null) {
|
if (mxAdapter != null) {
|
||||||
mxAdapter.clear();
|
mxAdapter.clear();
|
||||||
}
|
}
|
||||||
@ -699,7 +596,6 @@ public class DjActivity extends TabActivity implements OnInitListener, DecodeInf
|
|||||||
in = null;
|
in = null;
|
||||||
}
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
// TODO Auto-generated catch block
|
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -723,7 +619,6 @@ public class DjActivity extends TabActivity implements OnInitListener, DecodeInf
|
|||||||
|
|
||||||
public void queryMx(View v) {
|
public void queryMx(View v) {
|
||||||
if (mxQuerySql == null) {
|
if (mxQuerySql == null) {
|
||||||
// DialogUtil.builder(DjActivity.this, "提示信息", "明细未设置", 0);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
DialogUtil.setDialog(pd, "正在查询单据内容", "正在查询明细……");
|
DialogUtil.setDialog(pd, "正在查询单据内容", "正在查询明细……");
|
||||||
@ -736,15 +631,6 @@ public class DjActivity extends TabActivity implements OnInitListener, DecodeInf
|
|||||||
DialogUtil.builder(DjActivity.this, "提示信息", "请下载单据表", 0);
|
DialogUtil.builder(DjActivity.this, "提示信息", "请下载单据表", 0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// if (dbManager.existsTable("sys_SearchOptions".toUpperCase()) < 1)
|
|
||||||
// {
|
|
||||||
// DialogUtil.builder(DjActivity.this, "提示信息", "请下载检索方案表");
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// if (dbManager.existsTable("sys_YmupOptions".toUpperCase()) < 1) {
|
|
||||||
// DialogUtil.builder(DjActivity.this, "提示信息", "请下载页面修改方案表");
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
DialogUtil.setDialog(pd, "正在查询单据内容", "正在下载……");
|
DialogUtil.setDialog(pd, "正在查询单据内容", "正在下载……");
|
||||||
Map map = (Map) menuData.get(currentDjId);
|
Map map = (Map) menuData.get(currentDjId);
|
||||||
@ -759,7 +645,6 @@ public class DjActivity extends TabActivity implements OnInitListener, DecodeInf
|
|||||||
mxTempTable = null;
|
mxTempTable = null;
|
||||||
mxSql = null;
|
mxSql = null;
|
||||||
tabhost.setCurrentTab(1);
|
tabhost.setCurrentTab(1);
|
||||||
// hzTab.setCurrentTab(0);
|
|
||||||
hzTab.clearAllTabs();
|
hzTab.clearAllTabs();
|
||||||
if (SysData.is_lx) {
|
if (SysData.is_lx) {
|
||||||
new Thread(new LxDJNrThread(dbManager, handler, formlx)).start();
|
new Thread(new LxDJNrThread(dbManager, handler, formlx)).start();
|
||||||
@ -772,10 +657,6 @@ public class DjActivity extends TabActivity implements OnInitListener, DecodeInf
|
|||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.activity_dj);
|
setContentView(R.layout.activity_dj);
|
||||||
// layout = new RelativeLayout(this);
|
|
||||||
// layout.setLayoutParams(new RelativeLayout.LayoutParams(-1, -1));
|
|
||||||
// layout.setBackgroundColor(Color.WHITE);
|
|
||||||
// setContentView(layout);
|
|
||||||
if (SysData.url != null) {
|
if (SysData.url != null) {
|
||||||
this.setTitle(SysData.no + " " + SysData.url.substring(SysData.url.indexOf("//") + 2, 24));
|
this.setTitle(SysData.no + " " + SysData.url.substring(SysData.url.indexOf("//") + 2, 24));
|
||||||
}
|
}
|
||||||
@ -796,7 +677,7 @@ public class DjActivity extends TabActivity implements OnInitListener, DecodeInf
|
|||||||
public void onCancel(DialogInterface dialog) {
|
public void onCancel(DialogInterface dialog) {
|
||||||
if (m_view != null) {
|
if (m_view != null) {
|
||||||
if (m_view instanceof SelfEditText) {
|
if (m_view instanceof SelfEditText) {
|
||||||
((SelfEditText)m_view).selectAll();
|
((SelfEditText) m_view).selectAll();
|
||||||
}
|
}
|
||||||
m_view = null;
|
m_view = null;
|
||||||
}
|
}
|
||||||
@ -811,9 +692,6 @@ public class DjActivity extends TabActivity implements OnInitListener, DecodeInf
|
|||||||
}
|
}
|
||||||
tabhost = getTabHost();
|
tabhost = getTabHost();
|
||||||
tabhost.addTab(tabhost.newTabSpec("djmenu").setIndicator("菜单").setContent(R.id.djmenu));
|
tabhost.addTab(tabhost.newTabSpec("djmenu").setIndicator("菜单").setContent(R.id.djmenu));
|
||||||
// tabhost.addTab(tabhost.newTabSpec("hz").setIndicator("汇总")
|
|
||||||
// .setContent(R.id.hz));
|
|
||||||
// mxActivity=new MxActivity();
|
|
||||||
tabhost.addTab(tabhost.newTabSpec("hz").setIndicator("汇总").setContent(R.id.hz));
|
tabhost.addTab(tabhost.newTabSpec("hz").setIndicator("汇总").setContent(R.id.hz));
|
||||||
tabhost.addTab(tabhost.newTabSpec("mx").setIndicator("明细").setContent(R.id.mx));
|
tabhost.addTab(tabhost.newTabSpec("mx").setIndicator("明细").setContent(R.id.mx));
|
||||||
TabWidget tabwidget = tabhost.getTabWidget();
|
TabWidget tabwidget = tabhost.getTabWidget();
|
||||||
@ -833,7 +711,7 @@ public class DjActivity extends TabActivity implements OnInitListener, DecodeInf
|
|||||||
layoutParams.leftMargin = 0;
|
layoutParams.leftMargin = 0;
|
||||||
((LinearLayout) findViewById(R.id.djmenu)).addView(menuList, layoutParams);
|
((LinearLayout) findViewById(R.id.djmenu)).addView(menuList, layoutParams);
|
||||||
} else {
|
} else {
|
||||||
menuAdapter = new SimpleAdapter(this, menuData, R.layout.activity_menu, new String[] { "mname" }, new int[] { R.id.title });
|
menuAdapter = new SimpleAdapter(this, menuData, R.layout.activity_menu, new String[]{"mname"}, new int[]{R.id.title});
|
||||||
// menuList = (ListView) findViewById(R.id.munuList);
|
// menuList = (ListView) findViewById(R.id.munuList);
|
||||||
menuList = new ListView(this);
|
menuList = new ListView(this);
|
||||||
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT);
|
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT);
|
||||||
@ -874,12 +752,8 @@ public class DjActivity extends TabActivity implements OnInitListener, DecodeInf
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
((Button) findViewById(R.id.mxbut)).performClick();
|
((Button) findViewById(R.id.mxbut)).performClick();
|
||||||
tabhost.setCurrentTab(2);
|
tabhost.setCurrentTab(2);
|
||||||
// tabhost.getTabWidget().setCurrentTab(2);
|
|
||||||
// DialogUtil.builder(DjActivity.this, "测试标题","测试内容!" +
|
|
||||||
// v.getLeft(), 18);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -887,7 +761,6 @@ public class DjActivity extends TabActivity implements OnInitListener, DecodeInf
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
tabhost.setCurrentTab(1);
|
tabhost.setCurrentTab(1);
|
||||||
if (defaultFocus2 != null) {
|
if (defaultFocus2 != null) {
|
||||||
DjUtil.setFocus(hzTab, defaultFocus2);
|
DjUtil.setFocus(hzTab, defaultFocus2);
|
||||||
@ -895,15 +768,13 @@ public class DjActivity extends TabActivity implements OnInitListener, DecodeInf
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// mxAdapter = new SimpleAdapter(this, mxData, R.layout.activity_menu,
|
|
||||||
// new String[] { "mname" }, new int[] { R.id.title });
|
|
||||||
phoneModel = android.os.Build.MODEL.toLowerCase();
|
phoneModel = android.os.Build.MODEL.toLowerCase();
|
||||||
System.out.println(phoneModel + "--------------phoneModel---------------");
|
System.out.println(phoneModel + "--------------phoneModel---------------");
|
||||||
if (phoneModel.equals("zk-r322a") || phoneModel.equals("zk-r322")|| phoneModel.equals("zk-r323")|| phoneModel.equals("zk-r323a")) {
|
if (phoneModel.equals("zk-r322a") || phoneModel.equals("zk-r322") || phoneModel.equals("zk-r323") || phoneModel.equals("zk-r323a")) {
|
||||||
zkr322aNew();
|
zkr322aNew();
|
||||||
}/* else if (phoneModel.equals("n1s")) {
|
}/* else if (phoneModel.equals("n1s")) {
|
||||||
haixinN1SInit();
|
haixinN1SInit();
|
||||||
} */else if (phoneModel.equals("ht518")) {
|
} */ else if (phoneModel.equals("ht518")) {
|
||||||
// ht518Init();
|
// ht518Init();
|
||||||
ht518InitNew();
|
ht518InitNew();
|
||||||
} else if (phoneModel.equals("al9") /*|| "cruise".equals(phoneModel)*/) {
|
} else if (phoneModel.equals("al9") /*|| "cruise".equals(phoneModel)*/) {
|
||||||
@ -911,11 +782,13 @@ public class DjActivity extends TabActivity implements OnInitListener, DecodeInf
|
|||||||
} else if ("cr-5w".equals(phoneModel) /*|| "android handheld terminal".equals(phoneModel)*/) {
|
} else if ("cr-5w".equals(phoneModel) /*|| "android handheld terminal".equals(phoneModel)*/) {
|
||||||
cr5wScanControl = new CR5WScanControl();
|
cr5wScanControl = new CR5WScanControl();
|
||||||
cr5wScanControl.init(DjActivity.this);
|
cr5wScanControl.init(DjActivity.this);
|
||||||
} else if("android handheld terminal".equals(phoneModel)) {
|
} else if ("android handheld terminal".equals(phoneModel)) {
|
||||||
androidHandheldTerminal0 = new AndroidHandheldTerminal0(DjActivity.this);
|
androidHandheldTerminal0 = new AndroidHandheldTerminal0(DjActivity.this);
|
||||||
//androidHandheldTerminal = new AndroidHandheldTerminal();
|
//androidHandheldTerminal = new AndroidHandheldTerminal();
|
||||||
} else if ("nr510".equals(phoneModel) || "android".equals(phoneModel)) {
|
} else if ("nr510".equals(phoneModel) || "android".equals(phoneModel)) {
|
||||||
nr510ScanControl = new Nr510ScanControl();
|
nr510ScanControl = new Nr510ScanControl();
|
||||||
|
}else if("i6200series".equals(phoneModel)){
|
||||||
|
uroBoScannerControl=new UroBoScannerControl();
|
||||||
} else if ("scanpal eda50".equals(phoneModel)) {
|
} else if ("scanpal eda50".equals(phoneModel)) {
|
||||||
// get bar code instance from MainActivity
|
// get bar code instance from MainActivity
|
||||||
// DialogUtil.builder(DjActivity.this, "信息", "初始化失败:111111111111111111", 0);
|
// DialogUtil.builder(DjActivity.this, "信息", "初始化失败:111111111111111111", 0);
|
||||||
@ -1181,6 +1054,8 @@ public class DjActivity extends TabActivity implements OnInitListener, DecodeInf
|
|||||||
androidHandheldTerminal0.start();
|
androidHandheldTerminal0.start();
|
||||||
} else if (haixinN1SDemoReceiver != null) {
|
} else if (haixinN1SDemoReceiver != null) {
|
||||||
haixinN1sStart();
|
haixinN1sStart();
|
||||||
|
}else if(uroBoScannerControl!=null){
|
||||||
|
uroBoScannerControl.start();
|
||||||
}
|
}
|
||||||
if (seuicScanner != null) {// seuic PDA操作
|
if (seuicScanner != null) {// seuic PDA操作
|
||||||
boolean b = seuicScanner.open();
|
boolean b = seuicScanner.open();
|
||||||
@ -1208,13 +1083,14 @@ public class DjActivity extends TabActivity implements OnInitListener, DecodeInf
|
|||||||
System.out.println("onStart");
|
System.out.println("onStart");
|
||||||
if (newScanControler != null) {
|
if (newScanControler != null) {
|
||||||
newScanControler.scanOnce();
|
newScanControler.scanOnce();
|
||||||
}
|
} else if (seuicScanner != null) {
|
||||||
else if (seuicScanner != null) {
|
|
||||||
seuicScanner.setDecodeInfoCallBack(this);
|
seuicScanner.setDecodeInfoCallBack(this);
|
||||||
seuicScanner.open();
|
seuicScanner.open();
|
||||||
}
|
} else if (cr5wScanControl != null)
|
||||||
else if (cr5wScanControl != null)
|
|
||||||
cr5wScanControl.start(DjActivity.this);
|
cr5wScanControl.start(DjActivity.this);
|
||||||
|
else if(uroBoScannerControl!=null){
|
||||||
|
uroBoScannerControl.start();
|
||||||
|
}
|
||||||
else if (nr510ScanControl != null)
|
else if (nr510ScanControl != null)
|
||||||
nr510ScanControl.start(DjActivity.this);
|
nr510ScanControl.start(DjActivity.this);
|
||||||
else if (androidHandheldTerminal != null)
|
else if (androidHandheldTerminal != null)
|
||||||
@ -1238,8 +1114,7 @@ public class DjActivity extends TabActivity implements OnInitListener, DecodeInf
|
|||||||
super.onPause();
|
super.onPause();
|
||||||
if (newScanControler != null) {
|
if (newScanControler != null) {
|
||||||
newScanControler.stopScan();
|
newScanControler.stopScan();
|
||||||
}
|
} else if (cr5wScanControl != null)
|
||||||
else if (cr5wScanControl != null)
|
|
||||||
cr5wScanControl.stop(DjActivity.this);
|
cr5wScanControl.stop(DjActivity.this);
|
||||||
else if (nr510ScanControl != null)
|
else if (nr510ScanControl != null)
|
||||||
nr510ScanControl.stop(DjActivity.this);
|
nr510ScanControl.stop(DjActivity.this);
|
||||||
@ -1249,6 +1124,8 @@ public class DjActivity extends TabActivity implements OnInitListener, DecodeInf
|
|||||||
androidHandheldTerminal0.stop();
|
androidHandheldTerminal0.stop();
|
||||||
} else if (haixinN1SDemoReceiver != null) {
|
} else if (haixinN1SDemoReceiver != null) {
|
||||||
haixinN1sStop();
|
haixinN1sStop();
|
||||||
|
}else if(uroBoScannerControl!=null){
|
||||||
|
uroBoScannerControl.stop();
|
||||||
}
|
}
|
||||||
System.out.println("onPause");
|
System.out.println("onPause");
|
||||||
if (seuicScanner != null) {// seuic PDA操作
|
if (seuicScanner != null) {// seuic PDA操作
|
||||||
@ -1700,6 +1577,8 @@ public class DjActivity extends TabActivity implements OnInitListener, DecodeInf
|
|||||||
nr510ScanControl.stop(DjActivity.this);
|
nr510ScanControl.stop(DjActivity.this);
|
||||||
else if (haixinN1SDemoReceiver != null) {
|
else if (haixinN1SDemoReceiver != null) {
|
||||||
haixinN1sStop();
|
haixinN1sStop();
|
||||||
|
}else if(uroBoScannerControl!=null){
|
||||||
|
uroBoScannerControl.stop();
|
||||||
}
|
}
|
||||||
// else if (androidHandheldTerminal0 != null)
|
// else if (androidHandheldTerminal0 != null)
|
||||||
// androidHandheldTerminal0.stop();
|
// androidHandheldTerminal0.stop();
|
||||||
@ -1726,6 +1605,8 @@ public class DjActivity extends TabActivity implements OnInitListener, DecodeInf
|
|||||||
androidHandheldTerminal.stop();
|
androidHandheldTerminal.stop();
|
||||||
else if (haixinN1SDemoReceiver != null) {
|
else if (haixinN1SDemoReceiver != null) {
|
||||||
haixinN1sStop();
|
haixinN1sStop();
|
||||||
|
}else if(uroBoScannerControl!=null){
|
||||||
|
uroBoScannerControl.stop();
|
||||||
}
|
}
|
||||||
// else if (androidHandheldTerminal0 != null)
|
// else if (androidHandheldTerminal0 != null)
|
||||||
// androidHandheldTerminal0.stop();
|
// androidHandheldTerminal0.stop();
|
||||||
@ -1802,13 +1683,10 @@ public class DjActivity extends TabActivity implements OnInitListener, DecodeInf
|
|||||||
|
|
||||||
/* 运行检索方案 */
|
/* 运行检索方案 */
|
||||||
public void runSearch(Map map, String return_one, String audioFld) {
|
public void runSearch(Map map, String return_one, String audioFld) {
|
||||||
// new SearchThread(formlx, "WMSW87_01", sqlHandler).start();
|
|
||||||
try {
|
try {
|
||||||
new RunSearchThread(map.get("sql").toString(), IoUtil.ob_base64(map.get("param")), runHandler, return_one, audioFld).start();
|
new RunSearchThread(map.get("sql").toString(), IoUtil.ob_base64(map.get("param")), runHandler, return_one, audioFld).start();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
// TODO Auto-generated catch block
|
|
||||||
DialogUtil.builder(this, "错误信息", "转换成Base64编码失败!", 0);
|
DialogUtil.builder(this, "错误信息", "转换成Base64编码失败!", 0);
|
||||||
// e.printStackTrace();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1821,9 +1699,7 @@ public class DjActivity extends TabActivity implements OnInitListener, DecodeInf
|
|||||||
public void onInit(int status) {
|
public void onInit(int status) {
|
||||||
if (status == TextToSpeech.SUCCESS) {
|
if (status == TextToSpeech.SUCCESS) {
|
||||||
tts.setLanguage(Locale.CHINA);
|
tts.setLanguage(Locale.CHINA);
|
||||||
}
|
} else if (status == TextToSpeech.ERROR) {
|
||||||
|
|
||||||
else if (status == TextToSpeech.ERROR) {
|
|
||||||
Toast.makeText(DjActivity.this, "始化文本到语音引擎时发生错误", Toast.LENGTH_LONG).show();
|
Toast.makeText(DjActivity.this, "始化文本到语音引擎时发生错误", Toast.LENGTH_LONG).show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1974,8 +1850,10 @@ public class DjActivity extends TabActivity implements OnInitListener, DecodeInf
|
|||||||
|
|
||||||
// 富力叶 android handheld terminal 扫描头
|
// 富力叶 android handheld terminal 扫描头
|
||||||
AndroidHandheldTerminal0 androidHandheldTerminal0 = null;
|
AndroidHandheldTerminal0 androidHandheldTerminal0 = null;
|
||||||
|
|
||||||
public class AndroidHandheldTerminal0 {
|
public class AndroidHandheldTerminal0 {
|
||||||
public boolean running = true;
|
public boolean running = true;
|
||||||
|
|
||||||
public AndroidHandheldTerminal0(final Context context) {
|
public AndroidHandheldTerminal0(final Context context) {
|
||||||
ScanHelper.setScanSwitchLeft(context, true);
|
ScanHelper.setScanSwitchLeft(context, true);
|
||||||
ScanHelper.setScanSwitchRight(context, true);
|
ScanHelper.setScanSwitchRight(context, true);
|
||||||
@ -2009,12 +1887,13 @@ public class DjActivity extends TabActivity implements OnInitListener, DecodeInf
|
|||||||
|
|
||||||
private String m_Broadcastname = null;
|
private String m_Broadcastname = null;
|
||||||
private MyCodeReceiver myCodeReceiver = new MyCodeReceiver();
|
private MyCodeReceiver myCodeReceiver = new MyCodeReceiver();
|
||||||
public class MyCodeReceiver extends BroadcastReceiver
|
|
||||||
{
|
public class MyCodeReceiver extends BroadcastReceiver {
|
||||||
private static final String TAG = "MycodeReceiver";
|
private static final String TAG = "MycodeReceiver";
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onReceive(Context context, Intent intent) {
|
public void onReceive(Context context, Intent intent) {
|
||||||
if(androidHandheldTerminal0.running && intent.getAction().equals(m_Broadcastname)) {
|
if (androidHandheldTerminal0.running && intent.getAction().equals(m_Broadcastname)) {
|
||||||
String str = intent.getStringExtra("BARCODE");
|
String str = intent.getStringExtra("BARCODE");
|
||||||
if (!"".equals(str)) {
|
if (!"".equals(str)) {
|
||||||
View rootview = DjActivity.this.getWindow().getDecorView();
|
View rootview = DjActivity.this.getWindow().getDecorView();
|
||||||
@ -2025,7 +1904,7 @@ public class DjActivity extends TabActivity implements OnInitListener, DecodeInf
|
|||||||
// DjUtil.setFocus(hzTab, defaultFocus2);
|
// DjUtil.setFocus(hzTab, defaultFocus2);
|
||||||
// }
|
// }
|
||||||
if (aaa instanceof SelfEditText) {
|
if (aaa instanceof SelfEditText) {
|
||||||
SelfEditText set = (SelfEditText)aaa;
|
SelfEditText set = (SelfEditText) aaa;
|
||||||
set.setText(str);
|
set.setText(str);
|
||||||
//if (set.closeKeyBoard) {
|
//if (set.closeKeyBoard) {
|
||||||
// set.dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_ENTER));
|
// set.dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_ENTER));
|
||||||
@ -2045,6 +1924,7 @@ public class DjActivity extends TabActivity implements OnInitListener, DecodeInf
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 海信 n1s 设备扫描头控制
|
// 海信 n1s 设备扫描头控制
|
||||||
public static final String HAIXIN_N1S_ACTION_SCAN_RESULT = "android.provider.sdlMessage";
|
public static final String HAIXIN_N1S_ACTION_SCAN_RESULT = "android.provider.sdlMessage";
|
||||||
public static boolean haixinN1SStart = false;
|
public static boolean haixinN1SStart = false;
|
||||||
@ -2078,9 +1958,8 @@ public class DjActivity extends TabActivity implements OnInitListener, DecodeInf
|
|||||||
// DjUtil.setFocus(hzTab, defaultFocus2);
|
// DjUtil.setFocus(hzTab, defaultFocus2);
|
||||||
// }
|
// }
|
||||||
if (aaa instanceof SelfEditText) {
|
if (aaa instanceof SelfEditText) {
|
||||||
SelfEditText set = (SelfEditText)aaa;
|
SelfEditText set = (SelfEditText) aaa;
|
||||||
set.setText(scanResultStr);
|
set.setText(scanResultStr);
|
||||||
//
|
|
||||||
new Thread(new Runnable() {
|
new Thread(new Runnable() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -2095,7 +1974,6 @@ public class DjActivity extends TabActivity implements OnInitListener, DecodeInf
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -2118,6 +1996,7 @@ public class DjActivity extends TabActivity implements OnInitListener, DecodeInf
|
|||||||
// 富力叶 android handheld terminal 扫描头
|
// 富力叶 android handheld terminal 扫描头
|
||||||
|
|
||||||
public static AndroidHandheldTerminal androidHandheldTerminal = null;
|
public static AndroidHandheldTerminal androidHandheldTerminal = null;
|
||||||
|
|
||||||
/* 富力叶不兼容代码
|
/* 富力叶不兼容代码
|
||||||
private Handler androidHandheldTerminalHandler = new MainHandler();
|
private Handler androidHandheldTerminalHandler = new MainHandler();
|
||||||
|
|
||||||
@ -2248,7 +2127,7 @@ public class DjActivity extends TabActivity implements OnInitListener, DecodeInf
|
|||||||
};
|
};
|
||||||
/**
|
/**
|
||||||
* cr5w 设备扫描头控制
|
* cr5w 设备扫描头控制
|
||||||
* */
|
*/
|
||||||
public static CR5WScanControl cr5wScanControl = null;
|
public static CR5WScanControl cr5wScanControl = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -2304,7 +2183,7 @@ public class DjActivity extends TabActivity implements OnInitListener, DecodeInf
|
|||||||
// DjUtil.setFocus(hzTab, defaultFocus2);
|
// DjUtil.setFocus(hzTab, defaultFocus2);
|
||||||
// }
|
// }
|
||||||
if (aaa instanceof SelfEditText) {
|
if (aaa instanceof SelfEditText) {
|
||||||
SelfEditText set = (SelfEditText)aaa;
|
SelfEditText set = (SelfEditText) aaa;
|
||||||
if (set.closeKeyBoard) {
|
if (set.closeKeyBoard) {
|
||||||
set.setText(value);
|
set.setText(value);
|
||||||
set.dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_ENTER));
|
set.dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_ENTER));
|
||||||
@ -2463,7 +2342,7 @@ public class DjActivity extends TabActivity implements OnInitListener, DecodeInf
|
|||||||
if (rootview != null) {
|
if (rootview != null) {
|
||||||
View aaa = rootview.findFocus();
|
View aaa = rootview.findFocus();
|
||||||
if (aaa != null && aaa instanceof SelfEditText) {
|
if (aaa != null && aaa instanceof SelfEditText) {
|
||||||
final SelfEditText set = (SelfEditText)aaa;
|
final SelfEditText set = (SelfEditText) aaa;
|
||||||
set.setText(event2.getBarcodeData());
|
set.setText(event2.getBarcodeData());
|
||||||
// set.dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_ENTER));
|
// set.dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_ENTER));
|
||||||
// set.dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_ENTER));
|
// set.dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_ENTER));
|
||||||
@ -2515,7 +2394,7 @@ public class DjActivity extends TabActivity implements OnInitListener, DecodeInf
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void continuousScanning(final boolean bState){
|
public void continuousScanning(final boolean bState) {
|
||||||
// if (triggerState && bState) return;
|
// if (triggerState && bState) return;
|
||||||
// triggerState = bState;
|
// triggerState = bState;
|
||||||
|
|
||||||
@ -2546,4 +2425,70 @@ public class DjActivity extends TabActivity implements OnInitListener, DecodeInf
|
|||||||
//continuousScanning(true);
|
//continuousScanning(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 优博讯控制器
|
||||||
|
*/
|
||||||
|
UroBoScannerControl uroBoScannerControl=null;
|
||||||
|
public class UroBoScannerControl extends BroadcastReceiver {
|
||||||
|
private ScanManager mScanManager;
|
||||||
|
private Vibrator mVibrator;
|
||||||
|
private SoundPool soundPool;
|
||||||
|
private int soundid;
|
||||||
|
|
||||||
|
public UroBoScannerControl() {
|
||||||
|
mScanManager = new ScanManager();
|
||||||
|
mScanManager.openScanner();
|
||||||
|
mScanManager.switchOutputMode(0);
|
||||||
|
if (mScanManager.getTriggerMode() != Triggering.CONTINUOUS)
|
||||||
|
mScanManager.setTriggerMode(Triggering.CONTINUOUS);
|
||||||
|
|
||||||
|
|
||||||
|
soundPool = new SoundPool(1, AudioManager.STREAM_NOTIFICATION, 100); // MODE_RINGTONE
|
||||||
|
soundid = soundPool.load(DjActivity.this, R.raw.beep, 1);
|
||||||
|
|
||||||
|
mVibrator = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);
|
||||||
|
Window window = getWindow();
|
||||||
|
window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void start() {
|
||||||
|
mScanManager.startDecode();
|
||||||
|
IntentFilter filter = new IntentFilter();
|
||||||
|
filter.addAction(""); //添加action
|
||||||
|
registerReceiver(this, filter);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void stop() {
|
||||||
|
unregisterReceiver(this);
|
||||||
|
mScanManager.stopDecode();
|
||||||
|
mVibrator.cancel();
|
||||||
|
soundPool.release();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onReceive(Context context, Intent intent) {
|
||||||
|
soundPool.play(soundid, 1, 1, 0, 0, 1);
|
||||||
|
mVibrator.vibrate(100);
|
||||||
|
|
||||||
|
byte[] barcode = intent.getByteArrayExtra("barocode");
|
||||||
|
int barocodelen = intent.getIntExtra("length", 0);
|
||||||
|
String barcodeStr = new String(barcode, 0, barocodelen);
|
||||||
|
handler.post(new Runnable() {
|
||||||
|
public void run() {
|
||||||
|
View rootview = DjActivity.this.getWindow().getDecorView();
|
||||||
|
View aaa = rootview.findFocus();
|
||||||
|
if (aaa instanceof SelfEditText) {
|
||||||
|
SelfEditText set = (SelfEditText) aaa;
|
||||||
|
if (set.closeKeyBoard) {
|
||||||
|
set.setText(barcodeStr);
|
||||||
|
set.dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_ENTER));
|
||||||
|
set.dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_ENTER));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,23 +1,5 @@
|
|||||||
package com.example.chaoran;
|
package com.example.chaoran;
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Set;
|
|
||||||
|
|
||||||
import org.kobjects.base64.Base64;
|
|
||||||
|
|
||||||
import com.chaoran.component.MyAdapter;
|
|
||||||
import com.chaoran.entiry.DataGrid;
|
|
||||||
import com.chaoran.entiry.Djselefa;
|
|
||||||
import com.example.chaoran.R;
|
|
||||||
import com.util.DialogUtil;
|
|
||||||
import com.util.IoUtil;
|
|
||||||
import com.util.SqlUtil;
|
|
||||||
import com.util.SysUtil;
|
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.ProgressDialog;
|
import android.app.ProgressDialog;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
@ -27,11 +9,26 @@ import android.os.Message;
|
|||||||
import android.view.KeyEvent;
|
import android.view.KeyEvent;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.AdapterView;
|
import android.widget.AdapterView;
|
||||||
|
import android.widget.AdapterView.OnItemClickListener;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
import android.widget.ListView;
|
import android.widget.ListView;
|
||||||
import android.widget.AdapterView.OnItemClickListener;
|
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
import com.chaoran.component.MyAdapter;
|
||||||
|
import com.chaoran.entiry.DataGrid;
|
||||||
|
import com.chaoran.entiry.Djselefa;
|
||||||
|
import com.util.DialogUtil;
|
||||||
|
import com.util.IoUtil;
|
||||||
|
import com.util.SqlUtil;
|
||||||
|
import com.util.SysUtil;
|
||||||
|
import org.kobjects.base64.Base64;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单据提取窗口
|
||||||
|
*/
|
||||||
public class DjtqActivity extends Activity {
|
public class DjtqActivity extends Activity {
|
||||||
private ListView listview;
|
private ListView listview;
|
||||||
private int cur_pos = -1;// 当前显示的一行
|
private int cur_pos = -1;// 当前显示的一行
|
||||||
|
|||||||
@ -11,6 +11,9 @@ import android.util.Log;
|
|||||||
|
|
||||||
import com.sys.SysData;
|
import com.sys.SysData;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退出线程
|
||||||
|
*/
|
||||||
public class ExitThread extends Thread {
|
public class ExitThread extends Thread {
|
||||||
public String gzid;
|
public String gzid;
|
||||||
public String mxTempTable;
|
public String mxTempTable;
|
||||||
|
|||||||
@ -1,64 +1,23 @@
|
|||||||
package com.example.chaoran;
|
package com.example.chaoran;
|
||||||
|
|
||||||
import java.io.BufferedInputStream;
|
|
||||||
import java.io.BufferedReader;
|
|
||||||
import java.io.BufferedWriter;
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.FileInputStream;
|
|
||||||
import java.io.FileNotFoundException;
|
|
||||||
import java.io.FileOutputStream;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.InputStream;
|
|
||||||
import java.io.InputStreamReader;
|
|
||||||
import java.io.OutputStreamWriter;
|
|
||||||
import java.net.HttpURLConnection;
|
|
||||||
import java.net.URL;
|
|
||||||
import java.util.Properties;
|
|
||||||
|
|
||||||
import org.ksoap2.SoapEnvelope;
|
|
||||||
import org.ksoap2.serialization.SoapObject;
|
|
||||||
import org.ksoap2.serialization.SoapSerializationEnvelope;
|
|
||||||
import org.ksoap2.transport.HttpTransportSE;
|
|
||||||
import org.xmlpull.v1.XmlPullParserException;
|
|
||||||
|
|
||||||
import com.chaoran.db.DBManager;
|
|
||||||
import com.chaoran.db.SqlHelpUtil;
|
|
||||||
import com.chaoran.entiry.UpdataInfo;
|
|
||||||
import com.chaoran.entiry.UserList;
|
|
||||||
import com.chaoran.lx.activity.DownDataActivity;
|
|
||||||
import com.chaoran.thread.DownApk;
|
|
||||||
import com.example.chaoran.R;
|
|
||||||
import com.honeywell.aidc.AidcManager;
|
|
||||||
import com.honeywell.aidc.AidcManager.CreatedCallback;
|
|
||||||
import com.honeywell.aidc.BarcodeReader;
|
|
||||||
import com.sys.SysData;
|
|
||||||
import com.util.DialogUtil;
|
|
||||||
import com.util.Dom4jUtil;
|
|
||||||
import com.util.InstallUtil;
|
|
||||||
import com.util.IoUtil;
|
|
||||||
import com.util.SysUtil;
|
|
||||||
|
|
||||||
import android.content.pm.ActivityInfo;
|
|
||||||
import android.content.pm.PackageInfo;
|
|
||||||
import android.content.pm.PackageManager.NameNotFoundException;
|
|
||||||
|
|
||||||
import android.net.wifi.WifiManager;
|
|
||||||
import android.os.Bundle;
|
|
||||||
import android.os.Handler;
|
|
||||||
import android.os.Message;
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.AlertDialog;
|
import android.app.AlertDialog;
|
||||||
import android.app.ProgressDialog;
|
|
||||||
import android.app.AlertDialog.Builder;
|
import android.app.AlertDialog.Builder;
|
||||||
import android.content.Context;
|
import android.app.ProgressDialog;
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.content.SharedPreferences.Editor;
|
import android.content.SharedPreferences.Editor;
|
||||||
|
import android.content.pm.ActivityInfo;
|
||||||
|
import android.content.pm.PackageInfo;
|
||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
|
import android.content.pm.PackageManager.NameNotFoundException;
|
||||||
import android.content.res.Configuration;
|
import android.content.res.Configuration;
|
||||||
import android.database.Cursor;
|
import android.database.Cursor;
|
||||||
import android.database.sqlite.SQLiteDatabase;
|
import android.database.sqlite.SQLiteDatabase;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.os.Handler;
|
||||||
|
import android.os.Message;
|
||||||
import android.view.KeyEvent;
|
import android.view.KeyEvent;
|
||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
@ -67,7 +26,29 @@ import android.widget.CheckBox;
|
|||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
import com.chaoran.db.DBManager;
|
||||||
|
import com.chaoran.db.SqlHelpUtil;
|
||||||
|
import com.chaoran.entiry.UpdataInfo;
|
||||||
|
import com.chaoran.entiry.UserList;
|
||||||
|
import com.chaoran.lx.activity.DownDataActivity;
|
||||||
|
import com.chaoran.thread.DownApk;
|
||||||
|
import com.honeywell.aidc.AidcManager;
|
||||||
|
import com.honeywell.aidc.AidcManager.CreatedCallback;
|
||||||
|
import com.honeywell.aidc.BarcodeReader;
|
||||||
|
import com.sys.SysData;
|
||||||
|
import com.util.*;
|
||||||
|
import org.ksoap2.SoapEnvelope;
|
||||||
|
import org.ksoap2.serialization.SoapObject;
|
||||||
|
import org.ksoap2.serialization.SoapSerializationEnvelope;
|
||||||
|
import org.ksoap2.transport.HttpTransportSE;
|
||||||
|
|
||||||
|
import java.io.*;
|
||||||
|
import java.net.HttpURLConnection;
|
||||||
|
import java.net.URL;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主活动窗口
|
||||||
|
*/
|
||||||
public class MainActivity extends Activity {
|
public class MainActivity extends Activity {
|
||||||
SqlHelpUtil db;
|
SqlHelpUtil db;
|
||||||
SQLiteDatabase sDatabase;
|
SQLiteDatabase sDatabase;
|
||||||
@ -103,8 +84,6 @@ public class MainActivity extends Activity {
|
|||||||
DialogUtil.builder(MainActivity.this, "错误信息", "更新文件失败!",0);
|
DialogUtil.builder(MainActivity.this, "错误信息", "更新文件失败!",0);
|
||||||
} else if (msg.what == 1) {
|
} else if (msg.what == 1) {
|
||||||
UpdataInfo info = (UpdataInfo) msg.obj;
|
UpdataInfo info = (UpdataInfo) msg.obj;
|
||||||
System.out.println(info+"---------------------");
|
|
||||||
System.out.println(versionStr+"---------------------");
|
|
||||||
if (info!=null&&!info.getVersion().equals(versionStr)) {
|
if (info!=null&&!info.getVersion().equals(versionStr)) {
|
||||||
showUpdataDialog(info);
|
showUpdataDialog(info);
|
||||||
}
|
}
|
||||||
@ -115,7 +94,6 @@ public class MainActivity extends Activity {
|
|||||||
DialogUtil.builder(MainActivity.this, "提示信息", "该功能未授权!",0);
|
DialogUtil.builder(MainActivity.this, "提示信息", "该功能未授权!",0);
|
||||||
} else {
|
} else {
|
||||||
UserList user = (UserList) msg.obj;
|
UserList user = (UserList) msg.obj;
|
||||||
// System.out.println(so.hasProperty("lgnname"));
|
|
||||||
if (user.getLgnname() == null) {
|
if (user.getLgnname() == null) {
|
||||||
String udesc = user.getUdesc();
|
String udesc = user.getUdesc();
|
||||||
if (udesc.equals("0")) {
|
if (udesc.equals("0")) {
|
||||||
@ -136,29 +114,8 @@ public class MainActivity extends Activity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// SysData.username=
|
|
||||||
// so.getProperty("username").toString().trim();
|
|
||||||
SysData.is_lx = false;
|
SysData.is_lx = false;
|
||||||
login_end(user);
|
login_end(user);
|
||||||
// SysData.jigid = user.getJigid();
|
|
||||||
// SysData.lgnname = user.getLgnname();
|
|
||||||
// SysData.userid = String.valueOf(user.getUserid());
|
|
||||||
// SysData.scale = MainActivity.this.getResources()
|
|
||||||
// .getDisplayMetrics().density + 1;
|
|
||||||
// SharedPreferences sp = MainActivity.this
|
|
||||||
// .getSharedPreferences("userTxt", MODE_PRIVATE);
|
|
||||||
// Editor editor = sp.edit();
|
|
||||||
// editor.putString("name", name.getText().toString()
|
|
||||||
// .trim());
|
|
||||||
// editor.putString("pwd",
|
|
||||||
// pwd.getText().toString().trim());
|
|
||||||
// editor.commit();
|
|
||||||
// Intent intent = new Intent();
|
|
||||||
// intent.putExtra("displaymode",
|
|
||||||
// user.getDisplaymode());
|
|
||||||
// intent.setClass(getApplicationContext(),
|
|
||||||
// DjActivity.class);
|
|
||||||
// startActivity(intent);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -185,16 +142,10 @@ public class MainActivity extends Activity {
|
|||||||
SysData.lgnname = user.getLgnname();
|
SysData.lgnname = user.getLgnname();
|
||||||
SysData.userid = String.valueOf(user.getUserid());
|
SysData.userid = String.valueOf(user.getUserid());
|
||||||
SysData.scale = MainActivity.this.getResources().getDisplayMetrics().density + 1;
|
SysData.scale = MainActivity.this.getResources().getDisplayMetrics().density + 1;
|
||||||
//SysData.t_scale = MainActivity.this.getResources().getDisplayMetrics().densityDpi >= 200f ? 200f / MainActivity.this.getResources().getDisplayMetrics().densityDpi : 200f * 0.95f / MainActivity.this.getResources().getDisplayMetrics().densityDpi;
|
|
||||||
SysData.t_scale = MainActivity.this.getResources().getDisplayMetrics().densityDpi >= 300f ? 1 : 300f * def_pbl / MainActivity.this.getResources().getDisplayMetrics().densityDpi;
|
SysData.t_scale = MainActivity.this.getResources().getDisplayMetrics().densityDpi >= 300f ? 1 : 300f * def_pbl / MainActivity.this.getResources().getDisplayMetrics().densityDpi;
|
||||||
SysData.exectime=Integer.parseInt(user.getUdesc() == null ? "60" : user.getUdesc());
|
SysData.exectime=Integer.parseInt(user.getUdesc() == null ? "60" : user.getUdesc());
|
||||||
System.out.println(SysData.exectime+"---------------------------------------SysData.exectime");
|
|
||||||
SharedPreferences sp = MainActivity.this.getSharedPreferences(
|
SharedPreferences sp = MainActivity.this.getSharedPreferences(
|
||||||
"userTxt", MODE_PRIVATE);
|
"userTxt", MODE_PRIVATE);
|
||||||
// Editor editor = sp.edit();
|
|
||||||
// editor.putString("name", name.getText().toString().trim());
|
|
||||||
// editor.putString("pwd", pwd.getText().toString().trim());
|
|
||||||
// editor.commit();
|
|
||||||
if (checkBox.isChecked()) {
|
if (checkBox.isChecked()) {
|
||||||
Editor editor = sp.edit();
|
Editor editor = sp.edit();
|
||||||
editor.putString("name", name.getText().toString().trim());
|
editor.putString("name", name.getText().toString().trim());
|
||||||
@ -245,8 +196,6 @@ public class MainActivity extends Activity {
|
|||||||
TextView version = (TextView) findViewById(R.id.version);
|
TextView version = (TextView) findViewById(R.id.version);
|
||||||
versionStr=getVersionName();
|
versionStr=getVersionName();
|
||||||
version.setText("版本".concat(versionStr));
|
version.setText("版本".concat(versionStr));
|
||||||
// SysData.clientid = Secure.getString(getContentResolver(),
|
|
||||||
// Secure.ANDROID_ID);
|
|
||||||
SysData.clientid = SysUtil.getLocalMacAddress(MainActivity.this);
|
SysData.clientid = SysUtil.getLocalMacAddress(MainActivity.this);
|
||||||
db = new SqlHelpUtil(getApplicationContext());
|
db = new SqlHelpUtil(getApplicationContext());
|
||||||
sDatabase = db.getWritableDatabase();
|
sDatabase = db.getWritableDatabase();
|
||||||
@ -269,7 +218,6 @@ public class MainActivity extends Activity {
|
|||||||
new Thread(new CheckVersionTask()).start();
|
new Thread(new CheckVersionTask()).start();
|
||||||
new Thread(queryZcrq).start();
|
new Thread(queryZcrq).start();
|
||||||
}
|
}
|
||||||
//
|
|
||||||
BufferedReader br = null;
|
BufferedReader br = null;
|
||||||
BufferedWriter bw = null;
|
BufferedWriter bw = null;
|
||||||
File file = new File(getFilesDir().getAbsolutePath() + "/cr_pda_config");
|
File file = new File(getFilesDir().getAbsolutePath() + "/cr_pda_config");
|
||||||
@ -311,7 +259,6 @@ public class MainActivity extends Activity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//
|
|
||||||
if ("scanpal eda50".equals(android.os.Build.MODEL.toLowerCase())) {
|
if ("scanpal eda50".equals(android.os.Build.MODEL.toLowerCase())) {
|
||||||
AidcManager.create(this, new CreatedCallback() {
|
AidcManager.create(this, new CreatedCallback() {
|
||||||
|
|
||||||
@ -339,10 +286,6 @@ public class MainActivity extends Activity {
|
|||||||
public void run() {
|
public void run() {
|
||||||
try {
|
try {
|
||||||
String url = SysData.url + "/webservice/ServiceInterface?wsdl";
|
String url = SysData.url + "/webservice/ServiceInterface?wsdl";
|
||||||
// System.out
|
|
||||||
// .println(url
|
|
||||||
// +
|
|
||||||
// "--------------============================================");
|
|
||||||
String method = "regEndRq";
|
String method = "regEndRq";
|
||||||
SoapObject rpc = new SoapObject("", method);
|
SoapObject rpc = new SoapObject("", method);
|
||||||
HttpTransportSE ht = new HttpTransportSE(url, SysData.timeout);
|
HttpTransportSE ht = new HttpTransportSE(url, SysData.timeout);
|
||||||
@ -391,27 +334,15 @@ public class MainActivity extends Activity {
|
|||||||
public void onset(View v) {
|
public void onset(View v) {
|
||||||
Intent intent = new Intent();
|
Intent intent = new Intent();
|
||||||
intent.setClass(this, NetWorkSet.class);
|
intent.setClass(this, NetWorkSet.class);
|
||||||
// intent.setClass(getApplicationContext(), BDMapActivity.class);
|
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
// startActivityForResult(intent,0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onopentest(View v) {
|
public void onopentest(View v) {
|
||||||
DialogUtil.builder(this, "测试标题","测试内容!open" + v.getLeft(), 18);
|
DialogUtil.builder(this, "测试标题","测试内容!open" + v.getLeft(), 18);
|
||||||
// ScanManager sm = (ScanManager) getSystemService("olc_service_scan");
|
|
||||||
//
|
|
||||||
// sm.setScanSwitchLeft(false);
|
|
||||||
// sm.setScanSwitchRight(false);
|
|
||||||
// sm.setScanSwitchMiddle(false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onclosetest(View v) {
|
public void onclosetest(View v) {
|
||||||
DialogUtil.builder(this, "测试标题","测试内容!close" + v.getLeft(), 18);
|
DialogUtil.builder(this, "测试标题","测试内容!close" + v.getLeft(), 18);
|
||||||
// ScanManager sm = (ScanManager) getSystemService("olc_service_scan");
|
|
||||||
//
|
|
||||||
// sm.setScanSwitchLeft(true);
|
|
||||||
// sm.setScanSwitchRight(true);
|
|
||||||
// sm.setScanSwitchMiddle(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 设置按钮监听
|
// 设置按钮监听
|
||||||
@ -445,10 +376,6 @@ public class MainActivity extends Activity {
|
|||||||
|
|
||||||
// 设置按钮监听
|
// 设置按钮监听
|
||||||
public void onsub(View v) {
|
public void onsub(View v) {
|
||||||
// if (SysData.url == null) {
|
|
||||||
// DialogUtil.builder(this, "错误信息", "请检查网络!");
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
loginTy = 1;
|
loginTy = 1;
|
||||||
start_login();
|
start_login();
|
||||||
}
|
}
|
||||||
@ -482,20 +409,12 @@ public class MainActivity extends Activity {
|
|||||||
DialogUtil.setDialog(pd, "提示", "正在登录……");
|
DialogUtil.setDialog(pd, "提示", "正在登录……");
|
||||||
}
|
}
|
||||||
|
|
||||||
// DialogUtil.setDialog(pd, "提示", "" + MainActivity.this.getResources().getDisplayMetrics().densityDpi);
|
|
||||||
new Thread(downloadRun).start();
|
new Thread(downloadRun).start();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void login(String name, String pwd) {
|
public void login(String name, String pwd) {
|
||||||
// WifiManager wifiManager=(WifiManager)
|
|
||||||
// this.getSystemService(Context.WIFI_SERVICE);
|
|
||||||
// wifiManager.disconnect();
|
|
||||||
// wifiManager.reconnect();
|
|
||||||
try {
|
try {
|
||||||
String url = SysData.url + "/webservice/ServiceInterface?wsdl";
|
String url = SysData.url + "/webservice/ServiceInterface?wsdl";
|
||||||
// System.out
|
|
||||||
// .println(url
|
|
||||||
// + "--------------============================================");
|
|
||||||
String method = "login";
|
String method = "login";
|
||||||
SoapObject rpc = new SoapObject("", method);
|
SoapObject rpc = new SoapObject("", method);
|
||||||
rpc.addProperty("name", name);
|
rpc.addProperty("name", name);
|
||||||
@ -510,10 +429,6 @@ public class MainActivity extends Activity {
|
|||||||
envelope.setOutputSoapObject(rpc);
|
envelope.setOutputSoapObject(rpc);
|
||||||
ht.call("", envelope);
|
ht.call("", envelope);
|
||||||
if (envelope.getResponse() != null) {
|
if (envelope.getResponse() != null) {
|
||||||
// SoapObject result = (SoapObject) envelope.bodyIn;
|
|
||||||
// SoapObject soapChilds = (SoapObject) result.getProperty(0);
|
|
||||||
// System.out.println(soapChilds+"---"+soapChilds.getProperty("jigid"));
|
|
||||||
// System.out.println(soapChilds.getProperty("jigid"));
|
|
||||||
byte[] bb = org.kobjects.base64.Base64.decode(envelope
|
byte[] bb = org.kobjects.base64.Base64.decode(envelope
|
||||||
.getResponse().toString());
|
.getResponse().toString());
|
||||||
Message message = new Message();
|
Message message = new Message();
|
||||||
@ -601,16 +516,13 @@ public class MainActivity extends Activity {
|
|||||||
HttpURLConnection conn = null;
|
HttpURLConnection conn = null;
|
||||||
try {
|
try {
|
||||||
String path = SysData.url + "/apk.xml";
|
String path = SysData.url + "/apk.xml";
|
||||||
System.out.println(path+"----------------------");
|
|
||||||
URL url = new URL(path);
|
URL url = new URL(path);
|
||||||
conn = (HttpURLConnection) url.openConnection();
|
conn = (HttpURLConnection) url.openConnection();
|
||||||
conn.setConnectTimeout(5000);
|
conn.setConnectTimeout(5000);
|
||||||
if (conn.getResponseCode() == 200) {
|
if (conn.getResponseCode() == 200) {
|
||||||
is = conn.getInputStream();
|
is = conn.getInputStream();
|
||||||
// UpdataInfo info = getUpdataInfo(is);
|
|
||||||
Message msg = new Message();
|
Message msg = new Message();
|
||||||
msg.what = 1;
|
msg.what = 1;
|
||||||
System.out.println(versionStr);
|
|
||||||
msg.obj = Dom4jUtil.parserXml(is,versionStr);
|
msg.obj = Dom4jUtil.parserXml(is,versionStr);
|
||||||
handler.sendMessage(msg);
|
handler.sendMessage(msg);
|
||||||
}
|
}
|
||||||
@ -637,9 +549,6 @@ public class MainActivity extends Activity {
|
|||||||
case R.id.lxdatadown:
|
case R.id.lxdatadown:
|
||||||
loginTy = 2;
|
loginTy = 2;
|
||||||
start_login();
|
start_login();
|
||||||
// Intent intent = new Intent();
|
|
||||||
// intent.setClass(getApplicationContext(), DownDataActivity.class);
|
|
||||||
// startActivity(intent);
|
|
||||||
break;
|
break;
|
||||||
case R.id.lxlogin:
|
case R.id.lxlogin:
|
||||||
if (!isNull()) {
|
if (!isNull()) {
|
||||||
@ -687,7 +596,6 @@ public class MainActivity extends Activity {
|
|||||||
* 该方法解决屏幕旋转程序崩溃,需要对应 AndroidManifest.xml 文件 android:configChanges="orientation|screenSize|keyboardHidden" 配置
|
* 该方法解决屏幕旋转程序崩溃,需要对应 AndroidManifest.xml 文件 android:configChanges="orientation|screenSize|keyboardHidden" 配置
|
||||||
*/
|
*/
|
||||||
public void onConfigurationChanged(Configuration newConfig) {
|
public void onConfigurationChanged(Configuration newConfig) {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
super.onConfigurationChanged(newConfig);
|
super.onConfigurationChanged(newConfig);
|
||||||
if (newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) {
|
if (newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) {
|
||||||
Toast.makeText(this, "转换横屏", Toast.LENGTH_SHORT).show();
|
Toast.makeText(this, "转换横屏", Toast.LENGTH_SHORT).show();
|
||||||
|
|||||||
@ -1,34 +1,31 @@
|
|||||||
package com.example.chaoran;
|
package com.example.chaoran;
|
||||||
|
|
||||||
import java.io.ByteArrayInputStream;
|
import android.app.Activity;
|
||||||
import java.io.ObjectInputStream;
|
import android.content.Intent;
|
||||||
import java.util.ArrayList;
|
import android.os.Bundle;
|
||||||
import java.util.HashMap;
|
import android.os.Handler;
|
||||||
import java.util.List;
|
import android.os.Message;
|
||||||
import java.util.Map;
|
import android.view.Menu;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.AdapterView;
|
||||||
|
import android.widget.AdapterView.OnItemClickListener;
|
||||||
|
import android.widget.ListView;
|
||||||
|
import android.widget.SimpleAdapter;
|
||||||
|
import com.sys.SysData;
|
||||||
import org.ksoap2.SoapEnvelope;
|
import org.ksoap2.SoapEnvelope;
|
||||||
import org.ksoap2.serialization.SoapObject;
|
import org.ksoap2.serialization.SoapObject;
|
||||||
import org.ksoap2.serialization.SoapSerializationEnvelope;
|
import org.ksoap2.serialization.SoapSerializationEnvelope;
|
||||||
import org.ksoap2.transport.HttpTransportSE;
|
import org.ksoap2.transport.HttpTransportSE;
|
||||||
|
|
||||||
|
import java.io.ByteArrayInputStream;
|
||||||
|
import java.io.ObjectInputStream;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import com.chaoran.entiry.DanJuEntity;
|
/**
|
||||||
import com.example.chaoran.R;
|
* 菜单窗口
|
||||||
import com.sys.SysData;
|
*/
|
||||||
|
|
||||||
import android.os.Bundle;
|
|
||||||
import android.os.Handler;
|
|
||||||
import android.os.Message;
|
|
||||||
import android.app.Activity;
|
|
||||||
import android.content.Intent;
|
|
||||||
import android.view.Menu;
|
|
||||||
import android.view.View;
|
|
||||||
import android.widget.AdapterView;
|
|
||||||
import android.widget.ListView;
|
|
||||||
import android.widget.SimpleAdapter;
|
|
||||||
import android.widget.AdapterView.OnItemClickListener;
|
|
||||||
|
|
||||||
public class MenuActivity extends Activity {
|
public class MenuActivity extends Activity {
|
||||||
private ListView listView;
|
private ListView listView;
|
||||||
private List mData;
|
private List mData;
|
||||||
|
|||||||
@ -33,6 +33,9 @@ import android.view.View;
|
|||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 网络相关窗口
|
||||||
|
*/
|
||||||
@SuppressLint("NewApi")
|
@SuppressLint("NewApi")
|
||||||
public class NetWorkSet extends Activity {
|
public class NetWorkSet extends Activity {
|
||||||
private EditText ip;
|
private EditText ip;
|
||||||
|
|||||||
@ -1,28 +1,25 @@
|
|||||||
package com.example.chaoran;
|
package com.example.chaoran;
|
||||||
|
|
||||||
|
import android.app.Activity;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.graphics.Color;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.view.KeyEvent;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.AdapterView;
|
||||||
|
import android.widget.AdapterView.OnItemClickListener;
|
||||||
|
import android.widget.ListView;
|
||||||
|
import android.widget.TextView;
|
||||||
|
import com.chaoran.component.MyAdapter;
|
||||||
|
import com.chaoran.entiry.DataGrid;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import com.chaoran.component.MyAdapter;
|
|
||||||
import com.chaoran.entiry.DataGrid;
|
|
||||||
import com.example.chaoran.R;
|
|
||||||
import com.util.DialogUtil;
|
|
||||||
|
|
||||||
import android.os.Bundle;
|
|
||||||
import android.app.Activity;
|
|
||||||
import android.content.Intent;
|
|
||||||
import android.graphics.Color;
|
|
||||||
import android.view.KeyEvent;
|
|
||||||
import android.view.Menu;
|
|
||||||
import android.view.View;
|
|
||||||
import android.widget.AdapterView;
|
|
||||||
import android.widget.ListView;
|
|
||||||
import android.widget.SimpleAdapter;
|
|
||||||
import android.widget.TextView;
|
|
||||||
import android.widget.AdapterView.OnItemClickListener;
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 参数窗口
|
||||||
|
*/
|
||||||
public class ParamActivity extends Activity {
|
public class ParamActivity extends Activity {
|
||||||
private ListView listView;
|
private ListView listView;
|
||||||
private List listdata;
|
private List listdata;
|
||||||
|
|||||||
@ -22,6 +22,9 @@ import android.view.Menu;
|
|||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* pda注册窗口
|
||||||
|
*/
|
||||||
public class PdaRegActivity extends Activity {
|
public class PdaRegActivity extends Activity {
|
||||||
private EditText ip;
|
private EditText ip;
|
||||||
private EditText port;
|
private EditText port;
|
||||||
|
|||||||
@ -1,23 +1,18 @@
|
|||||||
package com.example.chaoran;
|
package com.example.chaoran;
|
||||||
|
|
||||||
import java.io.ByteArrayInputStream;
|
import android.os.Handler;
|
||||||
import java.io.ObjectInputStream;
|
import android.os.Message;
|
||||||
import java.util.HashMap;
|
import android.util.Log;
|
||||||
import java.util.Map;
|
import com.chaoran.entiry.DataGrid;
|
||||||
|
import com.sys.SysData;
|
||||||
|
import com.util.IoUtil;
|
||||||
import org.ksoap2.SoapEnvelope;
|
import org.ksoap2.SoapEnvelope;
|
||||||
import org.ksoap2.serialization.SoapObject;
|
import org.ksoap2.serialization.SoapObject;
|
||||||
import org.ksoap2.serialization.SoapSerializationEnvelope;
|
import org.ksoap2.serialization.SoapSerializationEnvelope;
|
||||||
import org.ksoap2.transport.HttpTransportSE;
|
import org.ksoap2.transport.HttpTransportSE;
|
||||||
|
|
||||||
import android.os.Handler;
|
import java.util.HashMap;
|
||||||
import android.os.Message;
|
import java.util.Map;
|
||||||
import android.util.Log;
|
|
||||||
|
|
||||||
import com.chaoran.entiry.DataGrid;
|
|
||||||
import com.chaoran.entiry.Sys_DanJuFormsOptions;
|
|
||||||
import com.sys.SysData;
|
|
||||||
import com.util.IoUtil;
|
|
||||||
|
|
||||||
/*运行检索方案线程*/
|
/*运行检索方案线程*/
|
||||||
public class RunSearchThread extends Thread {
|
public class RunSearchThread extends Thread {
|
||||||
|
|||||||
@ -1,20 +1,14 @@
|
|||||||
package com.example.chaoran;
|
package com.example.chaoran;
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import org.ksoap2.SoapEnvelope;
|
|
||||||
import org.ksoap2.serialization.SoapObject;
|
|
||||||
import org.ksoap2.serialization.SoapSerializationEnvelope;
|
|
||||||
import org.ksoap2.transport.HttpTransportSE;
|
|
||||||
|
|
||||||
import com.chaoran.entiry.DataGrid;
|
|
||||||
import com.sys.SysData;
|
|
||||||
import com.util.IoUtil;
|
|
||||||
|
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.os.Message;
|
import android.os.Message;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
import com.sys.SysData;
|
||||||
|
import com.util.IoUtil;
|
||||||
|
import org.ksoap2.SoapEnvelope;
|
||||||
|
import org.ksoap2.serialization.SoapObject;
|
||||||
|
import org.ksoap2.serialization.SoapSerializationEnvelope;
|
||||||
|
import org.ksoap2.transport.HttpTransportSE;
|
||||||
|
|
||||||
public class RunYmupThread extends Thread {
|
public class RunYmupThread extends Thread {
|
||||||
private String param;
|
private String param;
|
||||||
|
|||||||
@ -10,6 +10,9 @@ import android.os.Handler;
|
|||||||
import android.os.Message;
|
import android.os.Message;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 搜索线程
|
||||||
|
*/
|
||||||
public class SearchThread extends Thread {
|
public class SearchThread extends Thread {
|
||||||
private String fangalx;
|
private String fangalx;
|
||||||
private String functionname;
|
private String functionname;
|
||||||
|
|||||||
@ -1,28 +1,19 @@
|
|||||||
package com.example.chaoran;
|
package com.example.chaoran;
|
||||||
|
|
||||||
import java.io.File;
|
import android.app.Activity;
|
||||||
|
import android.app.ProgressDialog;
|
||||||
import org.ksoap2.serialization.SoapObject;
|
|
||||||
|
|
||||||
import com.chaoran.entiry.UpdataInfo;
|
|
||||||
import com.chaoran.thread.UpdatePwdThread;
|
|
||||||
import com.example.chaoran.R;
|
|
||||||
import com.sys.SysData;
|
|
||||||
import com.util.DialogUtil;
|
|
||||||
import com.util.InstallUtil;
|
|
||||||
|
|
||||||
import android.R.color;
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.os.Message;
|
import android.os.Message;
|
||||||
import android.app.Activity;
|
|
||||||
import android.app.ProgressDialog;
|
|
||||||
import android.content.Intent;
|
|
||||||
import android.graphics.Color;
|
|
||||||
import android.view.Menu;
|
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
|
import com.chaoran.thread.UpdatePwdThread;
|
||||||
|
import com.sys.SysData;
|
||||||
|
import com.util.DialogUtil;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新密码窗口
|
||||||
|
*/
|
||||||
public class UpdatePwdActivity extends Activity {
|
public class UpdatePwdActivity extends Activity {
|
||||||
private EditText newPwd;
|
private EditText newPwd;
|
||||||
private EditText CfNewPwd;
|
private EditText CfNewPwd;
|
||||||
|
|||||||
@ -1,32 +1,18 @@
|
|||||||
package com.util;
|
package com.util;
|
||||||
|
|
||||||
import java.io.ByteArrayOutputStream;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Set;
|
|
||||||
|
|
||||||
import com.chaoran.entiry.PhotographUi;
|
|
||||||
import com.chaoran.entiry.SelfCheckBox;
|
|
||||||
import com.chaoran.entiry.SelfEditText;
|
|
||||||
import com.chaoran.entiry.SelfImage;
|
|
||||||
import com.chaoran.entiry.SelfTextBut;
|
|
||||||
import com.chaoran.imp.InputInterface;
|
|
||||||
import com.chaoran.thread.ImageUrl;
|
|
||||||
|
|
||||||
import android.graphics.Bitmap;
|
|
||||||
import android.graphics.Bitmap.CompressFormat;
|
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.CheckBox;
|
import android.widget.CheckBox;
|
||||||
import android.widget.EditText;
|
|
||||||
import android.widget.FrameLayout;
|
import android.widget.FrameLayout;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.RelativeLayout;
|
|
||||||
import android.widget.TabHost;
|
import android.widget.TabHost;
|
||||||
import android.widget.TextView;
|
import com.chaoran.entiry.PhotographUi;
|
||||||
|
import com.chaoran.entiry.SelfCheckBox;
|
||||||
|
import com.chaoran.entiry.SelfImage;
|
||||||
|
import com.chaoran.imp.InputInterface;
|
||||||
|
import com.chaoran.thread.ImageUrl;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 单据工具类
|
* 单据工具类
|
||||||
@ -167,11 +153,6 @@ public class DjUtil {
|
|||||||
for (String s : set) {
|
for (String s : set) {
|
||||||
view = layout.findViewWithTag(s);
|
view = layout.findViewWithTag(s);
|
||||||
if (view != null) {
|
if (view != null) {
|
||||||
// if (view instanceof SelfEditText) {
|
|
||||||
// ((SelfEditText) view).setText(map.get(s).toString().trim());
|
|
||||||
// } else if (view instanceof TextView) {
|
|
||||||
// ((TextView) view).setText(map.get(s).toString().trim());
|
|
||||||
// }
|
|
||||||
setText(view, map.get(s).toString().trim(), imgHandler, -1, -1);
|
setText(view, map.get(s).toString().trim(), imgHandler, -1, -1);
|
||||||
list.add(s);
|
list.add(s);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user