mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-29 16:55:05 +02:00
2012-04-23 Mark Holland <mark@mark-holland.me.uk>
* src/pandroid/agent/Core.java: Migrated from shared preferences to sqlite database. Method to create and initialize database with default values. * src/pandroid/agent/DataBaseHandler.java: Creates a database and provides methods for interaction. * src/pandroid/agent/DataHandler.java: Objects for facilitating interaction of data with the database. * src/pandroid/agent/PandroidAgent.java: If first run then creates and initializes database. Needs to be replaced by copying default db that would ship with pandroid. * src/pandroid/agent/PandroidAgentListener.java: Adapted get and put sharedData to use database instead, * src/pandroid/agent/Setup.java: Reduced configuration updates git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8037 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
7cbe4fdf75
commit
ee9849c173
@ -1,3 +1,26 @@
|
|||||||
|
2012-04-23 Mark Holland <mark@mark-holland.me.uk>
|
||||||
|
|
||||||
|
* src/pandroid/agent/Core.java: Migrated from shared
|
||||||
|
preferences to sqlite database. Method to create and
|
||||||
|
initialize database with default values.
|
||||||
|
|
||||||
|
* src/pandroid/agent/DataBaseHandler.java: Creates
|
||||||
|
a database and provides methods for interaction.
|
||||||
|
|
||||||
|
* src/pandroid/agent/DataHandler.java: Objects for
|
||||||
|
facilitating interaction of data with the database.
|
||||||
|
|
||||||
|
* src/pandroid/agent/PandroidAgent.java: If first run
|
||||||
|
then creates and initializes database. Needs to be
|
||||||
|
replaced by copying default db that would ship with
|
||||||
|
pandroid.
|
||||||
|
|
||||||
|
* src/pandroid/agent/PandroidAgentListener.java: Adapted
|
||||||
|
get and put sharedData to use database instead,
|
||||||
|
|
||||||
|
* src/pandroid/agent/Setup.java: Reduced
|
||||||
|
configuration updates
|
||||||
|
|
||||||
2013-04-01 Sergio Martin <sergio.martin@artica.es>
|
2013-04-01 Sergio Martin <sergio.martin@artica.es>
|
||||||
|
|
||||||
* src/pandroid/agent/PandroidAgentListener.java: Fixed
|
* src/pandroid/agent/PandroidAgentListener.java: Fixed
|
||||||
|
@ -21,7 +21,7 @@ import android.content.Context;
|
|||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
|
|
||||||
//import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
public class Core {
|
public class Core {
|
||||||
|
|
||||||
@ -174,6 +174,9 @@ public class Core {
|
|||||||
static volatile public long lastContact = CONST_INVALID_CONTACT;
|
static volatile public long lastContact = CONST_INVALID_CONTACT;
|
||||||
static volatile public int contactError = CONST_CONTACT_ERROR;
|
static volatile public int contactError = CONST_CONTACT_ERROR;
|
||||||
|
|
||||||
|
|
||||||
|
static DataBaseHandler db;
|
||||||
|
|
||||||
public Core() {
|
public Core() {
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -211,39 +214,38 @@ public class Core {
|
|||||||
con = context;
|
con = context;
|
||||||
}
|
}
|
||||||
|
|
||||||
SharedPreferences agentPreferences = con.getSharedPreferences(
|
|
||||||
con.getString(R.string.const_string_preferences),
|
|
||||||
Activity.MODE_PRIVATE);
|
|
||||||
|
|
||||||
latitude = agentPreferences.getFloat("latitude", CONST_INVALID_COORDS);
|
|
||||||
longitude = agentPreferences.getFloat("longitude", CONST_INVALID_COORDS);
|
|
||||||
batteryLevel = agentPreferences.getInt("batteryLevel", CONST_INVALID_BATTERY_LEVEL);
|
latitude = Float.parseFloat(getValue(con, "latitude"));
|
||||||
orientation = agentPreferences.getFloat("orientation", CONST_INVALID_ORIENTATION);
|
longitude = Float.parseFloat(getValue(con, "longitude"));
|
||||||
proximity = agentPreferences.getFloat("proximity", CONST_INVALID_PROXIMITY);
|
batteryLevel = Integer.parseInt(getValue(con, "batteryLevel"));
|
||||||
taskStatus = agentPreferences.getString("taskStatus", defaultTaskStatus);
|
orientation = Float.parseFloat(getValue(con, "orientation"));
|
||||||
task = agentPreferences.getString("task", defaultTask);
|
proximity = Float.parseFloat(getValue(con, "proximity"));
|
||||||
taskHumanName = agentPreferences.getString("taskHumanName", defaultTaskHumanName);
|
taskStatus = getValue(con, "taskStatus");
|
||||||
taskRun = agentPreferences.getString("taskRun", defaultTaskRun);
|
task = getValue(con, "task");
|
||||||
memoryStatus = agentPreferences.getString("memoryStatus", defaultMemoryStatus);
|
taskHumanName = getValue(con, "taskHumanName");
|
||||||
availableRamKb = agentPreferences.getLong("availableRamKb", defaultRam);
|
taskRun = getValue(con, "taskRun");
|
||||||
totalRamKb = agentPreferences.getLong("totalRamKb", defaultRam);
|
memoryStatus = getValue(con, "memoryStatus");
|
||||||
lastContact = agentPreferences.getLong("lastContact", defaultContact);
|
availableRamKb = Long.parseLong(getValue(con, "availableRamKb"));
|
||||||
contactError = agentPreferences.getInt("contactError", defaultContactError);
|
totalRamKb = Long.parseLong(getValue(con, "totalRamKb"));
|
||||||
simID = agentPreferences.getString("simID", defaultSimID);
|
lastContact = Long.parseLong(getValue(con, "lastContact"));
|
||||||
upTime = agentPreferences.getLong("upTime", Core.defaultUpTime);
|
contactError = Integer.parseInt(getValue(con, "contactError"));
|
||||||
SMSReceived = agentPreferences.getInt("SMSReceived", defaultSMSReceived);
|
simID = getValue(con, "simID");
|
||||||
SMSSent = agentPreferences.getInt("SMSSent", defaultSMSSent);
|
upTime = Long.parseLong(getValue(con, "upTime"));
|
||||||
networkOperator = agentPreferences.getString("networkOperator", defaultNetworkOperator);
|
SMSReceived = Integer.parseInt(getValue(con, "SMSReceived"));
|
||||||
networkType = agentPreferences.getString("networkType", defaultNetworkType);
|
SMSSent = Integer.parseInt(getValue(con, "SMSSent"));
|
||||||
phoneType = agentPreferences.getString("phoneType", defaultPhoneType);
|
networkOperator = getValue(con, "networkOperator");
|
||||||
signalStrength = agentPreferences.getInt("signalStrength", defaultSignalStrength);
|
networkType = getValue(con, "networkType");
|
||||||
incomingCalls = agentPreferences.getInt("incomingCalls", defaultIncomingCalls);
|
phoneType = getValue(con, "phoneType");
|
||||||
missedCalls = agentPreferences.getInt("missedCalls", defaultMissedCalls);
|
signalStrength = Integer.parseInt(getValue(con, "signalStrength"));
|
||||||
outgoingCalls = agentPreferences.getInt("outgoingCalls", defaultOutgoingCalls);
|
incomingCalls = Integer.parseInt(getValue(con, "incomingCalls"));
|
||||||
receiveBytes = agentPreferences.getLong("receiveBytes", defaultReceiveBytes);
|
missedCalls = Integer.parseInt(getValue(con, "missedCalls"));
|
||||||
transmitBytes = agentPreferences.getLong("transmitBytes", defaultTransmitBytes);
|
outgoingCalls = Integer.parseInt(getValue(con, "outgoingCalls"));
|
||||||
helloSignal = agentPreferences.getInt("helloSignal", defaultHelloSignal);
|
receiveBytes = Long.parseLong(getValue(con, "receiveBytes"));
|
||||||
roaming = agentPreferences.getInt("roaming", defaultRoaming);
|
transmitBytes = Long.parseLong(getValue(con, "transmitBytes"));
|
||||||
|
helloSignal = Integer.parseInt(getValue(con, "helloSignal"));
|
||||||
|
roaming = Integer.parseInt(getValue(con, "roaming"));
|
||||||
|
|
||||||
}// end loadLastValues
|
}// end loadLastValues
|
||||||
|
|
||||||
@ -252,41 +254,38 @@ public class Core {
|
|||||||
con = context;
|
con = context;
|
||||||
}
|
}
|
||||||
|
|
||||||
SharedPreferences agentPreferences = con.getSharedPreferences(
|
|
||||||
con.getString(R.string.const_string_preferences),
|
|
||||||
Activity.MODE_PRIVATE);
|
|
||||||
|
|
||||||
serverAddr = agentPreferences.getString("serverAddr", defaultServerAddr);
|
serverAddr = getValue(con, "serverAddr");
|
||||||
serverPort = agentPreferences.getString("serverPort", defaultServerPort);
|
serverPort = getValue(con, "serverPort");
|
||||||
interval = agentPreferences.getInt("interval", defaultInterval);
|
interval = Integer.parseInt(getValue(con, "interval"));
|
||||||
agentName = agentPreferences.getString("agentName", defaultAgentName+"_"+Installation.id(context));
|
agentName = getValue(con, "agentName");
|
||||||
mobileWebURL = agentPreferences.getString("mobileWebURL", defaultmobileWebURL);
|
mobileWebURL = getValue(con, "mobileWebURL");
|
||||||
gpsStatus = agentPreferences.getString("gpsStatus", defaultGpsStatus);
|
gpsStatus = getValue(con, "gpsStatus");
|
||||||
memoryStatus = agentPreferences.getString("memoryStatus", defaultMemoryStatus);
|
memoryStatus = getValue(con, "memoryStatus");
|
||||||
taskStatus = agentPreferences.getString("taskStatus", defaultTaskStatus);
|
taskStatus = getValue(con, "taskStatus");
|
||||||
task = agentPreferences.getString("task", defaultTask);
|
task = getValue(con, "task");
|
||||||
taskHumanName = agentPreferences.getString("taskHumanName", defaultTaskHumanName);
|
taskHumanName = getValue(con, "taskHumanName");
|
||||||
taskRun = agentPreferences.getString("taskRun", defaultTaskRun);
|
taskRun = getValue(con, "taskRun");
|
||||||
password = agentPreferences.getString("password", defaultPassword);
|
password = getValue(con, "password");
|
||||||
passwordCheck = agentPreferences.getString("passwordCheck", defaultPasswordCheck);
|
passwordCheck = getValue(con, "passwordCheck");
|
||||||
simIDReport = agentPreferences.getString("simIDReport", defaultSimIDReport);
|
simIDReport = getValue(con, "simIDReport");
|
||||||
DeviceUpTimeReport = agentPreferences.getString("DeviceUpTimeReport", defaultDeviceUpTimeReport);
|
DeviceUpTimeReport = getValue(con, "DeviceUpTimeReport");
|
||||||
NetworkOperatorReport = agentPreferences.getString("NetworkOperatorReport", defaultNetworkOperatorReport);
|
NetworkOperatorReport = getValue(con, "NetworkOperatorReport");
|
||||||
NetworkTypeReport = agentPreferences.getString("NetworkTypeReport", defaultNetworkTypeReport);
|
NetworkTypeReport = getValue(con, "NetworkTypeReport");
|
||||||
PhoneTypeReport = agentPreferences.getString("PhoneTypeReport", defaultPhoneTypeReport);
|
PhoneTypeReport = getValue(con, "PhoneTypeReport");
|
||||||
SignalStrengthReport = agentPreferences.getString("SignalStrengthReport", defaultSignalStrengthReport);
|
SignalStrengthReport = getValue(con, "SignalStrengthReport");
|
||||||
ReceivedSMSReport = agentPreferences.getString("ReceivedSMSReport", defaultReceivedSMSReport);
|
ReceivedSMSReport = getValue(con, "ReceivedSMSReport");
|
||||||
SentSMSReport = agentPreferences.getString("SentSMSReport", defaultSentSMSReport);
|
SentSMSReport = getValue(con, "SentSMSReport");
|
||||||
IncomingCallsReport = agentPreferences.getString("IncomingCallsReport", defaultIncomingCallsReport);
|
IncomingCallsReport = getValue(con, "IncomingCallsReport");
|
||||||
MissedCallsReport = agentPreferences.getString("MissedCallsReport", defaultMissedCallsReport);
|
MissedCallsReport = getValue(con, "MissedCallsReport");
|
||||||
OutgoingCallsReport = agentPreferences.getString("OutgoingCallsReport", defaultOutgoingCallsReport);
|
OutgoingCallsReport = getValue(con, "OutgoingCallsReport");
|
||||||
BytesReceivedReport = agentPreferences.getString("BytesReceivedReport", defaultBytesReceivedReport);
|
BytesReceivedReport = getValue(con, "BytesReceivedReport");
|
||||||
BytesSentReport = agentPreferences.getString("BytesSentReport", defaultBytesSentReport);
|
BytesSentReport = getValue(con, "BytesSentReport");
|
||||||
HelloSignalReport = agentPreferences.getString("HelloSignalReport", defaultHelloSignalReport);
|
HelloSignalReport = getValue(con, "HelloSignalReport");
|
||||||
BatteryLevelReport = agentPreferences.getString("BatteryLevelReport", defaultBatteryLevelReport);
|
BatteryLevelReport = getValue(con, "BatteryLevelReport");
|
||||||
RoamingReport = agentPreferences.getString("RoamingReport", defaultRoamingReport);
|
RoamingReport = getValue(con, "RoamingReport");
|
||||||
InventoryReport = agentPreferences.getString("InventoryReport", defaultInventoryReport);
|
InventoryReport = getValue(con, "InventoryReport");
|
||||||
NotificationCheck = agentPreferences.getString("NotificationCheck", defaultNotificationCheck);
|
NotificationCheck = getValue(con, "NotificationCheck");
|
||||||
}// end loadConf
|
}// end loadConf
|
||||||
|
|
||||||
static public boolean updateConf(Context context) {
|
static public boolean updateConf(Context context) {
|
||||||
@ -318,60 +317,167 @@ public class Core {
|
|||||||
con = context;
|
con = context;
|
||||||
}
|
}
|
||||||
|
|
||||||
SharedPreferences agentPreferences = con.getSharedPreferences(
|
|
||||||
con.getString(R.string.const_string_preferences),
|
|
||||||
Activity.MODE_PRIVATE);
|
|
||||||
SharedPreferences.Editor editor = agentPreferences.edit();
|
|
||||||
|
|
||||||
editor.putString("serverAddr", _serverAddr);
|
|
||||||
editor.putString("serverPort", _serverPort);
|
|
||||||
editor.putInt("interval", _interval);
|
|
||||||
editor.putString("agentName", _agentName);
|
|
||||||
editor.putString("gpsStatus", _gpsStatus);
|
|
||||||
editor.putString("memoryStatus", _memoryStatus);
|
|
||||||
editor.putString("taskStatus", _taskStatus);
|
|
||||||
editor.putString("task", _task);
|
|
||||||
editor.putString("taskHumanName", _taskHumanName);
|
|
||||||
editor.putString("simID", _simID);
|
|
||||||
editor.putString("simIDReport", _simIDReport);
|
|
||||||
editor.putLong("UpTime", _upTime);
|
|
||||||
editor.putString("networkOperator", _networkOperator);
|
|
||||||
editor.putInt("SMSReceived", _smsReceived);
|
|
||||||
editor.putInt("SMSSent", _smsSent);
|
|
||||||
editor.putString("networkType", _networkType);
|
|
||||||
editor.putString("phoneType", _phoneType);
|
|
||||||
editor.putInt("signalStrength", _signalStrength);
|
|
||||||
editor.putInt("incomingCalls", _incomingCalls);
|
|
||||||
editor.putInt("missedCalls", _missedCalls);
|
|
||||||
editor.putInt("outgoingCalls", _outgoingCalls);
|
|
||||||
editor.putLong("receiveBytes", _receiveBytes);
|
|
||||||
editor.putLong("transmitBytes", _transmitBytes);
|
|
||||||
editor.putString("password", _password);
|
|
||||||
editor.putString("passwordCheck", _passwordCheck);
|
|
||||||
editor.putInt("helloSignal", _helloSignal);
|
|
||||||
editor.putInt("roaming", _roaming);
|
|
||||||
editor.putString("DeviceUpTimeReport", _DeviceUpTimeReport);
|
|
||||||
editor.putString("NetworkOperatorReport", _NetworkOperatorReport);
|
|
||||||
editor.putString("NetworkTypeReport", _NetworkTypeReport);
|
|
||||||
editor.putString("PhoneTypeReport", _PhoneTypeReport);
|
|
||||||
editor.putString("SignalStrengthReport", _SignalStrengthReport);
|
|
||||||
editor.putString("ReceivedSMSReport", _ReceivedSMSReport);
|
|
||||||
editor.putString("SentSMSReport", _SentSMSReport);
|
|
||||||
editor.putString("IncomingCallsReport", _IncomingCallsReport);
|
|
||||||
editor.putString("MissedCallsReport", _MissedCallsReport);
|
|
||||||
editor.putString("OutgoingCallsReport", _OutgoingCallsReport);
|
|
||||||
editor.putString("BytesReceivedReport", _BytesReceivedReport);
|
|
||||||
editor.putString("BytesSentReport", _BytesSentReport);
|
|
||||||
editor.putString("HelloSignalReport", _HelloSignalReport);
|
|
||||||
editor.putString("BatteryLevelReport", _BatteryLevelReport);
|
|
||||||
editor.putString("RoamingReport", _RoamingReport);
|
|
||||||
editor.putString("InventoryReport", _InventoryReport);
|
|
||||||
editor.putString("NotificationCheck", _NotificationCheck);
|
|
||||||
editor.putString("mobileWebURL", _mobileWebURL);
|
|
||||||
|
|
||||||
if (editor.commit()) {
|
updateValue(con,"serverAddr", _serverAddr);
|
||||||
|
updateValue(con,"serverPort", _serverPort);
|
||||||
|
updateValue(con,"interval", ""+_interval);
|
||||||
|
updateValue(con,"agentName", _agentName);
|
||||||
|
updateValue(con,"gpsStatus", _gpsStatus);
|
||||||
|
updateValue(con,"memoryStatus", _memoryStatus);
|
||||||
|
updateValue(con,"taskStatus", _taskStatus);
|
||||||
|
updateValue(con,"task", _task);
|
||||||
|
updateValue(con,"taskHumanName", _taskHumanName);
|
||||||
|
updateValue(con,"simID", _simID);
|
||||||
|
updateValue(con,"simIDReport", _simIDReport);
|
||||||
|
updateValue(con,"upTime", ""+_upTime);
|
||||||
|
updateValue(con,"networkOperator", _networkOperator);
|
||||||
|
updateValue(con,"SMSReceived", ""+_smsReceived);
|
||||||
|
updateValue(con,"SMSSent", ""+_smsSent);
|
||||||
|
updateValue(con,"networkType", _networkType);
|
||||||
|
updateValue(con,"phoneType", _phoneType);
|
||||||
|
updateValue(con,"signalStrength", ""+_signalStrength);
|
||||||
|
updateValue(con,"incomingCalls", ""+_incomingCalls);
|
||||||
|
updateValue(con,"missedCalls", ""+_missedCalls);
|
||||||
|
updateValue(con,"outgoingCalls", ""+_outgoingCalls);
|
||||||
|
updateValue(con,"receiveBytes", ""+_receiveBytes);
|
||||||
|
updateValue(con,"transmitBytes", ""+_transmitBytes);
|
||||||
|
updateValue(con,"password", _password);
|
||||||
|
updateValue(con,"passwordCheck", _passwordCheck);
|
||||||
|
updateValue(con,"helloSignal", ""+_helloSignal);
|
||||||
|
updateValue(con,"roaming", ""+_roaming);
|
||||||
|
updateValue(con,"DeviceUpTimeReport", _DeviceUpTimeReport);
|
||||||
|
updateValue(con,"NetworkOperatorReport", _NetworkOperatorReport);
|
||||||
|
updateValue(con,"NetworkTypeReport", _NetworkTypeReport);
|
||||||
|
updateValue(con,"PhoneTypeReport", _PhoneTypeReport);
|
||||||
|
updateValue(con,"SignalStrengthReport", _SignalStrengthReport);
|
||||||
|
updateValue(con,"ReceivedSMSReport", _ReceivedSMSReport);
|
||||||
|
updateValue(con,"SentSMSReport", _SentSMSReport);
|
||||||
|
updateValue(con,"IncomingCallsReport", _IncomingCallsReport);
|
||||||
|
updateValue(con,"MissedCallsReport", _MissedCallsReport);
|
||||||
|
updateValue(con,"OutgoingCallsReport", _OutgoingCallsReport);
|
||||||
|
updateValue(con,"BytesReceivedReport", _BytesReceivedReport);
|
||||||
|
updateValue(con,"BytesSentReport", _BytesSentReport);
|
||||||
|
updateValue(con,"HelloSignalReport", _HelloSignalReport);
|
||||||
|
updateValue(con,"BatteryLevelReport", _BatteryLevelReport);
|
||||||
|
updateValue(con,"RoamingReport", _RoamingReport);
|
||||||
|
updateValue(con,"InventoryReport", _InventoryReport);
|
||||||
|
updateValue(con,"NotificationCheck", _NotificationCheck);
|
||||||
|
updateValue(con,"mobileWebURL", _mobileWebURL);
|
||||||
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}// end updateConf
|
}// end updateConf
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//Initialize database
|
||||||
|
public static void initDatabase(Context context){
|
||||||
|
if (con == null) {
|
||||||
|
con = context;
|
||||||
|
}
|
||||||
|
db = new DataBaseHandler(con);
|
||||||
|
|
||||||
|
addValue(con,"serverAddr",defaultServerAddr);
|
||||||
|
addValue(con,"serverPort",defaultServerPort);
|
||||||
|
addValue(con,"interval",""+defaultInterval);
|
||||||
|
addValue(con,"agentName",defaultAgentName+"_"+Installation.id(context));
|
||||||
|
addValue(con,"mobileWebURL",defaultmobileWebURL);
|
||||||
|
addValue(con,"gpsStatus",defaultGpsStatus);
|
||||||
|
addValue(con,"memoryStatus",defaultMemoryStatus);
|
||||||
|
addValue(con,"taskStatus",defaultTaskStatus);
|
||||||
|
addValue(con,"task",defaultTask);
|
||||||
|
addValue(con,"taskHumanName",defaultTaskHumanName);
|
||||||
|
addValue(con,"simIDReport",defaultSimIDReport);
|
||||||
|
addValue(con,"passwordCheck",defaultPasswordCheck);
|
||||||
|
addValue(con,"DeviceUpTimeReport",defaultDeviceUpTimeReport);
|
||||||
|
addValue(con,"NetworkOperatorReport",defaultNetworkOperatorReport);
|
||||||
|
addValue(con,"NetworkTypeReport",defaultNetworkTypeReport);
|
||||||
|
addValue(con,"PhoneTypeReport",defaultPhoneTypeReport);
|
||||||
|
addValue(con,"SignalStrengthReport",defaultSignalStrengthReport);
|
||||||
|
addValue(con,"ReceivedSMSReport",defaultReceivedSMSReport);
|
||||||
|
addValue(con,"SentSMSReport",defaultSentSMSReport);
|
||||||
|
addValue(con,"IncomingCallsReport",defaultIncomingCallsReport);
|
||||||
|
addValue(con,"MissedCallsReport",defaultMissedCallsReport);
|
||||||
|
addValue(con,"OutgoingCallsReport",defaultOutgoingCallsReport);
|
||||||
|
addValue(con,"BytesReceivedReport",defaultBytesReceivedReport);
|
||||||
|
addValue(con,"BytesSentReport",defaultBytesSentReport);
|
||||||
|
addValue(con,"HelloSignalReport",defaultHelloSignalReport);
|
||||||
|
addValue(con,"BatteryLevelReport",defaultHelloSignalReport);
|
||||||
|
addValue(con,"RoamingReport",defaultRoamingReport);
|
||||||
|
addValue(con,"InventoryReport",defaultRoamingReport);
|
||||||
|
addValue(con,"NotificationCheck",defaultNotificationCheck);
|
||||||
|
|
||||||
|
addValue(con,"hasSim", ""+defaultHasSim);
|
||||||
|
|
||||||
|
addValue(con,"password",defaultPassword);
|
||||||
|
|
||||||
|
addValue(con,"latitude",""+CONST_INVALID_COORDS);
|
||||||
|
addValue(con,"longitude",""+CONST_INVALID_COORDS);
|
||||||
|
addValue(con,"batteryLevel",""+CONST_INVALID_BATTERY_LEVEL);
|
||||||
|
addValue(con,"orientation",""+CONST_INVALID_ORIENTATION);
|
||||||
|
addValue(con,"proximity",""+CONST_INVALID_PROXIMITY);
|
||||||
|
addValue(con,"taskRun",defaultTaskRun);
|
||||||
|
addValue(con,"availableRamKb",""+defaultRam);
|
||||||
|
addValue(con,"totalRamKb",""+defaultRam);
|
||||||
|
addValue(con,"simID",defaultSimID);
|
||||||
|
addValue(con,"upTime",""+defaultUpTime);
|
||||||
|
addValue(con,"SMSReceived",""+defaultSMSReceived);
|
||||||
|
addValue(con,"SMSSent",""+defaultSMSSent);
|
||||||
|
addValue(con,"networkOperator",defaultNetworkOperator);
|
||||||
|
addValue(con,"networkType",defaultNetworkType);
|
||||||
|
addValue(con,"phoneType",defaultPhoneType);
|
||||||
|
addValue(con,"signalStrength",""+defaultSignalStrength);
|
||||||
|
addValue(con,"incomingCalls",""+defaultIncomingCalls);
|
||||||
|
addValue(con,"missedCalls",""+defaultMissedCalls);
|
||||||
|
addValue(con,"outgoingCalls",""+defaultOutgoingCalls);
|
||||||
|
addValue(con,"receiveBytes",""+defaultReceiveBytes);
|
||||||
|
addValue(con,"transmitBytes",""+defaultTransmitBytes);
|
||||||
|
addValue(con,"helloSignal",""+defaultHelloSignal);
|
||||||
|
addValue(con,"roaming",""+defaultRoaming);
|
||||||
|
|
||||||
|
addValue(con,"lastContact",""+CONST_INVALID_CONTACT);
|
||||||
|
addValue(con,"contactError",""+CONST_CONTACT_ERROR);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//Adds a new row "name" with the value "value"
|
||||||
|
public static void addValue(Context context, String name, String value){
|
||||||
|
db = new DataBaseHandler(con);
|
||||||
|
|
||||||
|
DataHandler dh = new DataHandler(name, value);
|
||||||
|
|
||||||
|
db.addValue(dh);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//Updates a given row "name" with a "value"
|
||||||
|
public static void updateValue(Context context, String name, String value){
|
||||||
|
db = new DataBaseHandler(con);
|
||||||
|
//Retrieve id of row to update
|
||||||
|
int id = getDataHandler(con, name).get_id();
|
||||||
|
|
||||||
|
DataHandler dh = new DataHandler(id, name, value);
|
||||||
|
|
||||||
|
db.updateValue(dh);
|
||||||
|
}
|
||||||
|
|
||||||
|
//Returns the DataHandler object of the given row "name"
|
||||||
|
public static DataHandler getDataHandler(Context context, String name){
|
||||||
|
db = new DataBaseHandler(con);
|
||||||
|
|
||||||
|
return db.getValue(name);
|
||||||
|
}
|
||||||
|
|
||||||
|
//Returns the value of the given row "name"
|
||||||
|
public static String getValue(Context context, String name){
|
||||||
|
db = new DataBaseHandler(con);
|
||||||
|
|
||||||
|
return db.getValue(name).get_value();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
165
pandora_agents/android/src/pandroid/agent/DataBaseHandler.java
Normal file
165
pandora_agents/android/src/pandroid/agent/DataBaseHandler.java
Normal file
@ -0,0 +1,165 @@
|
|||||||
|
package pandroid.agent;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import android.content.ContentValues;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.database.Cursor;
|
||||||
|
import android.database.sqlite.SQLiteDatabase;
|
||||||
|
import android.database.sqlite.SQLiteOpenHelper;
|
||||||
|
|
||||||
|
public class DataBaseHandler extends SQLiteOpenHelper {
|
||||||
|
|
||||||
|
// All Static variables
|
||||||
|
// Database Version
|
||||||
|
private static final int DATABASE_VERSION = 1;
|
||||||
|
|
||||||
|
// Database Name
|
||||||
|
private static final String DATABASE_NAME = "PANDROID_DATA";
|
||||||
|
|
||||||
|
// Contacts table name
|
||||||
|
private static final String TABLE_DATA = "data"; //"values" is a reserved sqllite word
|
||||||
|
|
||||||
|
// Contacts Table Columns names
|
||||||
|
private static final String KEY_ID = "id";
|
||||||
|
private static final String KEY_NAME = "name";
|
||||||
|
private static final String KEY_VALUE = "value";
|
||||||
|
|
||||||
|
public DataBaseHandler(Context context) {
|
||||||
|
super(context, DATABASE_NAME, null, DATABASE_VERSION);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Creating Tables
|
||||||
|
@Override
|
||||||
|
public void onCreate(SQLiteDatabase db) {
|
||||||
|
String CREATE_CONTACTS_TABLE = "CREATE TABLE " + TABLE_DATA + "("
|
||||||
|
+ KEY_ID + " INTEGER PRIMARY KEY," + KEY_NAME + " TEXT,"
|
||||||
|
+ KEY_VALUE + " TEXT" + ")";
|
||||||
|
db.execSQL(CREATE_CONTACTS_TABLE);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Upgrading database
|
||||||
|
@Override
|
||||||
|
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
|
||||||
|
// Drop older table if existed
|
||||||
|
db.execSQL("DROP TABLE IF EXISTS " + TABLE_DATA);
|
||||||
|
|
||||||
|
// Create tables again
|
||||||
|
onCreate(db);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* All CRUD(Create, Read, Update, Delete) Operations
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Adding new contact
|
||||||
|
void addValue(DataHandler dh) {
|
||||||
|
SQLiteDatabase db = this.getWritableDatabase();
|
||||||
|
|
||||||
|
ContentValues values = new ContentValues();
|
||||||
|
values.put(KEY_NAME, dh.get_name());
|
||||||
|
values.put(KEY_VALUE, dh.get_value());
|
||||||
|
|
||||||
|
// Inserting Row
|
||||||
|
db.insert(TABLE_DATA, null, values);
|
||||||
|
db.close(); // Closing database connection
|
||||||
|
}
|
||||||
|
|
||||||
|
// Getting single contact
|
||||||
|
DataHandler getValue(String value) {
|
||||||
|
SQLiteDatabase db = this.getReadableDatabase();
|
||||||
|
|
||||||
|
Cursor cursor = db.query(TABLE_DATA, new String[] { KEY_ID,
|
||||||
|
KEY_NAME, KEY_VALUE }, KEY_NAME + "=?",
|
||||||
|
new String[] { value }, null, null, null, null);
|
||||||
|
if (cursor != null)
|
||||||
|
cursor.moveToFirst();
|
||||||
|
|
||||||
|
DataHandler dh = new DataHandler(
|
||||||
|
cursor.getString(1), cursor.getString(2));
|
||||||
|
// return contact
|
||||||
|
return dh;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Getting all values
|
||||||
|
public List<DataHandler> getAllValues(){
|
||||||
|
List<DataHandler> valueList = new ArrayList<DataHandler>();
|
||||||
|
// Select All Query
|
||||||
|
String selectQuery = "SELECT * FROM " + TABLE_DATA;
|
||||||
|
|
||||||
|
SQLiteDatabase db = this.getWritableDatabase();
|
||||||
|
Cursor cursor = db.rawQuery(selectQuery, null);
|
||||||
|
|
||||||
|
// looping through all rows adding to the list
|
||||||
|
if(cursor.moveToFirst()){
|
||||||
|
do{
|
||||||
|
DataHandler dh = new DataHandler();
|
||||||
|
dh.set_id(Integer.parseInt(cursor.getString(0)));
|
||||||
|
dh.set_name(cursor.getString(1));
|
||||||
|
dh.set_value(cursor.getString(2));
|
||||||
|
valueList.add(dh);
|
||||||
|
} while (cursor.moveToNext());
|
||||||
|
}
|
||||||
|
|
||||||
|
// return value list
|
||||||
|
return valueList;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update single value
|
||||||
|
public int updateValue(DataHandler dh){
|
||||||
|
SQLiteDatabase db = this.getWritableDatabase();
|
||||||
|
|
||||||
|
ContentValues values = new ContentValues();
|
||||||
|
values.put(KEY_NAME, dh.get_name());
|
||||||
|
values.put(KEY_VALUE, dh.get_value());
|
||||||
|
|
||||||
|
// updating row
|
||||||
|
return db.update(TABLE_DATA, values, KEY_ID + " = ?",
|
||||||
|
new String[] { String.valueOf(dh.get_id())});
|
||||||
|
}
|
||||||
|
|
||||||
|
// Getting contacts Count
|
||||||
|
public boolean isEmpty() {
|
||||||
|
String countQuery = "SELECT * FROM " + TABLE_DATA;
|
||||||
|
SQLiteDatabase db = this.getReadableDatabase();
|
||||||
|
Cursor cursor = db.rawQuery(countQuery, null);
|
||||||
|
cursor.close();
|
||||||
|
|
||||||
|
// return count
|
||||||
|
if(cursor.getCount() == 0)
|
||||||
|
return true;
|
||||||
|
else
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
49
pandora_agents/android/src/pandroid/agent/DataHandler.java
Normal file
49
pandora_agents/android/src/pandroid/agent/DataHandler.java
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
package pandroid.agent;
|
||||||
|
|
||||||
|
public class DataHandler {
|
||||||
|
int _id;
|
||||||
|
String _name;
|
||||||
|
String _value;
|
||||||
|
|
||||||
|
public DataHandler(){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public DataHandler(String name, String value){
|
||||||
|
this._name = name;
|
||||||
|
this._value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DataHandler(int id, String name, String value){
|
||||||
|
this._id = id;
|
||||||
|
this._name = name;
|
||||||
|
this._value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int get_id() {
|
||||||
|
return _id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void set_id(int _id) {
|
||||||
|
this._id = _id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String get_name() {
|
||||||
|
return _name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void set_name(String _name) {
|
||||||
|
this._name = _name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String get_value() {
|
||||||
|
return _value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void set_value(String _value) {
|
||||||
|
this._value = _value;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -16,16 +16,17 @@ package pandroid.agent;
|
|||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
||||||
//import android.app.Dialog;
|
|
||||||
import android.app.TabActivity;
|
import android.app.TabActivity;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.telephony.TelephonyManager;
|
import android.telephony.TelephonyManager;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.widget.TabHost;
|
||||||
|
//import android.app.Dialog;
|
||||||
//import android.util.Log;
|
//import android.util.Log;
|
||||||
//import android.view.WindowManager.LayoutParams;
|
//import android.view.WindowManager.LayoutParams;
|
||||||
import android.widget.TabHost;
|
|
||||||
|
|
||||||
public class PandroidAgent extends TabActivity {
|
public class PandroidAgent extends TabActivity {
|
||||||
|
|
||||||
@ -33,9 +34,15 @@ public class PandroidAgent extends TabActivity {
|
|||||||
int defaultInterval = 300;
|
int defaultInterval = 300;
|
||||||
TabHost tabHost;
|
TabHost tabHost;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
final Dialog dialog = new Dialog(this,android.R.style.Theme_Black_NoTitleBar_Fullscreen);
|
final Dialog dialog = new Dialog(this,android.R.style.Theme_Black_NoTitleBar_Fullscreen);
|
||||||
dialog.setContentView(R.layout.welcome);
|
dialog.setContentView(R.layout.welcome);
|
||||||
@ -58,6 +65,10 @@ public class PandroidAgent extends TabActivity {
|
|||||||
//Requires The agent name to use installation id
|
//Requires The agent name to use installation id
|
||||||
File installation = new File(getApplicationContext().getFilesDir(), "INSTALLATION");
|
File installation = new File(getApplicationContext().getFilesDir(), "INSTALLATION");
|
||||||
if(!installation.exists()){
|
if(!installation.exists()){
|
||||||
|
//Create database with default values
|
||||||
|
DataBaseHandler db = new DataBaseHandler(this);
|
||||||
|
Core.initDatabase(this);
|
||||||
|
//Log.d("DATABASE",Core.db.getValue("latitude").get_value());
|
||||||
Core.restartAgentListener(getApplicationContext());
|
Core.restartAgentListener(getApplicationContext());
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
@ -111,6 +122,7 @@ public class PandroidAgent extends TabActivity {
|
|||||||
|
|
||||||
if(Core.helloSignal == 0)
|
if(Core.helloSignal == 0)
|
||||||
Core.helloSignal = 1;
|
Core.helloSignal = 1;
|
||||||
|
//dubious
|
||||||
Core.updateConf(getApplicationContext());
|
Core.updateConf(getApplicationContext());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -113,7 +113,7 @@ public class PandroidAgentListener extends Service {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
private void contact(){
|
private void contact(){
|
||||||
Date date = new Date();
|
Date date = new Date();
|
||||||
|
|
||||||
@ -156,9 +156,9 @@ public class PandroidAgentListener extends Service {
|
|||||||
|
|
||||||
updateValues();
|
updateValues();
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
private void contact(){
|
private void contact(){
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -168,7 +168,7 @@ public class PandroidAgentListener extends Service {
|
|||||||
Toast.LENGTH_SHORT);
|
Toast.LENGTH_SHORT);
|
||||||
toast.setGravity(Gravity.BOTTOM,0,0);
|
toast.setGravity(Gravity.BOTTOM,0,0);
|
||||||
toast.show();
|
toast.show();
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
Date date = new Date();
|
Date date = new Date();
|
||||||
@ -223,7 +223,7 @@ public class PandroidAgentListener extends Service {
|
|||||||
|
|
||||||
}//end doInBackground
|
}//end doInBackground
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// From unfinished task of buffering unsent xml files when no connection available //
|
// From unfinished task of buffering unsent xml files when no connection available //
|
||||||
////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////
|
||||||
@ -955,12 +955,14 @@ try { // catches IOException below
|
|||||||
|
|
||||||
|
|
||||||
private void putSharedData(String preferenceName, String tokenName, String data, String type) {
|
private void putSharedData(String preferenceName, String tokenName, String data, String type) {
|
||||||
int mode = Activity.MODE_PRIVATE;
|
//int mode = Activity.MODE_PRIVATE;
|
||||||
SharedPreferences agentPreferences = getSharedPreferences(preferenceName, mode);
|
//SharedPreferences agentPreferences = getSharedPreferences(preferenceName, mode);
|
||||||
SharedPreferences.Editor editor = agentPreferences.edit();
|
//SharedPreferences.Editor editor = agentPreferences.edit();
|
||||||
|
|
||||||
|
|
||||||
|
Core.updateValue(this, tokenName, data);
|
||||||
|
/*
|
||||||
if(type == "boolean") {
|
if(type == "boolean") {
|
||||||
|
Core.updateValue(this, tokenName, data)
|
||||||
editor.putBoolean(tokenName, Boolean.parseBoolean(data));
|
editor.putBoolean(tokenName, Boolean.parseBoolean(data));
|
||||||
}
|
}
|
||||||
else if(type == "float") {
|
else if(type == "float") {
|
||||||
@ -977,12 +979,16 @@ try { // catches IOException below
|
|||||||
}
|
}
|
||||||
|
|
||||||
editor.commit();
|
editor.commit();
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getSharedData(String preferenceName, String tokenName, String defaultValue, String type) {
|
private String getSharedData(String preferenceName, String tokenName, String defaultValue, String type) {
|
||||||
int mode = Activity.MODE_PRIVATE;
|
//int mode = Activity.MODE_PRIVATE;
|
||||||
SharedPreferences agentPreferences = getSharedPreferences(preferenceName, mode);
|
//SharedPreferences agentPreferences = getSharedPreferences(preferenceName, mode);
|
||||||
|
|
||||||
|
return Core.getValue(this, tokenName);
|
||||||
|
|
||||||
|
/*
|
||||||
if(type == "boolean") {
|
if(type == "boolean") {
|
||||||
boolean a = agentPreferences.getBoolean(tokenName, Boolean.parseBoolean(defaultValue));
|
boolean a = agentPreferences.getBoolean(tokenName, Boolean.parseBoolean(defaultValue));
|
||||||
return Boolean.valueOf(a).toString();
|
return Boolean.valueOf(a).toString();
|
||||||
@ -1004,6 +1010,7 @@ try { // catches IOException below
|
|||||||
}
|
}
|
||||||
|
|
||||||
return "";
|
return "";
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getHumanDateTime(long unixtime){
|
private String getHumanDateTime(long unixtime){
|
||||||
|
@ -146,7 +146,7 @@ public class Setup extends Activity {
|
|||||||
webButton.setOnClickListener(new OnClickListener() {
|
webButton.setOnClickListener(new OnClickListener() {
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
getDataFromView();
|
getDataFromView();
|
||||||
Core.updateConf(getApplicationContext());
|
//Core.updateConf(getApplicationContext());
|
||||||
|
|
||||||
String url = Core.mobileWebURL;
|
String url = Core.mobileWebURL;
|
||||||
if (!url.startsWith("https://") && !url.startsWith("http://")){
|
if (!url.startsWith("https://") && !url.startsWith("http://")){
|
||||||
@ -433,7 +433,7 @@ public class Setup extends Activity {
|
|||||||
Core.NotificationCheck = "disabled";
|
Core.NotificationCheck = "disabled";
|
||||||
|
|
||||||
|
|
||||||
Core.updateConf(getApplicationContext());
|
//Core.updateConf(getApplicationContext());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void loadViews(){
|
private void loadViews(){
|
||||||
@ -535,7 +535,7 @@ public class Setup extends Activity {
|
|||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
Core.passwordCheck = "disabled";
|
Core.passwordCheck = "disabled";
|
||||||
Core.updateConf(getApplicationContext());
|
//Core.updateConf(getApplicationContext());
|
||||||
dialog.dismiss();
|
dialog.dismiss();
|
||||||
createPass();
|
createPass();
|
||||||
} // end onClick
|
} // end onClick
|
||||||
@ -551,11 +551,12 @@ public class Setup extends Activity {
|
|||||||
Core.passwordCheck = "disabled";
|
Core.passwordCheck = "disabled";
|
||||||
else
|
else
|
||||||
Core.passwordCheck = "enabled";
|
Core.passwordCheck = "enabled";
|
||||||
Core.updateConf(getApplicationContext());
|
//Core.updateConf(getApplicationContext());
|
||||||
dialog.dismiss();
|
dialog.dismiss();
|
||||||
} // end onClick
|
} // end onClick
|
||||||
});//end clickListener
|
});//end clickListener
|
||||||
|
|
||||||
|
Core.updateConf(getApplicationContext());
|
||||||
dialog.show();
|
dialog.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -585,7 +586,7 @@ public class Setup extends Activity {
|
|||||||
if(TextUtils.isEmpty(createpass_password))
|
if(TextUtils.isEmpty(createpass_password))
|
||||||
{
|
{
|
||||||
Core.password = Core.defaultPassword;
|
Core.password = Core.defaultPassword;
|
||||||
Core.updateConf(getApplicationContext());
|
//Core.updateConf(getApplicationContext());
|
||||||
InputMethodManager im = (InputMethodManager)getSystemService(getApplicationContext().INPUT_METHOD_SERVICE);
|
InputMethodManager im = (InputMethodManager)getSystemService(getApplicationContext().INPUT_METHOD_SERVICE);
|
||||||
im.hideSoftInputFromWindow(text.getWindowToken(), 0);
|
im.hideSoftInputFromWindow(text.getWindowToken(), 0);
|
||||||
dialog.dismiss();
|
dialog.dismiss();
|
||||||
@ -607,7 +608,7 @@ public class Setup extends Activity {
|
|||||||
else if(createpass_password.equals(createpass_password2))
|
else if(createpass_password.equals(createpass_password2))
|
||||||
{
|
{
|
||||||
Core.password = createpass_password;
|
Core.password = createpass_password;
|
||||||
Core.updateConf(getApplicationContext());
|
//Core.updateConf(getApplicationContext());
|
||||||
//Core.restartAgentListener(getApplicationContext());
|
//Core.restartAgentListener(getApplicationContext());
|
||||||
InputMethodManager im = (InputMethodManager)getSystemService(getApplicationContext().INPUT_METHOD_SERVICE);
|
InputMethodManager im = (InputMethodManager)getSystemService(getApplicationContext().INPUT_METHOD_SERVICE);
|
||||||
im.hideSoftInputFromWindow(text.getWindowToken(), 0);
|
im.hideSoftInputFromWindow(text.getWindowToken(), 0);
|
||||||
@ -639,6 +640,7 @@ public class Setup extends Activity {
|
|||||||
|
|
||||||
});//end clickListener
|
});//end clickListener
|
||||||
|
|
||||||
|
Core.updateConf(getApplicationContext());
|
||||||
dialog.show();
|
dialog.show();
|
||||||
|
|
||||||
}// end createPass
|
}// end createPass
|
||||||
|
Loading…
x
Reference in New Issue
Block a user