Bugs in der App und ein Update des Chat-Servers (ChatPerson hat jetzt eine Version, damit man geänderte Personen updaten kann)
This commit is contained in:
@@ -64,14 +64,6 @@
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/jni" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/rs" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/shaders" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/test/res" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/test/assets" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/test/aidl" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/test/jni" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/test/rs" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/test/shaders" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" />
|
||||
@@ -80,6 +72,14 @@
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/jni" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/shaders" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/test/res" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/test/assets" type="java-test-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/test/aidl" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/test/jni" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/test/rs" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/test/shaders" isTestSource="true" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/assets" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/blame" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/builds" />
|
||||
@@ -96,7 +96,6 @@
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/instant-run-support" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/jniLibs" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifests" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/pre-dexed" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/reload-dex" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/restart-dex" />
|
||||
|
||||
@@ -17,10 +17,8 @@ public class BeWoChatApplication extends Application {
|
||||
Thread.UncaughtExceptionHandler uncaughtExceptionHandler = new Thread.UncaughtExceptionHandler() {
|
||||
@Override
|
||||
public void uncaughtException(Thread thread, Throwable ex) {
|
||||
|
||||
//TODO: Notifications löschen
|
||||
|
||||
Log.e("UNCAUGHT_EXCEPTION", "Eine unbehandelte Ausnahme ist aufgetreten!");
|
||||
ex.printStackTrace();
|
||||
|
||||
NotificationManager nm = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
|
||||
|
||||
|
||||
@@ -182,7 +182,14 @@ public class ChatActivity extends ActionBarActivity {
|
||||
chatMessages.add(message);
|
||||
adapter.notifyDataSetChanged();
|
||||
} else {
|
||||
SetNotify(chatPacket.ChatName, chatPacket.ChatMessage, chatPacket.SenderPersonOid, false, null, null);
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Toast.makeText(getApplicationContext(), "ChatName: " + chatPacket.ChatName, Toast.LENGTH_LONG).show();
|
||||
}
|
||||
});
|
||||
|
||||
Util.SetNotify(chatPacket.ChatName, chatPacket.ChatMessage, chatPacket.SenderPersonOid, false, null, null, getApplicationContext());
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -201,12 +208,30 @@ public class ChatActivity extends ActionBarActivity {
|
||||
SocketManager.onlinePersonOids.add(chatPacket.SenderPersonOid);
|
||||
}
|
||||
|
||||
if(chatPacket.SenderPersonOid == recipientPersonOid) {
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
ImageView status = (ImageView) mCustomView.findViewById(R.id.status);
|
||||
status.setImageResource(R.drawable.statusonline);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
break;
|
||||
case STATUS_NOTIFICATION_LOGOUT:
|
||||
if(SocketManager.onlinePersonOids.contains(chatPacket.SenderPersonOid)) {
|
||||
SocketManager.onlinePersonOids.remove(Integer.valueOf(chatPacket.SenderPersonOid));
|
||||
}
|
||||
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
ImageView status = (ImageView) mCustomView.findViewById(R.id.status);
|
||||
status.setImageResource(R.drawable.statusoffline);
|
||||
}
|
||||
});
|
||||
|
||||
break;
|
||||
case TEAM:
|
||||
listView.post(new Runnable() {
|
||||
@@ -252,16 +277,7 @@ public class ChatActivity extends ActionBarActivity {
|
||||
packet.RecipientPersonOid = recipientPersonOid;
|
||||
packet.MessageTimeStamp = now;
|
||||
|
||||
// SharedPreferences settings = getSharedPreferences(Util.PREFS_NAME, 0);
|
||||
|
||||
// byte[] tenantByteArray = Base64.decode(settings.getString(Util.PREFS_TENANT_KEY, null), Base64.DEFAULT);
|
||||
// ByteArrayInputStream tenantStream = new ByteArrayInputStream(tenantByteArray);
|
||||
|
||||
// try {
|
||||
packet.Tenant = SoapConnectionManager.User.getTenant();// SecurityUtils.decrypt(tenantStream).toString();
|
||||
// } catch (IOException | NoSuchAlgorithmException | NoSuchPaddingException | InvalidKeyException | InvalidAlgorithmParameterException e) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
packet.Tenant = SoapConnectionManager.User.getTenant();
|
||||
|
||||
final ChatMessage message = new ChatMessage(packet.SenderPersonOid, packet.RecipientPersonOid, packet.MessageTimeStamp, packet.ChatMessage, false, 0, isTeam);
|
||||
|
||||
@@ -369,39 +385,6 @@ public class ChatActivity extends ActionBarActivity {
|
||||
ReloadChatView(rn, rpoid, imageAsByteArray, blahIsTeam, tMemberOids, tMemberNames);
|
||||
}
|
||||
|
||||
public void SetNotify(String username, String message, int recipientOid, boolean isTeam, String teamMemberOids, String teamMemberNames){
|
||||
NotificationCompat.Builder mBuilder =
|
||||
new NotificationCompat.Builder(this)
|
||||
.setSmallIcon(R.drawable.ic_stat_name)
|
||||
.setContentTitle(username)
|
||||
.setContentText(message)
|
||||
.setAutoCancel(true)
|
||||
.setDefaults(Notification.DEFAULT_SOUND)
|
||||
.setVibrate(new long[] { 1000, 1000, 1000, 1000, 1000 }) //Notification.Default_Vibrate
|
||||
.setLights(Color.YELLOW, 3000, 3000) //Notification.Default_Lights
|
||||
.setOngoing(true);
|
||||
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString("Name", username);
|
||||
bundle.putInt("RecipientOid", recipientOid);
|
||||
bundle.putBoolean("IsTeam", isTeam);
|
||||
bundle.putString("TeamMemberOids", teamMemberOids);
|
||||
bundle.putString("TeamMemberNames", teamMemberNames);
|
||||
|
||||
Intent resultIntent = new Intent(this, ChatActivity.class);
|
||||
resultIntent.putExtras(bundle);
|
||||
|
||||
resultIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
|
||||
|
||||
PendingIntent resultPendingIntent = PendingIntent.getActivity(this.getApplicationContext(), (int) (Math.random() * 100), resultIntent, PendingIntent.FLAG_UPDATE_CURRENT);
|
||||
|
||||
NotificationManager mNotifyMgr = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
|
||||
|
||||
mBuilder.setContentIntent(resultPendingIntent);
|
||||
|
||||
mNotifyMgr.notify((new Random()).nextInt(9999 - 1000) + 1000, mBuilder.build());
|
||||
}
|
||||
|
||||
private Bitmap GetCircleBitmap(Bitmap bitmap) {
|
||||
|
||||
Bitmap output = Bitmap.createBitmap(bitmap.getWidth(),
|
||||
|
||||
@@ -262,6 +262,8 @@ public class KontaktChatActivity extends ListActivity {
|
||||
}
|
||||
|
||||
for(ChatPerson cp : result) {
|
||||
Log.i("KONTAKTLISTE", "Version: " + cp.Version);
|
||||
|
||||
if(!oidList.contains(cp.Oid)) {
|
||||
databaseHandler.addContact(new ContactListItem(cp.Name, cp.Oid, cp.IsTeam, cp.TeamMemberOids, cp.TeamMemberNames));
|
||||
}
|
||||
|
||||
@@ -153,4 +153,12 @@ public class MainActivityMitarbeiter extends Activity {
|
||||
|
||||
super.onResume();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
SocketManager.logout();
|
||||
|
||||
finish();
|
||||
System.exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,4 +9,5 @@ public class ChatPerson {
|
||||
public boolean IsTeam;
|
||||
public String TeamMemberNames;
|
||||
public String TeamMemberOids;
|
||||
public int Version;
|
||||
}
|
||||
|
||||
@@ -11,13 +11,13 @@ public class SoapCalls {
|
||||
public static String GET_ALL_CHAT_MESSAGES = "GetAllChatMessagesForSenderAndRecipient";
|
||||
|
||||
//"app4.bewoplaner.de";//
|
||||
public static String DESTINATION_ADDRESS = "192.168.1.103";
|
||||
public static String DESTINATION_ADDRESS = "app4.bewoplaner.de";//"192.168.1.103";
|
||||
public static int DESTINATION_PORT = 5000;
|
||||
|
||||
public static String TOKEN_CHECK_URL = "http://" + DESTINATION_ADDRESS + "/mobil/main/checktoken?token=";
|
||||
public static String TOKEN_CHECK_URL = "https://" + DESTINATION_ADDRESS + "/mobil/main/checktoken?token=";
|
||||
|
||||
public static String WEB_DOKU_URL = "http://" + DESTINATION_ADDRESS + "/mobil/login/demo";
|
||||
public static String WEB_DOKU_URL = "https://" + DESTINATION_ADDRESS + "/mobil/login/demo";
|
||||
|
||||
public static String WSDL_TARGET_NAME = "bliblablubb.org/";
|
||||
public static String SOAP_ADDRESS = "http://" + DESTINATION_ADDRESS + "/BeWoPlanerAndroid/AndroidSoapService.asmx";
|
||||
public static String SOAP_ADDRESS = "https://" + DESTINATION_ADDRESS + "/BeWoPlanerAndroid/AndroidSoapService.asmx";
|
||||
}
|
||||
|
||||
@@ -50,6 +50,10 @@ public class Util {
|
||||
bundle.putString("TeamMemberOids", teamMemberOids);
|
||||
bundle.putString("TeamMemberNames", teamMemberNames);
|
||||
|
||||
//TODO: mehrere Notifications von mehrern Kontakten -> KontaktChatActivity öffnen, sonst ChatActivity
|
||||
|
||||
|
||||
|
||||
Intent resultIntent = new Intent(packageContext, ChatActivity.class);
|
||||
resultIntent.putExtras(bundle);
|
||||
|
||||
@@ -59,6 +63,9 @@ public class Util {
|
||||
|
||||
NotificationManager mNotifyMgr = (NotificationManager) packageContext.getSystemService(Context.NOTIFICATION_SERVICE);
|
||||
|
||||
|
||||
|
||||
|
||||
mBuilder.setContentIntent(resultPendingIntent);
|
||||
|
||||
mNotifyMgr.notify((new Random()).nextInt(9999 - 1000) + 1000, mBuilder.build());
|
||||
|
||||
Reference in New Issue
Block a user