2 Commits

36 changed files with 5119 additions and 1108 deletions

2
.idea/encodings.xml generated
View File

@ -6,6 +6,8 @@
<file url="file://$PROJECT_DIR$/app/jni/SerialPort.c" charset="GBK" />
<file url="file://$PROJECT_DIR$/app/jni/SerialPort.h" charset="GBK" />
<file url="file://$PROJECT_DIR$/app/jni/gen_SerialPort_h.sh" charset="GBK" />
<file url="file://$PROJECT_DIR$/app/libs/arm64-v8a/libserial_port.so" charset="GBK" />
<file url="file://$PROJECT_DIR$/app/libs/armeabi/libserial_port.so" charset="GBK" />
<file url="file://$PROJECT_DIR$/app/libs/armeabi/libserial_port.so" charset="GBK" />
<file url="file://$PROJECT_DIR$/app/src/main/java/com/jiebao/h518/scan/SqliteConnect.java" charset="GBK" />
<file url="file://$PROJECT_DIR$/app/vguang-jni/Android.mk" charset="GBK" />

6
.idea/render.experimental.xml generated Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RenderSettings">
<option name="showDecorations" value="true" />
</component>
</project>

View File

@ -16,13 +16,26 @@ android {
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
signingConfigs {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
storeFile file(RELEASE_STOREFILE);
storePassword RELEASE_STORE_PASSWORD;
keyAlias RELEASE_KEY_ALIAS
keyPassword RELEASE_KEY_PASSWORD
}
}
buildTypes {
release {
minifyEnabled false //是否代码混淆
multiDexEnabled true //防止方法数量超过65536导致错误
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
//配置签名
signingConfig signingConfigs.release
}
}
//关闭代码格式检查
lintOptions {
abortOnError false
}
@ -33,8 +46,8 @@ android {
}
//加载动态库
sourceSets{
main{
sourceSets {
main {
jniLibs.srcDir(['libs'])
}
}

BIN
app/libs/armeabi/libmsc.so Normal file

Binary file not shown.

BIN
app/libs/flytek.jar Normal file

Binary file not shown.

BIN
app/libs/honeywell.jar Normal file

Binary file not shown.

View File

@ -1,7 +1,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.chaoran"
android:versionCode="1"
android:versionName="V1.078" >
xmlns:tools="http://schemas.android.com/tools"
package="com.example.chaoran"
android:versionCode="1"
android:versionName="V1.079">
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
@ -15,137 +16,113 @@
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.DISABLE_KEYGUARD" />
<!-- <uses-permission android:name="android.permission.DEVICE_POWER" /> -->
<!-- <uses-permission android:name="android.permission.WRITE_SETTINGS" />-->
<uses-permission android:name="android.permission.READ_SETTINGS" />
<!-- 百度定位服务权限 -->
<permission android:name="android.permission.BAIDU_LOCATION_SERVICE" >
</permission>
<permission android:name="android.permission.BAIDU_LOCATION_SERVICE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" >
</uses-permission>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" >
</uses-permission>
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" >
</uses-permission>
<uses-permission android:name="android.permission.READ_PHONE_STATE" >
</uses-permission>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" >
</uses-permission>
<!-- <uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS" >-->
<!-- </uses-permission>-->
<!-- <uses-permission android:name="android.permission.READ_LOGS" >-->
<!-- </uses-permission>-->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<!-- 百度地图API权限 -->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" >
</uses-permission>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" >
</uses-permission>
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" >
</uses-permission>
<uses-permission android:name="android.permission.READ_PHONE_STATE" >
</uses-permission>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<!-- -->
<uses-permission android:name="com.honeywell.decode.permission.DECODE" />
<application
android:name="map.baidu.com.BMapManagerUtil"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:persistent="true"
android:theme="@style/AppTheme" >
<!-- <uses-library android:name="com.sprint.hardware.twinCamDevice" android:required="false"/> -->
<uses-library android:name="android.scanner.library" android:required="false" />
android:name="map.baidu.com.BMapManagerUtil"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:persistent="true"
android:theme="@style/AppTheme"
tools:ignore="HardcodedDebugMode">
<uses-library
android:name="android.scanner.library"
android:required="false" />
<activity
android:name="com.example.chaoran.MainActivity"
android:label="@string/title_activity_main"
android:screenOrientation="behind"
android:configChanges="orientation|screenSize|keyboardHidden">
android:name="com.example.chaoran.MainActivity"
android:label="@string/title_activity_main"
android:screenOrientation="behind"
android:configChanges="orientation|screenSize|keyboardHidden">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.HOME" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.HOME" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.example.chaoran.NetWorkSet"
android:label="@string/title_activity_net_work_set"
android:screenOrientation="behind" >
</activity>
android:name="com.example.chaoran.NetWorkSet"
android:label="@string/title_activity_net_work_set"
android:screenOrientation="behind" />
<activity
android:name="com.example.chaoran.MenuActivity"
android:label="@string/title_activity_menu"
android:screenOrientation="behind" >
</activity>
android:name="com.example.chaoran.MenuActivity"
android:label="@string/title_activity_menu"
android:screenOrientation="behind" />
<activity
android:name="com.example.chaoran.DjActivity"
android:label="@string/title_activity_dj"
android:screenOrientation="behind"
android:launchMode="singleTask">
</activity>
android:name="com.example.chaoran.DjActivity"
android:label="@string/title_activity_dj"
android:screenOrientation="behind"
android:launchMode="singleTask" />
<activity
android:name="com.example.chaoran.ParamActivity"
android:label="@string/title_activity_param"
android:screenOrientation="behind" >
</activity>
android:name="com.example.chaoran.ParamActivity"
android:label="@string/title_activity_param"
android:screenOrientation="behind" />
<activity
android:name="com.example.chaoran.DjtqActivity"
android:label="@string/djtq_activity"
android:screenOrientation="behind" >
</activity>
android:name="com.example.chaoran.DjtqActivity"
android:label="@string/djtq_activity"
android:screenOrientation="behind" />
<activity
android:name="com.example.chaoran.UpdatePwdActivity"
android:label="@string/title_activity_update_pwd"
android:screenOrientation="behind" >
</activity>
<!-- android:hardwareAccelerated="false" android:hardwareAccelerated="false" 硬件加速3.0以上才有 -->
android:name="com.example.chaoran.UpdatePwdActivity"
android:label="@string/title_activity_update_pwd"
android:screenOrientation="behind" />
<activity
android:name="map.baidu.com.BDMapActivity"
android:hardwareAccelerated="false"
android:label="@string/title_activity_bdmap"
android:screenOrientation="behind" >
android:name="map.baidu.com.BDMapActivity"
android:hardwareAccelerated="false"
android:label="@string/title_activity_bdmap"
android:screenOrientation="behind">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.baidu.mapapi.MapActivity" />
android:name="android.support.PARENT_ACTIVITY"
android:value="com.baidu.mapapi.MapActivity" />
</activity>
<service
android:name="com.baidu.location.f"
android:enabled="true"
android:process=":remote" >
<!--
<intent-filter>
<action android:name="com.baidu.location.service_v2.9"></action>
</intent-filter>
-->
</service>
android:name="com.baidu.location.f"
android:enabled="true"
android:process=":remote" />
<activity
android:name="com.chaoran.lx.activity.DownDataActivity"
android:label="@string/title_activity_down_data"
android:screenOrientation="behind" >
</activity>
android:name="com.chaoran.lx.activity.DownDataActivity"
android:label="@string/title_activity_down_data"
android:screenOrientation="behind" />
<activity
android:name="com.chaoran.lx.activity.Lx_Param_Activity"
android:label="@string/title_activity_lx__param_"
android:screenOrientation="behind" >
</activity>
android:name="com.chaoran.lx.activity.Lx_Param_Activity"
android:label="@string/title_activity_lx__param_"
android:screenOrientation="behind" />
<activity
android:name="com.example.chaoran.MipcaActivityCapture"
android:label="@string/title_activity_camera_scan"
android:screenOrientation="behind"
android:windowSoftInputMode="stateAlwaysHidden" >
</activity>
android:name="com.example.chaoran.MipcaActivityCapture"
android:label="@string/title_activity_camera_scan"
android:screenOrientation="behind"
android:windowSoftInputMode="stateAlwaysHidden" />
<activity
android:name="com.example.chaoran.PdaRegActivity"
android:label="@string/title_activity_pda_reg" >
</activity>
android:name="com.example.chaoran.PdaRegActivity"
android:label="@string/title_activity_pda_reg" />
<activity
android:name=".VoiceSettingActivity"
android:theme="@android:style/Theme.Material.Light.NoActionBar"
android:label="@string/title_activity_voice_engine_setting"
tools:targetApi="lollipop" />
</application>
</manifest>

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,182 @@
package com.activity.chaoran;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import org.kobjects.base64.Base64;
import com.chaoran.component.MyAdapter;
import com.chaoran.entiry.DataGrid;
import com.chaoran.entiry.Djselefa;
import com.activity.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.ProgressDialog;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.view.KeyEvent;
import android.view.View;
import android.widget.AdapterView;
import android.widget.Button;
import android.widget.ListView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.TextView;
public class DjtqActivity extends Activity {
private ListView listview;
private int cur_pos = -1;// 当前显示的一行
// private ArrayList items_text = new ArrayList();
private Djselefa djselefa;
public ProgressDialog pd;
public MyAdapter adapter;
private ArrayList listdata;
private String filedName;// 显示字段的名字
private String gzid;
private String mxTempTable;
private Intent intent;
private Handler runHandler = new Handler() {
@Override
public void handleMessage(Message msg) {
super.handleMessage(msg);
if (msg.what == -1) {
DialogUtil.builder(DjtqActivity.this, "错误信息", "提取方案初始化失败:"
+ msg.obj.toString(),0);
} else if (msg.what == -4) {
DialogUtil.builder(DjtqActivity.this, "错误信息", "提取方案运行失败:"
+ msg.obj.toString(),0);
} else {
if (msg.arg1 == 4) {
Object ob = msg.obj;
if (ob instanceof ArrayList) {
ArrayList list = (ArrayList) ob;
if (list.size() > 0) {
intent.putExtra("param", (HashMap) list.get(0));
setResult(2, intent);
}
clear();
} else {
DialogUtil.builder(DjtqActivity.this, "提示信息",
ob.toString(),0);
}
} else {
HashMap map = (HashMap) msg.obj;
DataGrid dg = (DataGrid) map.get("dg");
listdata = dg.getTableData();
if(listdata==null||listdata.size()<1){
filedName="";
}else{
filedName=SysUtil.mapFirst(listdata);
}
if (adapter == null) {
adapter = new MyAdapter(DjtqActivity.this, listdata,
filedName);
listview.setAdapter(adapter);
}
}
}
if (pd != null) {
pd.dismiss();
}
}
};
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.list);
listview = (ListView) findViewById(R.id.mxlist);
intent = getIntent();
HashMap paramMap = (HashMap) intent.getSerializableExtra("paramMap");
djselefa = (Djselefa) paramMap.get("djselefa");
pd = ProgressDialog.show(DjtqActivity.this, "正在执行提取方案", "正在下载……");
try {
new RunSearchThread(djselefa.getT_sql(), IoUtil.ob_base64(paramMap
.get("t_sqlParam")), runHandler).start();
} catch (IOException e) {
// e.printStackTrace();
DialogUtil.builder(this, "错误信息", "转换成Base64编码失败",0);
}
gzid = paramMap.get("GZID").toString();
mxTempTable = paramMap.get("mxTempTable").toString();
intent.removeExtra("paramMap");
TextView tv = (TextView) findViewById(R.id.mxtitle);
tv.setText(djselefa.getFangamch());
((Button) findViewById(R.id.mxbut)).setText("提取");
listview.setChoiceMode(ListView.CHOICE_MODE_SINGLE);// 一定要设置这个属性否则ListView不会刷新
listview.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> arg0, View arg1,
int position, long id) {
cur_pos = position;// 更新当前行
adapter.cur_pos = cur_pos;
}
});
}
public void queryMx(View v) {
try {
if (cur_pos < 0) {
DialogUtil.builder(this, "提示信息", "请选择一行!",0);
} else {
if (mxTempTable == null || mxTempTable.length() < 0) {
DialogUtil.builder(this, "提示信息", "明细表不存在!",0);
}
HashMap item = (HashMap) listdata.get(cur_pos);
HashMap hzData = SqlUtil.regSql(djselefa.getHz_sql(), item);
HashMap mxData = SqlUtil.regSql(djselefa.getMx_sql(), item);
HashMap hm = new HashMap();
hm.put("gzid", gzid);
hm.put("mxTempTable", mxTempTable);
hm.put("hzSql", hzData.get("sql"));
hm.put("hzParam", hzData.get("param"));
hm.put("mxSql", mxData.get("sql"));
hm.put("mxParam", mxData.get("param"));
byte[] b = IoUtil.getbyte(hm);
DialogUtil.setDialog(pd, "提示信息", "正在运行提取方案");
new RunYmupThread(Base64.encode(b), runHandler, "runTqfa",0)
.start();
}
} catch (Exception e) {
pd.dismiss();
DialogUtil.builder(DjtqActivity.this, "错误信息", "提取修改方案组织数据失败!",0);
}
}
public boolean onKeyUp(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK && event.isTracking()
&& !event.isCanceled()) {
clear();
return true;
}
return super.onKeyUp(keyCode, event);
}
private void clear() {
listview = null;
if (pd != null) {
pd.dismiss();
pd = null;
}
djselefa = null;
adapter = null;
if (listdata != null) {
listdata.clear();
listdata = null;
}
filedName = null;
gzid = null;
mxTempTable = null;
intent = null;
runHandler = null;
intent = null;
finish();
}
}

View File

@ -0,0 +1,75 @@
package com.activity.chaoran;
import org.ksoap2.SoapEnvelope;
import org.ksoap2.serialization.SoapObject;
import org.ksoap2.serialization.SoapSerializationEnvelope;
import org.ksoap2.transport.HttpTransportSE;
import android.os.Handler;
import android.os.Message;
import android.util.Log;
import com.sys.SysData;
public class ExitThread extends Thread {
public String gzid;
public String mxTempTable;
public Handler handler;
public String method;
public ExitThread(String gzid, String mxTempTable, Handler handler,
String method) {
this.gzid = gzid;
this.mxTempTable = mxTempTable;
this.handler = handler;
this.method = method;
}
public void run() {
super.run();
Log.v("SearchThread", "run执行");
try {
String url = SysData.url + "/webservice/ServiceInterface?wsdl";
// method = "exitDj";
SoapObject rpc = new SoapObject("", method);
rpc.addProperty("gzid", gzid);
rpc.addProperty("mxTempTable", mxTempTable);
HttpTransportSE ht = new HttpTransportSE(url);
ht.debug = true;
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
SoapEnvelope.VER11);
envelope.bodyOut = rpc;
envelope.dotNet = true;
envelope.setOutputSoapObject(rpc);
ht.call("", envelope);
if (handler != null) {
if (envelope.getResponse() != null) {// 判断是否返回结果,因为我这个是一个查询操作,是带有返回值的。
Message msg = new Message();
msg.obj = envelope.getResponse();
if (method.equals("exitDj")) {
msg.arg1 = 4;
} else if (method.equals("queryMx")) {
msg.arg1 = 5;
}
handler.sendMessage(msg);
} else {
Message msg = new Message();
msg.obj = null;
handler.sendMessage(msg);
}
}
} catch (Exception e) {
if (handler != null) {
Message msg = new Message();
if (method.equals("exitDj")) {
msg.what = -4;
} else if (method.equals("queryMx")) {
msg.what = -5;
}
msg.obj = e.toString();
handler.sendMessage(msg);
// e.printStackTrace();
}
}
}
}

View File

@ -0,0 +1,599 @@
package com.activity.chaoran;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.app.ProgressDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
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.NameNotFoundException;
import android.content.res.Configuration;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.view.KeyEvent;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.CheckBox;
import android.widget.EditText;
import android.widget.TextView;
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 {
SqlHelpUtil db;
SQLiteDatabase sDatabase;
EditText name;
EditText pwd;
private CheckBox checkBox;
private CheckBox islxScan;
public ProgressDialog pd;
private int loginTy;// 登录类型,1为在线登录 2为离线数据下载
private TextView regts;
public String versionStr;
public static float def_pbl = 0.9f; // 屏幕比列
//Honeywell 扫描设备控制
private static BarcodeReader barcodeReader = null;
private AidcManager manager = null;
private Handler handler = new Handler() {
@Override
// 当有消息发送出来的时候就执行Handler的这个方法
public void handleMessage(Message msg) {
if (msg.what == -1) {
DialogUtil.builder(MainActivity.this, "错误信息", "连接服务器失败,请检查网络!"
+ msg.obj,0);
} else if (msg.what == -2) {
DialogUtil.builder(MainActivity.this, "错误信息", "用户名或密码错误!",0);
} else if (msg.what == -3) {
DialogUtil.builder(MainActivity.this, "错误信息", "解析xml失败",0);
} else if (msg.what == -4) {
DialogUtil.builder(MainActivity.this, "错误信息", "检查更新失败,请检查网络!",0);
} else if (msg.what == -5) {
DialogUtil.builder(MainActivity.this, "错误信息", "更新文件失败!",0);
} else if (msg.what == 1) {
UpdataInfo info = (UpdataInfo) msg.obj;
if (info!=null&&!info.getVersion().equals(versionStr)) {
showUpdataDialog(info);
}
} else if (msg.what == 2) {
new InstallUtil().installApk((File) msg.obj, MainActivity.this);
} else {
if (msg.obj.equals("该功能未授权")) {
DialogUtil.builder(MainActivity.this, "提示信息", "该功能未授权!",0);
} else {
UserList user = (UserList) msg.obj;
if (user.getLgnname() == null) {
String udesc = user.getUdesc();
if (udesc.equals("0")) {
DialogUtil.builder(MainActivity.this, "提示信息",
"PDA未注册",0);
} else if (udesc.equals("1")) {
DialogUtil.builder(MainActivity.this, "提示信息",
"PDA还未授权使用",0);
} else if (udesc.equals("2")) {
DialogUtil.builder(MainActivity.this, "提示信息",
"试用期已过!",0);
} else if (udesc.equals("3")) {
DialogUtil.builder(MainActivity.this, "提示信息",
"超出最大站点数,请联系管理员",0);
} else if (udesc.equals("-1")) {
DialogUtil.builder(MainActivity.this, "提示信息",
"用户名或密码错误!",0);
}
} else {
SysData.is_lx = false;
login_end(user);
}
}
}
if (pd != null) {
pd.dismiss();
}
}
};
private Handler regHandler = new Handler() {
@Override
// 当有消息发送出来的时候就执行Handler的这个方法
public void handleMessage(Message msg) {
if (msg.what != -1) {
if(msg.equals("-1")){
regts.setText("正式 注册");
}else{
regts.setText("软件到期时间"+msg.obj);
}
}
}
};
public void login_end(UserList user) {
SysData.jigid = user.getJigid();
SysData.lgnname = user.getLgnname();
SysData.userid = String.valueOf(user.getUserid());
SysData.scale = MainActivity.this.getResources().getDisplayMetrics().density + 1;
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());
SharedPreferences sp = MainActivity.this.getSharedPreferences(
"userTxt", MODE_PRIVATE);
if (checkBox.isChecked()) {
Editor editor = sp.edit();
editor.putString("name", name.getText().toString().trim());
editor.putString("pwd", pwd.getText().toString().trim());
editor.putBoolean("islxScan",islxScan.isChecked());
editor.commit();
} else {
sp.edit().clear().commit();
name.setText("");
pwd.setText("");
}
if (loginTy == 1) {
String islxscan="1";
if(islxScan.isChecked()){
islxscan="0";
}
Intent intent = new Intent();
intent.putExtra("displaymode", user.getDisplaymode());
intent.putExtra("islxscan", islxscan);
intent.setClass(getApplicationContext(), DjActivity.class);
startActivity(intent);
} else if (loginTy == 2) {
Intent intent = new Intent();
intent.setClass(getApplicationContext(), DownDataActivity.class);
startActivity(intent);
}
SysData.no = name.getText().toString().trim();
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
System.setProperty("http.keepAlive", "false");
setContentView(R.layout.activity_main);
SharedPreferences sp = getSharedPreferences("userTxt", MODE_PRIVATE);
name = (EditText) findViewById(R.id.name);
pwd = (EditText) findViewById(R.id.pwd);
regts=(TextView) findViewById(R.id.regts);
checkBox = (CheckBox) findViewById(R.id.cb);
islxScan=(CheckBox)findViewById(R.id.lxs);
if (!sp.contains("name")) {
checkBox.setChecked(false);
} else {
name.setText(sp.getString("name", ""));
pwd.setText(sp.getString("pwd", ""));
islxScan.setChecked(sp.getBoolean("islxScan", true));
}
TextView version = (TextView) findViewById(R.id.version);
versionStr=getVersionName();
version.setText("版本".concat(versionStr));
SysData.clientid = SysUtil.getLocalMacAddress(MainActivity.this);
db = new SqlHelpUtil(getApplicationContext());
sDatabase = db.getWritableDatabase();
String selectStr = "select col1,col2,col3 from systable where desc='network'";
Cursor select_cursor = sDatabase.rawQuery(selectStr, null);
if (select_cursor.moveToFirst()) {
SysData.url = "http://".concat(select_cursor.getString(0))
.concat(":").concat(select_cursor.getString(1)).concat("/")
.concat(select_cursor.getString(2));
}
select_cursor.close();
selectStr = "select col1 from systable where desc='pdaState'";
select_cursor = sDatabase.rawQuery(selectStr, null);
if (select_cursor.moveToFirst()) {
SysData.isreg = select_cursor.getString(0);
}
select_cursor.close();
if (SysData.url != null) {
new Thread(new CheckVersionTask()).start();
new Thread(queryZcrq).start();
}
BufferedReader br = null;
BufferedWriter bw = null;
File file = new File(getFilesDir().getAbsolutePath() + "/cr_pda_config");
try {
if (!file.exists())
file.createNewFile();
FileInputStream fis = new FileInputStream(file);
InputStreamReader isr = new InputStreamReader(fis);
br = new BufferedReader(isr);
String s = br.readLine();
if (s == null || s.trim().length() < 1)
throw new Exception("Update config data.");
def_pbl = Float.parseFloat(s);
if (def_pbl < 0.1 || def_pbl > 10.0)
throw new Exception("请填写 0.1~10.0 之间的浮点数!");
} catch (Exception e) {
def_pbl = 0.9f;
try {
FileOutputStream fos = new FileOutputStream(file);
OutputStreamWriter osw = new OutputStreamWriter(fos);
bw = new BufferedWriter(osw);
bw.append(Float.toString(def_pbl));
} catch (IOException e1) {
e1.printStackTrace();
}
} finally {
if (br != null) {
try {
br.close();
} catch (IOException e) {
e.printStackTrace();
}
}
if (bw != null) {
try {
bw.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
if ("scanpal eda50".equals(android.os.Build.MODEL.toLowerCase())) {
AidcManager.create(this, new CreatedCallback() {
@Override
public void onCreated(AidcManager aidcManager) {
manager = aidcManager;
barcodeReader = manager.createBarcodeReader();
}
});
}
}
public static BarcodeReader getBarcodeObject() {
return barcodeReader;
}
Runnable downloadRun = new Runnable() {
public void run() {
login(name.getText().toString().trim(), pwd.getText().toString()
.trim());
}
};
Runnable queryZcrq = new Runnable() {
public void run() {
try {
String url = SysData.url + "/webservice/ServiceInterface?wsdl";
String method = "regEndRq";
SoapObject rpc = new SoapObject("", method);
HttpTransportSE ht = new HttpTransportSE(url, SysData.timeout);
ht.debug = true;
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
SoapEnvelope.VER11);
envelope.bodyOut = rpc;
envelope.dotNet = true;
envelope.setOutputSoapObject(rpc);
ht.call("", envelope);
Message message = new Message();
message.obj = envelope.getResponse().toString();
regHandler.sendMessage(message);
} catch (Exception e) {
Message message = new Message();
message.what = -1;
message.obj = e.toString();
regHandler.sendMessage(message);
}
}
};
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.activity_main, menu);
return true;
}
/*
* 获取当前程序的版本号
*/
private String getVersionName() {
// 获取packagemanager的实例
PackageManager packageManager = getPackageManager();
// getPackageName()是你当前类的包名0代表是获取版本信息
PackageInfo packInfo = null;
try {
packInfo = packageManager.getPackageInfo(getPackageName(), 0);
} catch (NameNotFoundException e) {
DialogUtil.builder(MainActivity.this, "错误信息", "获取版本号失败!",0);
}
return packInfo.versionName;
}
// 设置按钮监听
public void onset(View v) {
Intent intent = new Intent();
intent.setClass(this, NetWorkSet.class);
startActivity(intent);
}
public void onopentest(View v) {
DialogUtil.builder(this, "测试标题","测试内容open" + v.getLeft(), 18);
}
public void onclosetest(View v) {
DialogUtil.builder(this, "测试标题","测试内容close" + v.getLeft(), 18);
}
// 设置按钮监听
public void onRotation(View v) {
int i = MainActivity.this.getRequestedOrientation();
if (i == ActivityInfo.SCREEN_ORIENTATION_REVERSE_PORTRAIT) {
MainActivity.this
.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
}
// 纵屏反方向
else if (i == ActivityInfo.SCREEN_ORIENTATION_PORTRAIT || i == 3) {
MainActivity.this
.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_REVERSE_PORTRAIT);
}
}
public boolean isNull() {
if (name.getText().toString().trim().equals("")) {
DialogUtil.builder(this, "错误信息", "用户名不能为空!",0);
name.requestFocus();
return false;
}
if (pwd.getText().toString().trim().equals("")) {
DialogUtil.builder(this, "错误信息", "密码不能为空!",0);
pwd.requestFocus();
return false;
}
return true;
}
// 设置按钮监听
public void onsub(View v) {
loginTy = 1;
start_login();
}
public void start_login() {
if (!isNull()) {
return;
}
if (!SysUtil.isNetworkConnected(MainActivity.this)) {
DialogUtil.builder(MainActivity.this, "提示", "网络没连接!请检查网络",0);
return;
}
if (name.getText().toString().trim().equals("crtech")
&& pwd.getText().toString().trim().equals("crtech")) {
Intent pdaIntent = new Intent();
pdaIntent.setClass(this, PdaRegActivity.class);
startActivity(pdaIntent);
return;
}
if (SysData.url == null || SysData.url.trim().length() < 1) {
DialogUtil.builder(this, "错误信息", "请设置URL",0);
return;
}
if (SysData.clientid.trim().length() < 1) {
DialogUtil.builder(this, "错误信息", "mac地址为空,请检查网络!",0);
return;
}
if (pd == null) {
pd = ProgressDialog.show(this, "提示", "正在登录……");
} else {
DialogUtil.setDialog(pd, "提示", "正在登录……");
}
new Thread(downloadRun).start();
}
public void login(String name, String pwd) {
try {
String url = SysData.url + "/webservice/ServiceInterface?wsdl";
String method = "login";
SoapObject rpc = new SoapObject("", method);
rpc.addProperty("name", name);
rpc.addProperty("pwd", pwd);
rpc.addProperty("mac", SysData.clientid);
HttpTransportSE ht = new HttpTransportSE(url, SysData.timeout);
ht.debug = true;
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
SoapEnvelope.VER11);
envelope.bodyOut = rpc;
envelope.dotNet = true;
envelope.setOutputSoapObject(rpc);
ht.call("", envelope);
if (envelope.getResponse() != null) {
byte[] bb = org.kobjects.base64.Base64.decode(envelope
.getResponse().toString());
Message message = new Message();
message.obj = IoUtil.byte_obj(bb);
handler.sendMessage(message);
} else {
Message message = new Message();
message.what = -2;
handler.sendMessage(message);
}
} catch (Exception e) {
Message message = new Message();
message.what = -1;
message.obj = e.toString();
handler.sendMessage(message);
}
}
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (event.KEYCODE_BACK == keyCode) {
if (getRequestedOrientation() == ActivityInfo.SCREEN_ORIENTATION_REVERSE_PORTRAIT) {
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
}
}
return super.onKeyDown(keyCode, event);
}
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
}
@Override
protected void onDestroy() {
super.onDestroy();
if (db != null) {
db.close();
sDatabase.close();
}
if (barcodeReader != null) {
// close BarcodeReader to clean up resources.
barcodeReader.close();
barcodeReader = null;
}
if (manager != null) {
// close AidcManager to disconnect from the scanner service.
// once closed, the object can no longer be used.
manager.close();
}
}
private void showUpdataDialog(final UpdataInfo info) {
Builder builer = new Builder(this);
builer.setTitle("版本升级");
builer.setMessage(info.getDescription());
// 当点确定按钮时从服务器上下载 新的apk 然后安装
builer.setPositiveButton("确定", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
downLoadApk(SysData.url.concat(info.getUrl()));
}
});
// 当点取消按钮时进行登录
builer.setNegativeButton("取消", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
}
});
AlertDialog dialog = builer.create();
dialog.show();
}
private void downLoadApk(String url) {
ProgressDialog pd = new ProgressDialog(this);
pd.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
pd.setMessage("正在下载更新");
pd.show();
new Thread(new DownApk(pd, url, this.getApplicationContext(), handler))
.start();
}
public class CheckVersionTask implements Runnable {
public void run() {
InputStream is = null;
HttpURLConnection conn = null;
try {
String path = SysData.url + "/apk.xml";
URL url = new URL(path);
conn = (HttpURLConnection) url.openConnection();
conn.setConnectTimeout(5000);
if (conn.getResponseCode() == 200) {
is = conn.getInputStream();
// UpdataInfo info = getUpdataInfo(is);
Message msg = new Message();
msg.what = 1;
System.out.println(versionStr);
msg.obj = Dom4jUtil.parserXml(is,versionStr);
handler.sendMessage(msg);
}
} catch (Exception e) {
Message msg = new Message();
msg.what = -4;
handler.sendMessage(msg);
} finally {
try {
if (is != null)
is.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
super.onOptionsItemSelected(item);
switch (item.getItemId())// 得到被点击的item的itemId
{
case R.id.lxdatadown:
loginTy = 2;
start_login();
break;
case R.id.lxlogin:
if (!isNull()) {
return true;
}
DBManager dbManager = new DBManager(this);
if (dbManager.existsTable("userlist".toUpperCase()) < 1) {
DialogUtil.builder(MainActivity.this, "信息提示", "请下载用户资料表!",0);
} else {
String sql = "select jigid,lgnname,userid from userlist where username='"
+ name.getText().toString().trim()
+ "' and pass='"
+ pwd.getText().toString().trim() + "'";
Cursor cur = dbManager.query(sql);
if (cur.getCount() == 0) {
DialogUtil.builder(MainActivity.this, "信息提示", "用户账号错误!",0);
} else {
SysData.is_lx = true;
UserList user = new UserList();
if (cur.moveToFirst()) {
user.setJigid(cur.getString(0));
user.setLgnname(cur.getString(1));
user.setUserid(cur.getInt(2));
user.setDisplaymode("grid");
loginTy = 1;
login_end(user);
}
if (dbManager.existsTable("TEMP_BI_DJHZ".toUpperCase()) < 1) {
dbManager
.exeSql("create table TEMP_BI_DJHZ(FIELDNAME varchar(200),FIELDVALUE VARCHAR(8000))");
}
}
cur.close();
cur = null;
}
dbManager.closeDB();
break;
default:
break;
}
return true;
}
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
if (newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) {
Toast.makeText(this, "转换横屏", Toast.LENGTH_SHORT).show();
} else if (newConfig.orientation == Configuration.ORIENTATION_PORTRAIT) {
Toast.makeText(this, "转换竖屏", Toast.LENGTH_SHORT).show();
}
}
}

View File

@ -0,0 +1,120 @@
package com.activity.chaoran;
import java.io.ByteArrayInputStream;
import java.io.ObjectInputStream;
import java.util.ArrayList;
import java.util.List;
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.activity.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 {
private ListView listView;
private List mData;
SimpleAdapter adapter;
Runnable downloadRun = new Runnable() {
public void run() {
purview();
}
};
private Handler handler = new Handler() {
@Override
// 当有消息发送出来的时候就执行Handler的这个方法
public void handleMessage(Message msg) {
adapter.notifyDataSetChanged();
}
};
public void purview(){
try {
String url = SysData.url+"/ChaoRanBI/webservice/ServiceInterface?wsdl";
System.out.println(url);
String method = "selectAndroidPurview";
SoapObject rpc = new SoapObject("", method);
rpc.addProperty("userid",SysData.userid);
HttpTransportSE ht = new HttpTransportSE(url);
ht.debug = true;
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
SoapEnvelope.VER11);
envelope.bodyOut = rpc;
envelope.dotNet = true;
envelope.setOutputSoapObject(rpc);
ht.call("", envelope);
if (envelope.getResponse() != null) {// 判断是否返回结果,因为我这个是一个查询操作,是带有返回值的。
byte[] bb = org.kobjects.base64.Base64.decode(envelope
.getResponse().toString());
ByteArrayInputStream bin = new ByteArrayInputStream(bb);
ObjectInputStream oin = new ObjectInputStream(bin);
List list= (List) oin.readObject();
// for(int i=0;i<list.size();i++){
// mData.add(list.get(i));
// }
mData.addAll(list);
System.out.println(mData.size()+"----------");
Message message = new Message();
handler.sendMessage(message);
}
} catch (Exception e) {
e.printStackTrace();
}
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
new Thread(downloadRun).start();
System.out.println("--------------------------------------");
// for(int i=0;i<9;i++){
// Map m=new HashMap();
// m.put("mname","第"+i+"个选项");
//
// }
mData=new ArrayList();
adapter = new SimpleAdapter(this,mData,R.layout.activity_menu,
new String[]{"mname"},
new int[]{R.id.title});
listView=new ListView(this);
listView.setAdapter(adapter);
OnItemClickListener lis1 = new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,
long arg3) {
Map map=(Map)mData.get(arg2);
// System.out.println(map.get("gn_no"));
Intent intent = new Intent();
intent.putExtra("formlx", map.get("gn_no").toString());
intent.setClass(getApplicationContext(), DjActivity.class);
startActivity(intent);
}
};
listView.setOnItemClickListener(lis1);
setContentView(listView);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.activity_menu, menu);
return true;
}
}

View File

@ -0,0 +1,228 @@
package com.activity.chaoran;
import java.io.IOException;
import java.util.Vector;
import android.app.Activity;
import android.content.Intent;
import android.content.res.AssetFileDescriptor;
import android.graphics.Bitmap;
import android.media.AudioManager;
import android.media.MediaPlayer;
import android.media.MediaPlayer.OnCompletionListener;
import android.os.Bundle;
import android.os.Handler;
import android.view.SurfaceHolder;
import android.view.SurfaceHolder.Callback;
import android.view.SurfaceView;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.Toast;
import com.activity.chaoran.R;
import com.google.zxing.BarcodeFormat;
import com.google.zxing.Result;
import com.mining.app.zxing.camera.CameraManager;
import com.mining.app.zxing.decoding.CaptureActivityHandler;
import com.mining.app.zxing.decoding.InactivityTimer;
import com.mining.app.zxing.view.ViewfinderView;
/**
* 摄像头扫描条码
*/
public class MipcaActivityCapture extends Activity implements Callback {
private CaptureActivityHandler handler;
private ViewfinderView viewfinderView;
private boolean hasSurface;
private Vector<BarcodeFormat> decodeFormats;
private String characterSet;
private InactivityTimer inactivityTimer;
private MediaPlayer mediaPlayer;
private boolean playBeep;
private static final float BEEP_VOLUME = 0.10f;
private boolean vibrate;
private String uiId;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.camerascansctivity);
//ViewUtil.addTopView(getApplicationContext(), this, R.string.scan_card);
CameraManager.init(getApplication());
viewfinderView = (ViewfinderView) findViewById(R.id.viewfinder_view);
Intent intent = getIntent();
uiId = intent.getStringExtra("uiId");
Button mButtonBack = (Button) findViewById(R.id.button_back);
mButtonBack.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
MipcaActivityCapture.this.finish();
}
});
hasSurface = false;
inactivityTimer = new InactivityTimer(this);
}
@Override
protected void onResume() {
super.onResume();
SurfaceView surfaceView = (SurfaceView) findViewById(R.id.preview_view);
SurfaceHolder surfaceHolder = surfaceView.getHolder();
if (hasSurface) {
initCamera(surfaceHolder);
} else {
surfaceHolder.addCallback(this);
surfaceHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
}
decodeFormats = null;
characterSet = null;
playBeep = true;
AudioManager audioService = (AudioManager) getSystemService(AUDIO_SERVICE);
if (audioService.getRingerMode() != AudioManager.RINGER_MODE_NORMAL) {
playBeep = false;
}
initBeepSound();
vibrate = true;
}
@Override
protected void onPause() {
super.onPause();
if (handler != null) {
handler.quitSynchronously();
handler = null;
}
CameraManager.get().closeDriver();
}
@Override
protected void onDestroy() {
inactivityTimer.shutdown();
super.onDestroy();
}
/**
* 处理扫描结果
* @param result
* @param barcode
*/
public void handleDecode(Result result, Bitmap barcode) {
inactivityTimer.onActivity();
playBeepSoundAndVibrate();
String resultString = result.getText();
if (resultString.equals("")) {
Toast.makeText(MipcaActivityCapture.this, "Scan failed!", Toast.LENGTH_SHORT).show();
}else {
Intent resultIntent = new Intent();
Bundle bundle = new Bundle();
bundle.putString("tm", resultString);
bundle.putString("uiId",uiId);
System.out.println(resultString+"==============-"+uiId+"--------------------------------------------------------");
// bundle.putParcelable("bitmap", barcode);
resultIntent.putExtras(bundle);
this.setResult(4, resultIntent);
}
MipcaActivityCapture.this.finish();
}
private void initCamera(SurfaceHolder surfaceHolder) {
try {
CameraManager.get().openDriver(surfaceHolder);
} catch (IOException ioe) {
return;
} catch (RuntimeException e) {
return;
}
if (handler == null) {
handler = new CaptureActivityHandler(this, decodeFormats,
characterSet);
}
}
@Override
public void surfaceChanged(SurfaceHolder holder, int format, int width,
int height) {
}
@Override
public void surfaceCreated(SurfaceHolder holder) {
if (!hasSurface) {
hasSurface = true;
initCamera(holder);
}
}
@Override
public void surfaceDestroyed(SurfaceHolder holder) {
hasSurface = false;
}
public ViewfinderView getViewfinderView() {
return viewfinderView;
}
public Handler getHandler() {
return handler;
}
public void drawViewfinder() {
viewfinderView.drawViewfinder();
}
private void initBeepSound() {
if (playBeep && mediaPlayer == null) {
// The volume on STREAM_SYSTEM is not adjustable, and users found it
// too loud,
// so we now play on the music stream.
setVolumeControlStream(AudioManager.STREAM_MUSIC);
mediaPlayer = new MediaPlayer();
mediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
mediaPlayer.setOnCompletionListener(beepListener);
AssetFileDescriptor file = getResources().openRawResourceFd(
R.raw.beep);
try {
mediaPlayer.setDataSource(file.getFileDescriptor(),
file.getStartOffset(), file.getLength());
file.close();
mediaPlayer.setVolume(BEEP_VOLUME, BEEP_VOLUME);
mediaPlayer.prepare();
} catch (IOException e) {
mediaPlayer = null;
}
}
}
private static final long VIBRATE_DURATION = 200L;
private void playBeepSoundAndVibrate() {
if (playBeep && mediaPlayer != null) {
mediaPlayer.start();
}
// if (vibrate) {
// Vibrator vibrator = (Vibrator) getSystemService(VIBRATOR_SERVICE);
// vibrator.vibrate(VIBRATE_DURATION);
// }
}
/**
* When the beep has finished playing, rewind to queue up another one.
*/
private final OnCompletionListener beepListener = new OnCompletionListener() {
public void onCompletion(MediaPlayer mediaPlayer) {
mediaPlayer.seekTo(0);
}
};
}

View File

@ -0,0 +1,239 @@
package com.activity.chaoran;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.util.HashMap;
import org.kobjects.base64.Base64;
import com.chaoran.db.SqlHelpUtil;
import com.activity.chaoran.R;
import com.sys.SysData;
import com.util.DialogUtil;
import com.util.IoUtil;
import com.util.SysUtil;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.view.Menu;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;
@SuppressLint("NewApi")
public class NetWorkSet extends Activity {
private EditText ip;
private EditText port;
private EditText itemName;
private EditText bz;
private SqlHelpUtil db;
private SQLiteDatabase sDatabase;
private Handler regHandler = new Handler() {
@Override
public void handleMessage(Message msg) {
super.handleMessage(msg);
if (msg.obj.equals("0")) {
DialogUtil.builder(NetWorkSet.this, "提示信息", "注册成功!", 0);
} else if (msg.obj.equals("1")) {
DialogUtil.builder(NetWorkSet.this, "提示信息", "该PDA已注册", 0);
} else {
DialogUtil.builder(NetWorkSet.this, "提示信息", "注册失败!" + msg.obj.toString(), 0);
}
}
};
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//
BufferedReader br = null;
BufferedWriter bw = null;
File file = new File(getFilesDir().getAbsolutePath() + "/cr_pda_config");
try {
if (!file.exists()) {
file.createNewFile();
//DialogUtil.builder(NetWorkSet.this, "错误信息", "文件不存在!", 0);
}
FileInputStream fis = new FileInputStream(file);
InputStreamReader isr = new InputStreamReader(fis);
br = new BufferedReader(isr);
String s = br.readLine();
if (s == null || s.trim().length() < 1)
throw new Exception("Update config data.");
MainActivity.def_pbl = Float.parseFloat(s);
if (MainActivity.def_pbl < 0.1 || MainActivity.def_pbl > 10.0)
throw new Exception("请填写 0.1~10.0 之间的浮点数!");
} catch (Exception e) {
DialogUtil.builder(NetWorkSet.this, "错误信息", e.getMessage(), 0);
MainActivity.def_pbl = 0.9f;
try {
FileOutputStream fos = new FileOutputStream(file);
OutputStreamWriter osw = new OutputStreamWriter(fos);
bw = new BufferedWriter(osw);
bw.append(Float.toString(MainActivity.def_pbl));
} catch (IOException e1) {
e1.printStackTrace();
}
} finally {
if (br != null) {
try {
br.close();
} catch (IOException e) {
e.printStackTrace();
}
}
if (bw != null) {
try {
bw.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
//
setContentView(R.layout.activity_net_work_set);
ip = (EditText) findViewById(R.id.ip);
port = (EditText) findViewById(R.id.port);
itemName = (EditText) findViewById(R.id.itemName);
bz = (EditText) findViewById(R.id.bz);
TextView mactv = (TextView) findViewById(R.id.mac);
mactv.setText("mac:" + SysUtil.getLocalMacAddress(NetWorkSet.this));
TextView androidIDtv = (TextView) findViewById(R.id.androidID);
androidIDtv.setText("sn:" + SysUtil.getSn());
EditText te = (EditText) findViewById(R.id.itemName91);
te.setText(Float.toString(MainActivity.def_pbl));
// MainActivity.this.getResources().getDisplayMetrics().densityDpi
TextView modeltv = (TextView) findViewById(R.id.model);
modeltv.setText("型号:" + android.os.Build.MODEL.toLowerCase());
//
TextView phoneDpi = (TextView) findViewById(R.id.phoneDpi);
phoneDpi.setText("密度:" + getResources().getDisplayMetrics().densityDpi);
//
db = new SqlHelpUtil(getApplicationContext());
sDatabase = db.getWritableDatabase();
System.out.println(sDatabase.getMaximumSize() + "--------------------------");
String selectStr = "select col1,col2,col3 from systable where desc='network'";
Cursor select_cursor = sDatabase.rawQuery(selectStr, null);
if (select_cursor.moveToFirst()) {
ip.setText(select_cursor.getString(0));
port.setText(select_cursor.getString(1));
itemName.setText(select_cursor.getString(2));
}
select_cursor.close();
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.activity_net_work_set, menu);
return true;
}
public void onsub(View v) {
EditText te = (EditText) findViewById(R.id.itemName91);
try {
MainActivity.def_pbl = Float.parseFloat(te.getText().toString());
} catch (Exception ex) {
DialogUtil.builder(NetWorkSet.this, "错误信息", "请填写 0.1~10.0 之间的浮点数!", 0);
MainActivity.def_pbl = 0.9f;
} finally {
if (MainActivity.def_pbl < 0.1 || MainActivity.def_pbl > 10.0) {
DialogUtil.builder(NetWorkSet.this, "错误信息", "请填写 0.1~10.0 之间的浮点数!", 0);
MainActivity.def_pbl = 0.9f;
}
}
//
BufferedWriter bw = null;
File file = new File(getFilesDir().getAbsolutePath() + "/cr_pda_config");
try {
FileOutputStream fos = new FileOutputStream(file);
OutputStreamWriter osw = new OutputStreamWriter(fos);
bw = new BufferedWriter(osw);
bw.append(Float.toString(MainActivity.def_pbl));
} catch (IOException e1) {
e1.printStackTrace();
} finally {
if (bw != null) {
try {
bw.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
//
// DialogUtil.builder(NetWorkSet.this, "错误信息", "请检查网络!" +
// MainActivity.def_pbl,0);
if (ip.getText().toString().trim().equals("")) {
DialogUtil.builder(NetWorkSet.this, "错误信息", "请填写IP", 0);
ip.requestFocus();
return;
}
if (port.getText().toString().trim().equals("")) {
DialogUtil.builder(NetWorkSet.this, "错误信息", "请填写端口!", 0);
port.requestFocus();
return;
}
if (itemName.getText().toString().trim().equals("")) {
DialogUtil.builder(NetWorkSet.this, "错误信息", "请填写工程名!", 0);
itemName.requestFocus();
return;
}
String selectStr = "select col1 from systable where desc='network'";
Cursor select_cursor = sDatabase.rawQuery(selectStr, null);
String ipValue = ip.getText().toString().trim();
String portValue = port.getText().toString().trim();
String itemNameValue = itemName.getText().toString().trim();
if (select_cursor.moveToFirst()) {
sDatabase.execSQL("update systable set col1='" + ipValue + "',col2='" + portValue + "',col3='" + itemNameValue + "' where desc='network'");
} else {
sDatabase.execSQL("insert into systable (col1,col2,col3,desc) values('" + ipValue + "','" + portValue + "','" + itemNameValue + "','network')");
}
select_cursor.close();
SysData.url = "http://".concat(ipValue).concat(":").concat(portValue).concat("/").concat(itemNameValue);
DialogUtil.builder(NetWorkSet.this, "提示", "设置成功!", 0);
}
public void onback(View v) {
// Intent intent = this.getIntent();
// setResult(0, intent);
finish();
}
public void pdaRegister(View v) throws Exception {
String mac = SysData.clientid;
if (mac == null || mac.length() < 1) {
DialogUtil.builder(NetWorkSet.this, "提示", "mac地址为空,请检查网络", 0);
return;
}
HashMap map = new HashMap();
map.put("mac", mac);
map.put("bz", bz.getText().toString().trim());
byte[] b = IoUtil.getbyte(map);
String paramString = Base64.encode(b);
new RunYmupThread(paramString, regHandler, "pdaRegister", 0).start();
}
@Override
protected void onDestroy() {
super.onDestroy();
if (db != null) {
db.close();
sDatabase.close();
}
}
}

View File

@ -0,0 +1,107 @@
package com.activity.chaoran;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import com.chaoran.component.MyAdapter;
import com.chaoran.entiry.DataGrid;
import com.activity.chaoran.R;
import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.graphics.Color;
import android.view.KeyEvent;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.AdapterView.OnItemClickListener;
public class ParamActivity extends Activity {
private ListView listView;
private List listdata;
private TextView tv;
private MyAdapter mxAdapter;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_param);
listView = (ListView) findViewById(R.id.list);
tv = (TextView) findViewById(R.id.tvtitle);
final Intent intent = getIntent();
DataGrid dg = (DataGrid) intent.getSerializableExtra("dg");
listdata = dg.getTableData();
// SimpleAdapter mxAdapter = new SimpleAdapter(this,listdata,
// R.layout.activity_menu,
// new String[] {dg.getTableHead().get(0).get("columnName").toString()},
// new int[] { R.id.title });
mxAdapter = new MyAdapter(this, (ArrayList) listdata, dg.getTableHead()
.get(0).get("columnName").toString());
tv.setText(dg.getTableHead().get(0).get("columnChineseName").toString());
listView.setAdapter(mxAdapter);
// listView.setChoiceMode(ListView.CHOICE_MODE_SINGLE);//
// 一定要设置这个属性否则ListView不会刷新
OnItemClickListener lis1 = new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,
long arg3) {
// mxAdapter.cur_pos=arg2;
arg1.setBackgroundColor(Color.GREEN);
Serializable map = (Serializable) listdata.get(arg2);
// Intent int =getIntent();
// intent.putExtra("param",map);
intent.putExtra("param", map);
intent.putExtra("audioFld",
intent.getSerializableExtra("audioFld"));
setResult(1, intent);
clear();
}
};
listView.setOnItemClickListener(lis1);
}
public void onback(View v) {
clear();
}
public boolean onKeyUp(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK && event.isTracking()
&& !event.isCanceled()) {
clear();
return true;
}
if (keyCode == KeyEvent.KEYCODE_DPAD_DOWN) {
if (mxAdapter.cur_pos < listdata.size()) {
mxAdapter.cur_pos++;
listView.setSelection(mxAdapter.cur_pos);
mxAdapter.notifyDataSetChanged();
}
}
if (keyCode == KeyEvent.KEYCODE_DPAD_UP) {
if (mxAdapter.cur_pos >0) {
mxAdapter.cur_pos--;
listView.setSelection(mxAdapter.cur_pos);
mxAdapter.notifyDataSetChanged();
}
}
return super.onKeyUp(keyCode, event);
}
private void clear() {
listView = null;
tv = null;
if (listdata != null) {
listdata.clear();
listdata = null;
mxAdapter.clear();
mxAdapter = null;
}
finish();
}
}

View File

@ -0,0 +1,189 @@
package com.activity.chaoran;
import org.ksoap2.SoapEnvelope;
import org.ksoap2.serialization.SoapObject;
import org.ksoap2.serialization.SoapSerializationEnvelope;
import org.ksoap2.transport.HttpTransportSE;
import com.chaoran.db.SqlHelpUtil;
import com.activity.chaoran.R;
import com.sys.SysData;
import com.util.DialogUtil;
import com.util.SysUtil;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.app.Activity;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.view.Menu;
import android.view.View;
import android.widget.EditText;
public class PdaRegActivity extends Activity {
private EditText ip;
private EditText port;
private EditText itemName;
private SqlHelpUtil db;
private SQLiteDatabase sDatabase;
private Handler handler = new Handler() {
@Override
// 当有消息发送出来的时候就执行Handler的这个方法
public void handleMessage(Message msg) {
if (msg.what == -1) {
DialogUtil.builder(PdaRegActivity.this, "错误信息", "连接服务器失败,请检查网络!"
+ msg.obj,0);
} else if (msg.what == -2) {
DialogUtil.builder(PdaRegActivity.this, "错误信息", "返回值为空!",0);
} else{
String retunVal=msg.obj.toString();
if(retunVal.equals("-1")){
DialogUtil.builder(PdaRegActivity.this, "提示信息", "序列号还未注册!",0);
}else if(!retunVal.equals("Y")){
DialogUtil.builder(PdaRegActivity.this, "提示信息", "序列号还未启用!",0);
}else{
DialogUtil.builder(PdaRegActivity.this, "提示信息", "操作成功!",0);
String selectStr = "select col1 from systable where desc='pdaState'";
Cursor select_cursor = sDatabase.rawQuery(selectStr, null);
if (select_cursor.moveToFirst()) {
sDatabase.execSQL("update systable set col1='Y' where desc='pdaState'");
} else {
sDatabase
.execSQL("insert into systable (col1,desc) values('Y','pdaState')");
}
select_cursor.close();
SysData.isreg="Y";
}
}
}
};
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_pda_reg);
ip = (EditText) findViewById(R.id.ip);
port = (EditText) findViewById(R.id.port);
itemName = (EditText) findViewById(R.id.itemName);
db = new SqlHelpUtil(getApplicationContext());
sDatabase = db.getWritableDatabase();
String selectStr = "select col1,col2,col3 from systable where desc='pdaRegServer'";
Cursor select_cursor = sDatabase.rawQuery(selectStr, null);
if (select_cursor.moveToFirst()) {
ip.setText(select_cursor.getString(0));
port.setText(select_cursor.getString(1));
itemName.setText(select_cursor.getString(2));
}
select_cursor.close();
}
public void onsub(View v) {
if (ip.getText().toString().trim().equals("")) {
DialogUtil.builder(PdaRegActivity.this, "错误信息", "请填写服务器IP",0);
ip.requestFocus();
return;
}
if (port.getText().toString().trim().equals("")) {
DialogUtil.builder(PdaRegActivity.this, "错误信息", "请填写服务器端口!",0);
port.requestFocus();
return;
}
if (itemName.getText().toString().trim().equals("")) {
DialogUtil.builder(PdaRegActivity.this, "错误信息", "请填写工程名!",0);
itemName.requestFocus();
return;
}
String selectStr = "select col1 from systable where desc='pdaRegServer'";
Cursor select_cursor = sDatabase.rawQuery(selectStr, null);
String ipValue = ip.getText().toString().trim();
String portValue = port.getText().toString().trim();
String itemNameValue = itemName.getText().toString().trim();
if (select_cursor.moveToFirst()) {
sDatabase.execSQL("update systable set col1='" + ipValue
+ "',col2='" + portValue + "',col3='" + itemNameValue
+ "' where desc='pdaRegServer'");
} else {
sDatabase
.execSQL("insert into systable (col1,col2,col3,desc) values('"
+ ipValue
+ "','"
+ portValue
+ "','"
+ itemNameValue + "','pdaRegServer')");
}
select_cursor.close();
SysData.url = "http://".concat(ipValue).concat(":").concat(portValue)
.concat("/").concat(itemNameValue);
DialogUtil.builder(PdaRegActivity.this, "提示", "保存成功,请点下面的PDA注册按钮进行注册",0);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.activity_pda_reg, menu);
return true;
}
public void onback(View v) {
finish();
}
@Override
protected void onDestroy() {
super.onDestroy();
if (db != null) {
db.close();
sDatabase.close();
}
}
public void pdaRegister(View v) throws Exception {
String sn = SysUtil.getSn();
if (sn == null || sn.length() < 1) {
DialogUtil.builder(PdaRegActivity.this, "提示", "序列号为空,请联系供应商",0);
return;
}
new Thread(new PdaRegValidate()).start();
}
public class PdaRegValidate implements Runnable {
public void run() {
String ipValue = ip.getText().toString().trim();
String portValue = port.getText().toString().trim();
String itemNameValue = itemName.getText().toString().trim();
String url = "http://".concat(ipValue).concat(":")
.concat(portValue).concat("/").concat(itemNameValue);
url = url + "/webservice/ServiceInterface?wsdl";
System.out.println(url);
String method = "pdaZcValidate";
SoapObject rpc = new SoapObject("", method);
System.out.println(SysUtil.getSn());
rpc.addProperty("sn", SysUtil.getSn());
try {
HttpTransportSE ht = new HttpTransportSE(url, SysData.timeout);
ht.debug = true;
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
SoapEnvelope.VER11);
envelope.bodyOut = rpc;
envelope.dotNet = true;
envelope.setOutputSoapObject(rpc);
ht.call("", envelope);
if (envelope.getResponse() != null) {
String s=envelope.getResponse().toString();
Message message = new Message();
message.obj = s;
handler.sendMessage(message);
}else{
Message message = new Message();
message.what = -2;
handler.sendMessage(message);
}
} catch (Exception e) {
e.printStackTrace();
Message message = new Message();
message.what = -1;
message.obj = e.toString();
handler.sendMessage(message);
}
}
}
}

View File

@ -0,0 +1,87 @@
package com.activity.chaoran;
import android.os.Handler;
import android.os.Message;
import android.util.Log;
import com.chaoran.entiry.DataGrid;
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;
import java.util.HashMap;
import java.util.Map;
/*运行检索方案线程*/
public class RunSearchThread extends Thread {
private String sql;
private String param;
private Handler handler;
private String return_one;// 是否单行返回
private String audioFld;// 声音播放字段
public RunSearchThread(String sql, String param, Handler handler,
String return_one, String audioFld) {
this.sql = sql;
this.param = param;
this.handler = handler;
this.return_one = return_one;
this.audioFld = audioFld;
}
public RunSearchThread(String sql, String param, Handler handler) {
this.sql = sql;
this.param = param;
this.handler = handler;
}
public void run() {
super.run();
Log.v("RunSearchThread", "run执行");
try {
String url = SysData.url + "/webservice/ServiceInterface?wsdl";
String method = "runSearch";
SoapObject rpc = new SoapObject("", method);
rpc.addProperty("sql", sql);
rpc.addProperty("base64Param", param);
HttpTransportSE ht = new HttpTransportSE(url,SysData.timeout);
ht.debug = true;
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
SoapEnvelope.VER11);
envelope.bodyOut = rpc;
envelope.dotNet = true;
envelope.setOutputSoapObject(rpc);
ht.call("", envelope);
byte[] bb = org.kobjects.base64.Base64.decode(envelope
.getResponse().toString());
Object ob = IoUtil.byte_obj(bb);
if (ob instanceof DataGrid) {// 判断是否返回结果,因为我这个是一个查询操作,是带有返回值的。
DataGrid dg = (DataGrid) ob;
Map map = new HashMap();
if (return_one != null) {
map.put("return_one", return_one);
}
if (audioFld != null) {
map.put("audioFld", audioFld);
}
map.put("dg", dg);
Message msg = new Message();
msg.obj = map;
msg.arg1 = 1;
handler.sendMessage(msg);
} else {
Message msg = new Message();
msg.obj = ob.toString();
msg.what = -1;
handler.sendMessage(msg);
}
} catch (Exception e) {
Message msg = new Message();
msg.what = -1;
msg.obj = e.toString();
handler.sendMessage(msg);
}
}
}

View File

@ -0,0 +1,89 @@
package com.activity.chaoran;
import android.os.Handler;
import android.os.Message;
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 {
private String param;
private Handler handler;
private String methodName;
private int urlTy;// 0表示访问ServiceInterface,1表示访问offLineInventoryInterface
public RunYmupThread(String param, Handler handler, String methodName,
int urlTy) {
this.param = param;
this.handler = handler;
this.methodName = methodName;
this.urlTy = urlTy;
}
public void run() {
super.run();
Log.v("SearchThread", "run执行");
try {
String url = null;
if (urlTy == 0) {
url = SysData.url + "/webservice/ServiceInterface?wsdl";
} else if (urlTy == 1) {
url = SysData.url
+ "/webservice/offLineInventoryInterface?wsdl";
}
String method = methodName;
SoapObject rpc = new SoapObject("", method);
if (param != null) {
rpc.addProperty("param", param);
}
HttpTransportSE ht = new HttpTransportSE(url, SysData.timeout);
ht.debug = true;
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
SoapEnvelope.VER11);
envelope.bodyOut = rpc;
envelope.dotNet = true;
envelope.setOutputSoapObject(rpc);
ht.call("", envelope);
if (envelope.getResponse() != null) {// 判断是否返回结果,因为我这个是一个查询操作,是带有返回值的。
Message msg = new Message();
if (methodName.equals("saveDj")) {
msg.arg1 = 3;
msg.obj = envelope.getResponse().toString();
} else if (methodName.equals("pdaRegister")) {
msg.obj = envelope.getResponse().toString();
} else {
byte[] bb = org.kobjects.base64.Base64.decode(envelope
.getResponse().toString());
msg.obj = IoUtil.byte_obj(bb);
if (methodName.equals("runYmup")) {
msg.arg1 = 2;
} else if (methodName.equals("runTqfa")) {
msg.arg1 = 4;
}
}
handler.sendMessage(msg);
} else {
Message msg = new Message();
msg.obj = null;
handler.sendMessage(msg);
}
} catch (Exception e) {
Message msg = new Message();
if (methodName.equals("runYmup")) {
msg.what = -2;
} else if (methodName.equals("saveDj")) {
msg.what = -3;
} else if (methodName.equals("runTqfa")) {
msg.what = -4;
}else{
msg.what = -1;
}
msg.obj = e.toString();
handler.sendMessage(msg);
}
}
}

View File

@ -0,0 +1,66 @@
package com.activity.chaoran;
import org.ksoap2.SoapEnvelope;
import org.ksoap2.serialization.SoapObject;
import org.ksoap2.serialization.SoapSerializationEnvelope;
import org.ksoap2.transport.HttpTransportSE;
import com.sys.SysData;
import android.os.Handler;
import android.os.Message;
import android.util.Log;
public class SearchThread extends Thread {
private String fangalx;
private String functionname;
private Handler handler;
private int type;// 0 表示检索方案 1表示 页面修改方案,2表示提取方案
public SearchThread(String fangalx, String functionname, Handler handler,
int type) {
this.fangalx = fangalx;
this.functionname = functionname;
this.handler = handler;
this.type = type;
}
public void run() {
super.run();
Log.v("SearchThread", "run执行");
try {
String url = SysData.url
+ "/webservice/ServiceInterface?wsdl";
String method = null;
if (type == 0) {
method = "queryZdysql";
} else if(type==1) {
method = "selectYmupSql";
}else if(type==2) {
method = "selectDjtqFun";
}
SoapObject rpc = new SoapObject("", method);
rpc.addProperty("fangalx", fangalx);
rpc.addProperty("functionname", functionname);
HttpTransportSE ht = new HttpTransportSE(url,SysData.timeout);
ht.debug = true;
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
SoapEnvelope.VER11);
envelope.bodyOut = rpc;
envelope.dotNet = true;
envelope.setOutputSoapObject(rpc);
ht.call("", envelope);
if (envelope.getResponse() != null) {// 判断是否返回结果,因为我这个是一个查询操作,是带有返回值的。
Message msg = new Message();
msg.obj = org.kobjects.base64.Base64.decode(envelope
.getResponse().toString());
msg.arg1 = type;
handler.sendMessage(msg);
}
} catch (Exception e) {
Message msg = new Message();
msg.what = -1;
msg.obj = e.toString();
handler.sendMessage(msg);
}
}
}

View File

@ -0,0 +1,80 @@
package com.activity.chaoran;
import android.app.Activity;
import android.app.ProgressDialog;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.view.View;
import android.widget.EditText;
import com.chaoran.thread.UpdatePwdThread;
import com.sys.SysData;
import com.util.DialogUtil;
public class UpdatePwdActivity extends Activity {
private EditText newPwd;
private EditText CfNewPwd;
public ProgressDialog pd;
private Handler handler = new Handler() {
@Override
// 当有消息发送出来的时候就执行Handler的这个方法
public void handleMessage(Message msg) {
if (pd != null) {
pd.dismiss();
}
if (msg.what == -1) {
DialogUtil.builder(UpdatePwdActivity.this, "错误信息", msg.obj.toString(),0);
}else{
if(msg.obj.equals("0")){
DialogUtil.builder(UpdatePwdActivity.this, "提示信息","修改密码成功",0);
}else{
DialogUtil.builder(UpdatePwdActivity.this, "错误信息","修改密码失败".concat( msg.obj.toString()),0);
}
}
}
};
@Override
public void onCreate(Bundle savedInstaneceState) {
super.onCreate(savedInstaneceState);
setContentView(R.layout.activity_update_pwd);
((EditText)findViewById(R.id.name)).setText(SysData.lgnname);
newPwd=(EditText)findViewById(R.id.newpwd);
CfNewPwd=(EditText)findViewById(R.id.cfnewpwd);
newPwd.requestFocus();
}
public void onsub(View v) {
String newPwdValue=newPwd.getText().toString().trim();
if(newPwdValue.equals("")){
DialogUtil.builder(this, "错误信息", "请填写新密码!",0);
newPwd.requestFocus();
return;
}
String CfNewPwdValue=CfNewPwd.getText().toString().trim();
if(CfNewPwdValue.equals("")){
DialogUtil.builder(this, "错误信息", "请填写重复密码!",0);
CfNewPwd.requestFocus();
return;
}
if(!CfNewPwdValue.equals(newPwdValue)){
DialogUtil.builder(this, "错误信息", "新密码和重复密码不一致!",0);
newPwd.requestFocus();
return;
}
if (pd == null) {
pd = ProgressDialog.show(this, "提示", "正在操作……");
} else {
DialogUtil.setDialog(pd, "提示", "正在操作……");
}
new Thread(new UpdatePwdThread(handler,SysData.userid,newPwdValue)).start();
}
protected void onDestroy() {
super.onDestroy();
if (pd != null) {
pd=null;
}
handler=null;
}
}

View File

@ -1,22 +1,13 @@
package com.chaoran.lx.thread;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.StreamCorruptedException;
import java.util.HashMap;
import java.util.List;
import android.database.Cursor;
import android.os.Handler;
import android.os.Message;
import com.chaoran.db.DBManager;
import com.chaoran.entiry.DanJuEntity;
import com.chaoran.entiry.Sys_DanJuFormsOptions;
import com.util.DateUtil;
import flex.messaging.io.ArrayList;
import java.util.HashMap;
public class LxDJNrThread implements Runnable {
private DBManager dbManager;

File diff suppressed because it is too large Load Diff

View File

@ -38,207 +38,207 @@ import android.widget.TextView;
*/
@SuppressLint("NewApi")
public class NetWorkSet extends Activity {
private EditText ip;
private EditText port;
private EditText itemName;
private EditText bz;
private SqlHelpUtil db;
private SQLiteDatabase sDatabase;
private EditText ip;
private EditText port;
private EditText itemName;
private EditText bz;
private SqlHelpUtil db;
private SQLiteDatabase sDatabase;
private TextView supportDevices;
private Handler regHandler = new Handler() {
@Override
public void handleMessage(Message msg) {
super.handleMessage(msg);
if (msg.obj.equals("0")) {
DialogUtil.builder(NetWorkSet.this, "提示信息", "注册成功!", 0);
} else if (msg.obj.equals("1")) {
DialogUtil.builder(NetWorkSet.this, "提示信息", "该PDA已注册", 0);
} else {
DialogUtil.builder(NetWorkSet.this, "提示信息", "注册失败!" + msg.obj.toString(), 0);
}
}
};
private Handler regHandler = new Handler() {
@Override
public void handleMessage(Message msg) {
super.handleMessage(msg);
if (msg.obj.equals("0")) {
DialogUtil.builder(NetWorkSet.this, "提示信息", "注册成功!", 0);
} else if (msg.obj.equals("1")) {
DialogUtil.builder(NetWorkSet.this, "提示信息", "该PDA已注册", 0);
} else {
DialogUtil.builder(NetWorkSet.this, "提示信息", "注册失败!" + msg.obj.toString(), 0);
}
}
};
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//
BufferedReader br = null;
BufferedWriter bw = null;
File file = new File(getFilesDir().getAbsolutePath() + "/cr_pda_config");
try {
if (!file.exists()) {
file.createNewFile();
//DialogUtil.builder(NetWorkSet.this, "错误信息", "文件不存在!", 0);
}
FileInputStream fis = new FileInputStream(file);
InputStreamReader isr = new InputStreamReader(fis);
br = new BufferedReader(isr);
String s = br.readLine();
if (s == null || s.trim().length() < 1)
throw new Exception("Update config data.");
MainActivity.def_pbl = Float.parseFloat(s);
if (MainActivity.def_pbl < 0.1 || MainActivity.def_pbl > 10.0)
throw new Exception("请填写 0.1~10.0 之间的浮点数!");
} catch (Exception e) {
DialogUtil.builder(NetWorkSet.this, "错误信息", e.getMessage(), 0);
MainActivity.def_pbl = 0.9f;
try {
FileOutputStream fos = new FileOutputStream(file);
OutputStreamWriter osw = new OutputStreamWriter(fos);
bw = new BufferedWriter(osw);
bw.append(Float.toString(MainActivity.def_pbl));
} catch (IOException e1) {
e1.printStackTrace();
}
} finally {
if (br != null) {
try {
br.close();
} catch (IOException e) {
e.printStackTrace();
}
}
if (bw != null) {
try {
bw.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
//
setContentView(R.layout.activity_net_work_set);
ip = (EditText) findViewById(R.id.ip);
port = (EditText) findViewById(R.id.port);
itemName = (EditText) findViewById(R.id.itemName);
bz = (EditText) findViewById(R.id.bz);
TextView mactv = (TextView) findViewById(R.id.mac);
mactv.setText("mac:" + SysUtil.getLocalMacAddress(NetWorkSet.this));
TextView androidIDtv = (TextView) findViewById(R.id.androidID);
androidIDtv.setText("sn:" + SysUtil.getSn());
EditText te = (EditText) findViewById(R.id.itemName91);
te.setText(Float.toString(MainActivity.def_pbl));
// MainActivity.this.getResources().getDisplayMetrics().densityDpi
TextView modeltv = (TextView) findViewById(R.id.model);
modeltv.setText("型号:" + android.os.Build.MODEL.toLowerCase());
//
TextView phoneDpi = (TextView) findViewById(R.id.phoneDpi);
phoneDpi.setText("密度:" + getResources().getDisplayMetrics().densityDpi);
//
db = new SqlHelpUtil(getApplicationContext());
sDatabase = db.getWritableDatabase();
System.out.println(sDatabase.getMaximumSize() + "--------------------------");
String selectStr = "select col1,col2,col3 from systable where desc='network'";
Cursor select_cursor = sDatabase.rawQuery(selectStr, null);
if (select_cursor.moveToFirst()) {
ip.setText(select_cursor.getString(0));
port.setText(select_cursor.getString(1));
itemName.setText(select_cursor.getString(2));
}
select_cursor.close();
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//
BufferedReader br = null;
BufferedWriter bw = null;
File file = new File(getFilesDir().getAbsolutePath() + "/cr_pda_config");
try {
if (!file.exists()) {
file.createNewFile();
//DialogUtil.builder(NetWorkSet.this, "错误信息", "文件不存在!", 0);
}
FileInputStream fis = new FileInputStream(file);
InputStreamReader isr = new InputStreamReader(fis);
br = new BufferedReader(isr);
String s = br.readLine();
if (s == null || s.trim().length() < 1)
throw new Exception("Update config data.");
MainActivity.def_pbl = Float.parseFloat(s);
if (MainActivity.def_pbl < 0.1 || MainActivity.def_pbl > 10.0)
throw new Exception("请填写 0.1~10.0 之间的浮点数!");
} catch (Exception e) {
DialogUtil.builder(NetWorkSet.this, "错误信息", e.getMessage(), 0);
MainActivity.def_pbl = 0.9f;
try {
FileOutputStream fos = new FileOutputStream(file);
OutputStreamWriter osw = new OutputStreamWriter(fos);
bw = new BufferedWriter(osw);
bw.append(Float.toString(MainActivity.def_pbl));
} catch (IOException e1) {
e1.printStackTrace();
}
} finally {
if (br != null) {
try {
br.close();
} catch (IOException e) {
e.printStackTrace();
}
}
if (bw != null) {
try {
bw.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
setContentView(R.layout.activity_net_work_set);
ip = (EditText) findViewById(R.id.ip);
port = (EditText) findViewById(R.id.port);
itemName = (EditText) findViewById(R.id.itemName);
bz = (EditText) findViewById(R.id.bz);
TextView mactv = (TextView) findViewById(R.id.mac);
mactv.setText("mac:" + SysUtil.getLocalMacAddress(NetWorkSet.this));
TextView androidIDtv = (TextView) findViewById(R.id.androidID);
androidIDtv.setText("sn:" + SysUtil.getSn());
EditText te = (EditText) findViewById(R.id.itemName91);
te.setText(Float.toString(MainActivity.def_pbl));
// MainActivity.this.getResources().getDisplayMetrics().densityDpi
TextView modeltv = (TextView) findViewById(R.id.model);
modeltv.setText("型号:" + android.os.Build.MODEL.toLowerCase());
//
TextView phoneDpi = (TextView) findViewById(R.id.phoneDpi);
phoneDpi.setText("密度:" + getResources().getDisplayMetrics().densityDpi);
//
db = new SqlHelpUtil(getApplicationContext());
sDatabase = db.getWritableDatabase();
System.out.println(sDatabase.getMaximumSize() + "--------------------------");
String selectStr = "select col1,col2,col3 from systable where desc='network'";
Cursor select_cursor = sDatabase.rawQuery(selectStr, null);
if (select_cursor.moveToFirst()) {
ip.setText(select_cursor.getString(0));
port.setText(select_cursor.getString(1));
itemName.setText(select_cursor.getString(2));
}
select_cursor.close();
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.activity_net_work_set, menu);
return true;
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.activity_net_work_set, menu);
return true;
}
public void onsub(View v) {
EditText te = (EditText) findViewById(R.id.itemName91);
try {
MainActivity.def_pbl = Float.parseFloat(te.getText().toString());
} catch (Exception ex) {
DialogUtil.builder(NetWorkSet.this, "错误信息", "请填写 0.1~10.0 之间的浮点数!", 0);
MainActivity.def_pbl = 0.9f;
} finally {
if (MainActivity.def_pbl < 0.1 || MainActivity.def_pbl > 10.0) {
DialogUtil.builder(NetWorkSet.this, "错误信息", "请填写 0.1~10.0 之间的浮点数!", 0);
MainActivity.def_pbl = 0.9f;
}
}
//
BufferedWriter bw = null;
File file = new File(getFilesDir().getAbsolutePath() + "/cr_pda_config");
public void onsub(View v) {
EditText te = (EditText) findViewById(R.id.itemName91);
try {
MainActivity.def_pbl = Float.parseFloat(te.getText().toString());
} catch (Exception ex) {
DialogUtil.builder(NetWorkSet.this, "错误信息", "请填写 0.1~10.0 之间的浮点数!", 0);
MainActivity.def_pbl = 0.9f;
} finally {
if (MainActivity.def_pbl < 0.1 || MainActivity.def_pbl > 10.0) {
DialogUtil.builder(NetWorkSet.this, "错误信息", "请填写 0.1~10.0 之间的浮点数!", 0);
MainActivity.def_pbl = 0.9f;
}
}
//
BufferedWriter bw = null;
File file = new File(getFilesDir().getAbsolutePath() + "/cr_pda_config");
try {
FileOutputStream fos = new FileOutputStream(file);
OutputStreamWriter osw = new OutputStreamWriter(fos);
bw = new BufferedWriter(osw);
bw.append(Float.toString(MainActivity.def_pbl));
} catch (IOException e1) {
e1.printStackTrace();
} finally {
if (bw != null) {
try {
bw.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
//
// DialogUtil.builder(NetWorkSet.this, "错误信息", "请检查网络!" +
// MainActivity.def_pbl,0);
if (ip.getText().toString().trim().equals("")) {
DialogUtil.builder(NetWorkSet.this, "错误信息", "请填写IP", 0);
ip.requestFocus();
return;
}
if (port.getText().toString().trim().equals("")) {
DialogUtil.builder(NetWorkSet.this, "错误信息", "请填写端口!", 0);
port.requestFocus();
return;
}
if (itemName.getText().toString().trim().equals("")) {
DialogUtil.builder(NetWorkSet.this, "错误信息", "请填写工程名!", 0);
itemName.requestFocus();
return;
}
String selectStr = "select col1 from systable where desc='network'";
Cursor select_cursor = sDatabase.rawQuery(selectStr, null);
String ipValue = ip.getText().toString().trim();
String portValue = port.getText().toString().trim();
String itemNameValue = itemName.getText().toString().trim();
if (select_cursor.moveToFirst()) {
sDatabase.execSQL("update systable set col1='" + ipValue + "',col2='" + portValue + "',col3='" + itemNameValue + "' where desc='network'");
} else {
sDatabase.execSQL("insert into systable (col1,col2,col3,desc) values('" + ipValue + "','" + portValue + "','" + itemNameValue + "','network')");
}
select_cursor.close();
SysData.url = "http://".concat(ipValue).concat(":").concat(portValue).concat("/").concat(itemNameValue);
DialogUtil.builder(NetWorkSet.this, "提示", "设置成功!", 0);
}
try {
FileOutputStream fos = new FileOutputStream(file);
OutputStreamWriter osw = new OutputStreamWriter(fos);
bw = new BufferedWriter(osw);
bw.append(Float.toString(MainActivity.def_pbl));
} catch (IOException e1) {
e1.printStackTrace();
} finally {
if (bw != null) {
try {
bw.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
//
// DialogUtil.builder(NetWorkSet.this, "错误信息", "请检查网络!" +
// MainActivity.def_pbl,0);
if (ip.getText().toString().trim().equals("")) {
DialogUtil.builder(NetWorkSet.this, "错误信息", "请填写IP", 0);
ip.requestFocus();
return;
}
if (port.getText().toString().trim().equals("")) {
DialogUtil.builder(NetWorkSet.this, "错误信息", "请填写端口!", 0);
port.requestFocus();
return;
}
if (itemName.getText().toString().trim().equals("")) {
DialogUtil.builder(NetWorkSet.this, "错误信息", "请填写工程名!", 0);
itemName.requestFocus();
return;
}
String selectStr = "select col1 from systable where desc='network'";
Cursor select_cursor = sDatabase.rawQuery(selectStr, null);
String ipValue = ip.getText().toString().trim();
String portValue = port.getText().toString().trim();
String itemNameValue = itemName.getText().toString().trim();
if (select_cursor.moveToFirst()) {
sDatabase.execSQL("update systable set col1='" + ipValue + "',col2='" + portValue + "',col3='" + itemNameValue + "' where desc='network'");
} else {
sDatabase.execSQL("insert into systable (col1,col2,col3,desc) values('" + ipValue + "','" + portValue + "','" + itemNameValue + "','network')");
}
select_cursor.close();
SysData.url = "http://".concat(ipValue).concat(":").concat(portValue).concat("/").concat(itemNameValue);
DialogUtil.builder(NetWorkSet.this, "提示", "设置成功!", 0);
}
public void onback(View v) {
// Intent intent = this.getIntent();
// setResult(0, intent);
finish();
public void onback(View v) {
// Intent intent = this.getIntent();
// setResult(0, intent);
finish();
}
}
public void pdaRegister(View v) throws Exception {
String mac = SysData.clientid;
if (mac == null || mac.length() < 1) {
DialogUtil.builder(NetWorkSet.this, "提示", "mac地址为空,请检查网络", 0);
return;
}
HashMap map = new HashMap();
map.put("mac", mac);
map.put("bz", bz.getText().toString().trim());
byte[] b = IoUtil.getbyte(map);
String paramString = Base64.encode(b);
new RunYmupThread(paramString, regHandler, "pdaRegister", 0).start();
}
public void pdaRegister(View v) throws Exception {
String mac = SysData.clientid;
if (mac == null || mac.length() < 1) {
DialogUtil.builder(NetWorkSet.this, "提示", "mac地址为空,请检查网络", 0);
return;
}
HashMap map = new HashMap();
map.put("mac", mac);
map.put("bz", bz.getText().toString().trim());
byte[] b = IoUtil.getbyte(map);
String paramString = Base64.encode(b);
new RunYmupThread(paramString, regHandler, "pdaRegister", 0).start();
}
@Override
protected void onDestroy() {
super.onDestroy();
if (db != null) {
db.close();
sDatabase.close();
}
}
@Override
protected void onDestroy() {
super.onDestroy();
if (db != null) {
db.close();
sDatabase.close();
}
}
}

View File

@ -1,27 +1,23 @@
package com.example.chaoran;
import android.app.Activity;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.view.Menu;
import android.view.View;
import android.widget.EditText;
import com.chaoran.db.SqlHelpUtil;
import com.sys.SysData;
import com.util.DialogUtil;
import com.util.SysUtil;
import org.ksoap2.SoapEnvelope;
import org.ksoap2.serialization.SoapObject;
import org.ksoap2.serialization.SoapSerializationEnvelope;
import org.ksoap2.transport.HttpTransportSE;
import com.chaoran.db.SqlHelpUtil;
import com.example.chaoran.R;
import com.sys.SysData;
import com.util.DialogUtil;
import com.util.IoUtil;
import com.util.SysUtil;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.app.Activity;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.view.Menu;
import android.view.View;
import android.widget.EditText;
/**
* pda注册窗口
*/

View File

@ -0,0 +1,139 @@
package com.example.chaoran;
/*
**********************************************
* DATE PERSON REASON
* 2021-02-05 FXY Created
**********************************************
*/
import android.app.Activity;
import android.content.Context;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.util.AttributeSet;
import android.view.View;
import android.widget.*;
import com.vioce.TekVoiceEngine;
import com.vioce.VoiceEngine;
/**
* 播报语音设置
*/
public class VoiceSettingActivity extends Activity {
private EditText testText;
private RadioButton voiceF, voiceY;
private SeekBar voiceSize, voiceSpeed, voiceIndicate;
private Button save, cancel;
private SharedPreferences sharedPreferences;
private RadioGroup voiceMemberGroup;
private VoiceEngine voiceEngine;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_voice);
initView();
initData();
initListener();
}
private void initView() {
testText = findViewById(R.id.voice_test_text);
voiceF = findViewById(R.id.voice_member_xiaofeng);
voiceY = findViewById(R.id.voice_member_xiaoyan);
voiceSize = findViewById(R.id.voice_size);
voiceSpeed = findViewById(R.id.voice_speed);
voiceIndicate = findViewById(R.id.voice_indicate);
save = findViewById(R.id.save_voice_setting);
cancel = findViewById(R.id.cancel_voice_setting);
voiceMemberGroup = findViewById(R.id.voice_member_group);
voiceEngine = new TekVoiceEngine(this);
}
private void initData() {
sharedPreferences = getSharedPreferences("voiceEngine", MODE_PRIVATE);
//设置测试文本
testText.setText(sharedPreferences.getString("testText", testText.getText().toString()));
//设置播报人员
String voiceMember = sharedPreferences.getString("voiceMember", "xiaofeng");
if (voiceMember.equals("xiaofeng")) {
voiceF.setChecked(true);
voiceY.setChecked(false);
} else {
voiceY.setChecked(true);
voiceF.setChecked(false);
}
//设置功能选项
voiceSize.setProgress(sharedPreferences.getInt("voiceSize", 100));
voiceSpeed.setProgress(sharedPreferences.getInt("voiceSpeed", 80));
voiceIndicate.setProgress(sharedPreferences.getInt("voiceIndicate", 50));
}
public void initListener() {
SeekBar.OnSeekBarChangeListener seekBarChangeListener = new SeekBar.OnSeekBarChangeListener() {
@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
}
@Override
public void onStartTrackingTouch(SeekBar seekBar) {
//停止播放
voiceEngine.stopSpeaking();
}
@Override
public void onStopTrackingTouch(SeekBar seekBar) {
//播放语音
voiceEngine.setParam(voiceF.isChecked() ? "xiaofeng" : "xiaoyan", voiceSize.getProgress(), voiceIndicate.getProgress(), voiceSpeed.getProgress());
voiceEngine.startSpeaking(testText.getText().toString());
}
};
voiceSize.setOnSeekBarChangeListener(seekBarChangeListener);
voiceIndicate.setOnSeekBarChangeListener(seekBarChangeListener);
voiceSpeed.setOnSeekBarChangeListener(seekBarChangeListener);
SharedPreferences.Editor editor = sharedPreferences.edit();
save.setOnClickListener(a -> {
editor.putInt("voiceSize", voiceSize.getProgress());
editor.putInt("voiceIndicate", voiceIndicate.getProgress());
editor.putInt("voiceSpeed", voiceSpeed.getProgress());
editor.putString("testText", testText.getText().toString());
editor.putString("voiceMember", voiceF.isChecked() ? "xiaofeng" : "xiaoyan");
editor.commit();
voiceEngine.stopSpeaking();
voiceEngine.destroy();
Toast.makeText(this, "语音配置保存成功!", Toast.LENGTH_SHORT).show();
this.finish();
});
cancel.setOnClickListener(a -> {
voiceEngine.stopSpeaking();
voiceEngine.destroy();
this.finish();
});
voiceMemberGroup.setOnCheckedChangeListener((a, b) -> {
//播放语音
voiceEngine.setParam(voiceF.isChecked() ? "xiaofeng" : "xiaoyan", voiceSize.getProgress(), voiceIndicate.getProgress(), voiceSpeed.getProgress());
voiceEngine.startSpeaking(testText.getText().toString());
});
}
@Override
protected void onStart() {
super.onStart();
//初始化加载一次
voiceEngine.setParam(voiceF.isChecked() ? "xiaofeng" : "xiaoyan", voiceSize.getProgress(), voiceIndicate.getProgress(), voiceSpeed.getProgress());
voiceEngine.startSpeaking(testText.getText().toString());
}
@Override
protected void onDestroy() {
voiceEngine.stopSpeaking();
voiceEngine.destroy();
super.onDestroy();
}
}

View File

@ -0,0 +1,219 @@
package com.vioce;
import android.content.Context;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.os.Environment;
import android.util.Log;
import android.widget.Toast;
import com.example.chaoran.R;
import com.iflytek.cloud.*;
import com.iflytek.cloud.util.ResourceUtil;
import com.iflytek.cloud.util.ResourceUtil.RESOURCE_TYPE;
/*
**********************************************
* DATE PERSON REASON
* 2021-02-05 FXY Created
**********************************************
*/
public class TekVoiceEngine implements VoiceEngine {
private static String TAG = "TekVoiceEngine";
// 语音合成对象
private SpeechSynthesizer mTts;
//缓冲进度
private int mPercentForBuffering = 0;
//播放进度
private int mPercentForPlaying = 0;
private Toast mToast;
private Context context;
public TekVoiceEngine(Context context) {
this.context = context;
// 初始化合成对象
mTts = SpeechSynthesizer.createSynthesizer(context, mTtsInitListener);
//设置合成引擎的参数
loadParam();
//初始化对话框
mToast = Toast.makeText(context, "", Toast.LENGTH_SHORT);
}
@Override
public void startSpeaking(String text) {
if (null == mTts) {
this.showTip("创建对象失败,请确认 libmsc.so 放置正确,\n 且有调用 createUtility 进行初始化");
}
if (mTts.isSpeaking())
stopSpeaking();
int code = mTts.startSpeaking(text, mTtsListener);
if (code != ErrorCode.SUCCESS) {
showTip("语音合成失败,错误码: " + code + ",请点击网址https://www.xfyun.cn/document/error-code查询解决方案");
}
}
@Override
public void stopSpeaking() {
mTts.stopSpeaking();
}
/**
* 初始化监听
*/
private InitListener mTtsInitListener = code -> {
Log.d(TAG, "InitListener init() code = " + code);
if (code != ErrorCode.SUCCESS) {
showTip("初始化失败,错误码:" + code + ",请点击网址https://www.xfyun.cn/document/error-code查询解决方案");
}
};
/**
* 合成回调监听。
*/
private SynthesizerListener mTtsListener = new SynthesizerListener() {
@Override
public void onSpeakBegin() {
Log.d(TAG, "开始播放:" + System.currentTimeMillis());
}
@Override
public void onSpeakPaused() {
showTip("暂停播放");
}
@Override
public void onSpeakResumed() {
showTip("继续播放");
}
@Override
public void onBufferProgress(int percent, int beginPos, int endPos,
String info) {
// 合成进度
mPercentForBuffering = percent;
showTip(String.format(context.getString(R.string.tts_toast_format),
mPercentForBuffering, mPercentForPlaying));
}
@Override
public void onSpeakProgress(int percent, int beginPos, int endPos) {
// 播放进度
mPercentForPlaying = percent;
showTip(String.format(context.getString(R.string.tts_toast_format),
mPercentForBuffering, mPercentForPlaying));
}
@Override
public void onCompleted(SpeechError error) {
if (error == null) {
showTip("播放完成");
} else if (error != null) {
showTip(error.getPlainDescription(true));
}
}
@Override
public void onEvent(int eventType, int arg1, int arg2, Bundle obj) {
// 以下代码用于获取与云端的会话id当业务出错时将会话id提供给技术支持人员可用于查询会话日志定位出错原因
// 若使用本地能力会话id为null
if (SpeechEvent.EVENT_SESSION_ID == eventType) {
String sid = obj.getString(SpeechEvent.KEY_EVENT_AUDIO_URL);
Log.d(TAG, "session id =" + sid);
}
}
};
public void loadParam() {
// 装载参数之前,先清空参数
mTts.setParameter(SpeechConstant.PARAMS, null);
SharedPreferences sharedPreferences = context.getSharedPreferences("voiceEngine", Context.MODE_PRIVATE);
//设置使用本地引擎
mTts.setParameter(SpeechConstant.ENGINE_TYPE, SpeechConstant.TYPE_LOCAL);
//设置发音人资源路径
String voicerLocal = sharedPreferences.getString("voiceMember", "xiaofeng");
mTts.setParameter(ResourceUtil.TTS_RES_PATH, getResourcePath(voicerLocal));
//设置发音人
mTts.setParameter(SpeechConstant.VOICE_NAME, voicerLocal);
//设置合成语速
mTts.setParameter(SpeechConstant.SPEED, String.valueOf(sharedPreferences.getInt("voiceSpeed", 80)));
//设置合成音调
mTts.setParameter(SpeechConstant.PITCH, String.valueOf(sharedPreferences.getInt("voiceIndicate", 50)));
//设置合成音量
mTts.setParameter(SpeechConstant.VOLUME, String.valueOf(sharedPreferences.getInt("voiceSize", 100)));
//设置播放器音频流类型
mTts.setParameter(SpeechConstant.STREAM_TYPE, "3");
// 设置播放合成音频打断音乐播放默认为true
mTts.setParameter(SpeechConstant.KEY_REQUEST_FOCUS, "true");
// 设置音频保存路径保存音频格式支持pcm、wav设置路径为sd卡请注意WRITE_EXTERNAL_STORAGE权限
mTts.setParameter(SpeechConstant.AUDIO_FORMAT, "wav");
mTts.setParameter(SpeechConstant.TTS_AUDIO_PATH, Environment.getExternalStorageDirectory() + "/msc/tts.wav");
}
@Override
public void setParam(String voiceMember, Integer voiceSize, Integer voiceIndicate, Integer voiceSpeed) {
if (null != voiceMember) {
//设置发音人资源路径
mTts.setParameter(ResourceUtil.TTS_RES_PATH, getResourcePath(voiceMember));
//设置发音人
mTts.setParameter(SpeechConstant.VOICE_NAME, voiceMember);
}
if (null != voiceSize) {
//设置合成音量
mTts.setParameter(SpeechConstant.VOLUME, String.valueOf(voiceSize));
}
if (null != voiceIndicate) {
//设置合成音调
mTts.setParameter(SpeechConstant.PITCH, String.valueOf(voiceIndicate));
}
if (null != voiceSpeed) {
//设置合成语速
mTts.setParameter(SpeechConstant.SPEED, String.valueOf(voiceSpeed));
}
}
private void showTip(String str) {
mToast.setText(str);
mToast.show();
}
//获取发音人资源路径
private String getResourcePath(String voiceMember) {
StringBuffer tempBuffer = new StringBuffer();
String type = "tts";
//合成通用资源
tempBuffer.append(ResourceUtil.generateResourcePath(context, RESOURCE_TYPE.assets, type.concat("/common.jet")));
tempBuffer.append(";");
tempBuffer.append(ResourceUtil.generateResourcePath(context, RESOURCE_TYPE.assets, type.concat("/").concat(voiceMember).concat(".jet")));
return tempBuffer.toString();
}
public void destroy() {
if (null != mTts) {
mTts.stopSpeaking();
// 退出时释放连接
mTts.destroy();
}
}
}

View File

@ -0,0 +1,27 @@
package com.vioce;
/*
**********************************************
* DATE PERSON REASON
* 2021-02-05 FXY Created
**********************************************
*/
public interface VoiceEngine {
//开始说话
public void startSpeaking(String text);
//停止说话
public void stopSpeaking();
//销毁资源
public void destroy();
//装载参数,从配置文件中装载参数
public void loadParam();
//设置参数
public void setParam(String voiceMember, Integer voiceSize, Integer voiceIndicate, Integer voiceSpeed);
}

View File

@ -6,61 +6,67 @@ import android.widget.Toast;
import com.baidu.mapapi.BMapManager;
import com.baidu.mapapi.MKEvent;
import com.baidu.mapapi.MKGeneralListener;
import com.example.chaoran.R;
import com.iflytek.cloud.SpeechConstant;
import com.iflytek.cloud.SpeechUtility;
public class BMapManagerUtil extends Application {
private static BMapManagerUtil bMapManagerUtil;
// 百度MapAPI的管理类
public BMapManager mBMapMan = null;
private static BMapManagerUtil bMapManagerUtil;
// 百度MapAPI的管理类
public BMapManager mBMapMan = null;
// 授权Key
// TODO: 请输入您的Key,
// 申请地址http://dev.baidu.com/wiki/static/imap/key/
public String mStrKey = "F49D31823069482466999FADEE70C34C80055379";
private boolean m_bKeyRight = true; // 授权Key正确验证通过
// 授权Key
// 申请地址http://dev.baidu.com/wiki/static/imap/key/
public String mStrKey = "F49D31823069482466999FADEE70C34C80055379";
// 常用事件监听,用来处理通常的网络错误,授权验证错误等
static class MyGeneralListener implements MKGeneralListener {
@Override
public void onGetNetworkState(int iError) {
Toast.makeText(bMapManagerUtil.getApplicationContext(), "您的网络出错啦!",
Toast.LENGTH_LONG).show();
}
// 常用事件监听,用来处理通常的网络错误,授权验证错误等
static class MyGeneralListener implements MKGeneralListener {
@Override
public void onGetNetworkState(int iError) {
Toast.makeText(bMapManagerUtil.getApplicationContext(), "您的网络出错啦!",
Toast.LENGTH_LONG).show();
}
@Override
public void onGetPermissionState(int iError) {
if (iError == MKEvent.ERROR_PERMISSION_DENIED) {
// 授权Key错误
Toast.makeText(bMapManagerUtil.getApplicationContext(),
"请在BMapApiDemoApp.java文件输入正确的授权Key", Toast.LENGTH_LONG)
.show();
bMapManagerUtil.m_bKeyRight = false;
@Override
public void onGetPermissionState(int iError) {
if (iError == MKEvent.ERROR_PERMISSION_DENIED) {
// 授权Key错误
Toast.makeText(bMapManagerUtil.getApplicationContext(),
"请在BMapApiDemoApp.java文件输入正确的授权Key", Toast.LENGTH_LONG)
.show();
}
}
}
}
}
}
@Override
public void onCreate() {
bMapManagerUtil = this;
mBMapMan = new BMapManager(this);
mBMapMan.init(this.mStrKey, new MyGeneralListener());
@Override
public void onCreate() {
bMapManagerUtil = this;
mBMapMan = new BMapManager(this);
mBMapMan.init(this.mStrKey, new MyGeneralListener());
super.onCreate();
}
//讯飞离线语音配置
StringBuffer param = new StringBuffer();
param.append("appid=" + getString(R.string.app_id));
param.append(",");
// 设置使用v5+
param.append(SpeechConstant.ENGINE_MODE + "=" + SpeechConstant.MODE_MSC);
SpeechUtility.createUtility(this, param.toString());
super.onCreate();
}
@Override
// 建议在您app的退出之前调用mapadpi的destroy()函数,避免重复初始化带来的时间消耗
public void onTerminate() {
// TODO Auto-generated method stub
if (mBMapMan != null) {
mBMapMan.destroy();
mBMapMan = null;
}
super.onTerminate();
}
@Override
// 建议在您app的退出之前调用mapadpi的destroy()函数,避免重复初始化带来的时间消耗
public void onTerminate() {
if (mBMapMan != null) {
mBMapMan.destroy();
mBMapMan = null;
}
super.onTerminate();
}
public static Context getGlobalApplicationContext() {
return bMapManagerUtil.getApplicationContext();
}
public static Context getGlobalApplicationContext(){
return bMapManagerUtil.getApplicationContext();
}
}

View File

@ -1,206 +1,213 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center" >
<TextView
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="6dip"
android:text="网络设置"
android:textColor="@android:color/black"
android:textSize="20dip" />
android:layout_gravity="center">
<LinearLayout
android:id="@+id/ipline"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/title"
android:layout_centerHorizontal="true"
android:orientation="horizontal" >
<TextView
android:id="@+id/text2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="主机IP:"
android:textColor="@android:color/black"
android:textSize="20dip" />
<EditText
android:id="@+id/ip"
android:layout_width="200dip"
android:layout_height="wrap_content"
android:hint="请输入IP地址"
android:singleLine="true" />
</LinearLayout>
<LinearLayout
android:id="@+id/portline"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/ipline"
android:layout_centerHorizontal="true"
android:orientation="horizontal" >
<TextView
android:id="@+id/text3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="端 口:"
android:textColor="@android:color/black"
android:textSize="20dip" />
<EditText
android:id="@+id/port"
android:layout_width="200dip"
android:layout_height="wrap_content"
android:hint="请输入端口"
android:singleLine="true" />
</LinearLayout>
<LinearLayout
android:id="@+id/objectline"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/portline"
android:layout_centerHorizontal="true"
android:orientation="horizontal">
<TextView
android:id="@+id/text4"
android:layout_width="wrap_content"
<TextView
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="6dip"
android:text="工程名:"
android:text="网络设置"
android:textColor="@android:color/black"
android:textSize="20dip" />
<EditText
android:id="@+id/itemName"
android:layout_width="200dip"
android:layout_height="wrap_content"
android:hint="请输入工程名"
android:singleLine="true"
android:text="ChaoRanBI_PDA" />
</LinearLayout>
<LinearLayout
android:id="@+id/fblline"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/objectline"
android:layout_centerHorizontal="true"
android:orientation="horizontal">
<TextView
android:id="@+id/text91"
<LinearLayout
android:id="@+id/ipline"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="6dip"
android:text="屏比率:"
android:textColor="@android:color/black"
android:textSize="20dip" />
android:layout_below="@+id/title"
android:layout_centerHorizontal="true"
android:orientation="horizontal">
<TextView
android:id="@+id/text2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="主机IP:"
android:textColor="@android:color/black"
android:textSize="20dip" />
<EditText
android:id="@+id/itemName91"
android:layout_width="200dip"
android:layout_height="wrap_content"
android:hint="范围 0.1~10.0"
android:singleLine="true"
android:text="0.9" />
android:id="@+id/ip"
android:layout_width="200dip"
android:layout_height="wrap_content"
android:hint="请输入IP地址"
android:singleLine="true" />
</LinearLayout>
<LinearLayout
android:id="@+id/gnline"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignRight="@id/ipline"
android:layout_below="@+id/fblline"
android:layout_centerHorizontal="true"
android:orientation="horizontal" >
android:id="@+id/portline"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/ipline"
android:layout_centerHorizontal="true"
android:orientation="horizontal">
<TextView
android:id="@+id/text3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="端 口:"
android:textColor="@android:color/black"
android:textSize="20dip" />
<EditText
android:id="@+id/port"
android:layout_width="200dip"
android:layout_height="wrap_content"
android:hint="请输入端口"
android:singleLine="true" />
</LinearLayout>
<LinearLayout
android:id="@+id/objectline"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/portline"
android:layout_centerHorizontal="true"
android:orientation="horizontal">
<TextView
android:id="@+id/text4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="6dip"
android:text="工程名:"
android:textColor="@android:color/black"
android:textSize="20dip" />
<EditText
android:id="@+id/itemName"
android:layout_width="200dip"
android:layout_height="wrap_content"
android:hint="请输入工程名"
android:singleLine="true"
android:text="ChaoRanBI_PDA" />
</LinearLayout>
<LinearLayout
android:id="@+id/fblline"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/objectline"
android:layout_centerHorizontal="true"
android:orientation="horizontal">
<TextView
android:id="@+id/text91"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="6dip"
android:text="屏比率:"
android:textColor="@android:color/black"
android:textSize="20dip" />
<EditText
android:id="@+id/itemName91"
android:layout_width="200dip"
android:layout_height="wrap_content"
android:hint="范围 0.1~10.0"
android:singleLine="true"
android:text="0.9" />
</LinearLayout>
<LinearLayout
android:id="@+id/gnline"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignRight="@id/ipline"
android:layout_below="@+id/fblline"
android:layout_centerHorizontal="true"
android:orientation="horizontal">
<Button
android:id="@+id/btn1"
android:layout_width="100dip"
android:layout_height="wrap_content"
android:onClick="onsub"
android:text="确定" />
android:id="@+id/btn1"
android:layout_width="100dip"
android:layout_height="wrap_content"
android:onClick="onsub"
android:text="确定" />
<Button
android:id="@+id/btn2"
android:layout_width="100dip"
android:layout_height="wrap_content"
android:onClick="onback"
android:text="返回" />
android:id="@+id/btn2"
android:layout_width="100dip"
android:layout_height="wrap_content"
android:onClick="onback"
android:text="返回" />
</LinearLayout>
<com.chaoran.component.AntLine
android:id="@+id/line"
android:layout_width="match_parent"
android:layout_height="6dip"
android:layout_below="@+id/gnline" />
<TextView
android:id="@+id/zc"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/line"
android:text="客户端注册 "
android:textColor="@android:color/black"
android:textSize="20dip" />
<LinearLayout
android:id="@+id/bzline"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/zc"
android:layout_centerHorizontal="true"
android:orientation="horizontal">
android:id="@+id/line"
android:layout_width="match_parent"
android:layout_height="6dip"
android:layout_below="@+id/gnline" />
<TextView
android:id="@+id/text5"
android:layout_width="wrap_content"
<TextView
android:id="@+id/zc"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="6dip"
android:text="注册备注:"
android:layout_below="@+id/line"
android:text="客户端注册 "
android:textColor="@android:color/black"
android:textSize="20dip" />
<EditText
android:id="@+id/bz"
android:layout_width="200dip"
<LinearLayout
android:id="@+id/bzline"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hint="备注信息"
android:singleLine="true"
android:text="" />
android:layout_below="@+id/zc"
android:layout_centerHorizontal="true"
android:orientation="horizontal">
<TextView
android:id="@+id/text5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="6dip"
android:text="注册备注:"
android:textColor="@android:color/black"
android:textSize="20dip" />
<EditText
android:id="@+id/bz"
android:layout_width="200dip"
android:layout_height="wrap_content"
android:hint="备注信息"
android:singleLine="true"
android:text="" />
</LinearLayout>
<Button
android:id="@+id/zubut"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/bzline"
android:onClick="pdaRegister"
android:text="注册" />
android:id="@+id/zubut"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/bzline"
android:onClick="pdaRegister"
android:text="注册" />
<TextView
android:id="@+id/mac"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/zubut" />
android:id="@+id/mac"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/zubut" />
<TextView
android:id="@+id/androidID"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/mac" />
<TextView
android:id="@+id/model"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/androidID" />
<TextView
android:id="@+id/phoneDpi"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/model" />
android:id="@+id/androidID"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/mac" />
<TextView
android:id="@+id/model"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/androidID" />
<TextView
android:id="@+id/phoneDpi"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/model" />
</RelativeLayout>

View File

@ -0,0 +1,147 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:weightSum="3"
android:orientation="vertical">
<EditText
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="left"
android:text="这是一段测试文本,可以进行编辑!"
android:id="@+id/voice_test_text"
android:layout_weight="2" />
<TableLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:stretchColumns="0,3"
android:layout_weight="1"
android:gravity="center_vertical"
android:id="@+id/table">
<TableRow android:layout_marginBottom="50px">
<TextView />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="15px"
android:paddingBottom="15px"
android:text="播报人员:" />
<RadioGroup
android:layout_width="wrap_content"
android:orientation="horizontal"
android:layout_gravity="center"
android:id="@+id/voice_member_group"
android:layout_height="match_parent">
<RadioButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="小峰"
android:id="@+id/voice_member_xiaofeng" />
<RadioButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="小燕"
android:layout_marginLeft="150px"
android:id="@+id/voice_member_xiaoyan" />
</RadioGroup>
<TextView />
</TableRow>
<TableRow android:layout_marginBottom="50px">
<TextView />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="播报音量:" />
<SeekBar
android:id="@+id/voice_size"
android:layout_width="wrap_content"
android:max="100"
android:min="0"
android:layout_height="match_parent" />
<TextView />
</TableRow>
<TableRow android:layout_marginBottom="50px">
<TextView />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="播报音调:" />
<SeekBar
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:max="100"
android:min="0"
android:id="@+id/voice_indicate" />
<TextView />
</TableRow>
<TableRow android:layout_marginBottom="50px">
<TextView />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="播报音速:" />
<SeekBar
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:max="200"
android:min="100"
android:id="@+id/voice_speed" />
<TextView />
</TableRow>
<TableRow>
<TextView />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/save_voice_setting"
android:text="保 存" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/cancel_voice_setting"
android:layout_marginLeft="10px"
android:text="取 消" />
<TextView />
</TableRow>
</TableLayout>
</LinearLayout>

View File

@ -1,5 +1,12 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@+id/updatePwd"
android:title="修改密码"
android:orderInCategory="100" />
<item
android:id="@+id/updatePwd"
android:title="修改密码"
android:orderInCategory="100" />
<item
android:id="@+id/voice_setting"
android:title="语音设置"
android:orderInCategory="200" />
</menu>

View File

@ -1,7 +1,5 @@
<resources>
<string name="app_name">ChaoRan</string>
<string name="hello_world">Hello world!</string>
<string name="menu_settings">Settings</string>
<string name="title_activity_main">超然系统</string>
<string name="title_activity_net_work_set">网络设置</string>
@ -21,14 +19,20 @@
<string name="title_activity_param">检索方案窗口</string>
<string name="djtq_activity">提取方案窗口</string>
<string name="title_activity_update_pwd">密码修改界面</string>
<string name="title_activity_bdmap">BDMapActivity</string>
<string name="title_activity_bdmap">地图展示</string>
<string name="main_menu_value_1">离线数据下载</string>
<string name="main_menu_value_2">离线登录</string>
<string name="title_activity_down_data">数据下载页面</string>
<string name="title_activity_lx__param_">参数页面</string>
<string name="title_activity_camera_scan">条码扫描</string>
<string name="scan_text">将二维码放入框内,即可自动扫描</string>
<string name="title_activity_pda_reg">PdaRegActivity</string>
<string name="title_activity_pda_reg">注册界面</string>
<string name="title_activity_seuic_scan">SeuicScan</string>
<string name="title_activity_voice_engine_setting">语音设置界面</string>
<!-- 讯飞离线语音appid-->
<string name="app_id">601c9ec6</string>
<!-- 讯飞离线语音弹出框格式-->
<string name="tts_toast_format" formatted="false">缓冲进度为%d%%,播放进度为%d%%</string>
</resources>

View File

@ -17,3 +17,7 @@ org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true
RELEASE_STOREFILE=E:/AndroidStudioProject/signKey.jks
RELEASE_STORE_PASSWORD=123456
RELEASE_KEY_ALIAS=fxy
RELEASE_KEY_PASSWORD=123456