moved from SVN to git
6
Android/BewoKlientenApp/.gitignore
vendored
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
.gradle
|
||||||
|
/local.properties
|
||||||
|
/.idea/workspace.xml
|
||||||
|
/.idea/libraries
|
||||||
|
.DS_Store
|
||||||
|
/build
|
||||||
1
Android/BewoKlientenApp/.idea/.name
generated
Normal file
@@ -0,0 +1 @@
|
|||||||
|
BewoKlientenApp
|
||||||
22
Android/BewoKlientenApp/.idea/compiler.xml
generated
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="CompilerConfiguration">
|
||||||
|
<option name="DEFAULT_COMPILER" value="Javac" />
|
||||||
|
<resourceExtensions />
|
||||||
|
<wildcardResourcePatterns>
|
||||||
|
<entry name="!?*.java" />
|
||||||
|
<entry name="!?*.form" />
|
||||||
|
<entry name="!?*.class" />
|
||||||
|
<entry name="!?*.groovy" />
|
||||||
|
<entry name="!?*.scala" />
|
||||||
|
<entry name="!?*.flex" />
|
||||||
|
<entry name="!?*.kt" />
|
||||||
|
<entry name="!?*.clj" />
|
||||||
|
</wildcardResourcePatterns>
|
||||||
|
<annotationProcessing>
|
||||||
|
<profile default="true" name="Default" enabled="false">
|
||||||
|
<processorPath useClasspath="true" />
|
||||||
|
</profile>
|
||||||
|
</annotationProcessing>
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
3
Android/BewoKlientenApp/.idea/copyright/profiles_settings.xml
generated
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
<component name="CopyrightManager">
|
||||||
|
<settings default="" />
|
||||||
|
</component>
|
||||||
6
Android/BewoKlientenApp/.idea/encodings.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="Encoding">
|
||||||
|
<file url="PROJECT" charset="UTF-8" />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
23
Android/BewoKlientenApp/.idea/gradle.xml
generated
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="GradleSettings">
|
||||||
|
<option name="linkedExternalProjectsSettings">
|
||||||
|
<GradleProjectSettings>
|
||||||
|
<option name="distributionType" value="DEFAULT_WRAPPED" />
|
||||||
|
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||||
|
<option name="modules">
|
||||||
|
<set>
|
||||||
|
<option value="$PROJECT_DIR$" />
|
||||||
|
<option value="$PROJECT_DIR$/app" />
|
||||||
|
</set>
|
||||||
|
</option>
|
||||||
|
<option name="myModules">
|
||||||
|
<set>
|
||||||
|
<option value="$PROJECT_DIR$" />
|
||||||
|
<option value="$PROJECT_DIR$/app" />
|
||||||
|
</set>
|
||||||
|
</option>
|
||||||
|
</GradleProjectSettings>
|
||||||
|
</option>
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
46
Android/BewoKlientenApp/.idea/misc.xml
generated
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="NullableNotNullManager">
|
||||||
|
<option name="myDefaultNullable" value="android.support.annotation.Nullable" />
|
||||||
|
<option name="myDefaultNotNull" value="android.support.annotation.NonNull" />
|
||||||
|
<option name="myNullables">
|
||||||
|
<value>
|
||||||
|
<list size="4">
|
||||||
|
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.Nullable" />
|
||||||
|
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nullable" />
|
||||||
|
<item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.Nullable" />
|
||||||
|
<item index="3" class="java.lang.String" itemvalue="android.support.annotation.Nullable" />
|
||||||
|
</list>
|
||||||
|
</value>
|
||||||
|
</option>
|
||||||
|
<option name="myNotNulls">
|
||||||
|
<value>
|
||||||
|
<list size="4">
|
||||||
|
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.NotNull" />
|
||||||
|
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nonnull" />
|
||||||
|
<item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.NonNull" />
|
||||||
|
<item index="3" class="java.lang.String" itemvalue="android.support.annotation.NonNull" />
|
||||||
|
</list>
|
||||||
|
</value>
|
||||||
|
</option>
|
||||||
|
</component>
|
||||||
|
<component name="ProjectLevelVcsManager" settingsEditedManually="false">
|
||||||
|
<OptionsSetting value="true" id="Add" />
|
||||||
|
<OptionsSetting value="true" id="Remove" />
|
||||||
|
<OptionsSetting value="true" id="Checkout" />
|
||||||
|
<OptionsSetting value="true" id="Update" />
|
||||||
|
<OptionsSetting value="true" id="Status" />
|
||||||
|
<OptionsSetting value="true" id="Edit" />
|
||||||
|
<ConfirmationsSetting value="0" id="Add" />
|
||||||
|
<ConfirmationsSetting value="0" id="Remove" />
|
||||||
|
</component>
|
||||||
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||||
|
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||||
|
</component>
|
||||||
|
<component name="ProjectType">
|
||||||
|
<option name="id" value="Android" />
|
||||||
|
</component>
|
||||||
|
<component name="SvnBranchConfigurationManager">
|
||||||
|
<option name="mySupportsUserInfoFilter" value="true" />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
9
Android/BewoKlientenApp/.idea/modules.xml
generated
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="ProjectModuleManager">
|
||||||
|
<modules>
|
||||||
|
<module fileurl="file://$PROJECT_DIR$/BewoKlientenApp.iml" filepath="$PROJECT_DIR$/BewoKlientenApp.iml" />
|
||||||
|
<module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" />
|
||||||
|
</modules>
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
12
Android/BewoKlientenApp/.idea/runConfigurations.xml
generated
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="RunConfigurationProducerService">
|
||||||
|
<option name="ignoredProducers">
|
||||||
|
<set>
|
||||||
|
<option value="org.jetbrains.plugins.gradle.execution.test.runner.AllInPackageGradleConfigurationProducer" />
|
||||||
|
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestClassGradleConfigurationProducer" />
|
||||||
|
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestMethodGradleConfigurationProducer" />
|
||||||
|
</set>
|
||||||
|
</option>
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
6
Android/BewoKlientenApp/.idea/vcs.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="VcsDirectoryMappings">
|
||||||
|
<mapping directory="" vcs="svn" />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
19
Android/BewoKlientenApp/BewoKlientenApp.iml
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<module external.linked.project.id="BewoKlientenApp" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" external.system.module.group="" external.system.module.version="unspecified" type="JAVA_MODULE" version="4">
|
||||||
|
<component name="FacetManager">
|
||||||
|
<facet type="java-gradle" name="Java-Gradle">
|
||||||
|
<configuration>
|
||||||
|
<option name="BUILD_FOLDER_PATH" value="$MODULE_DIR$/build" />
|
||||||
|
<option name="BUILDABLE" value="false" />
|
||||||
|
</configuration>
|
||||||
|
</facet>
|
||||||
|
</component>
|
||||||
|
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-compiler-output="true">
|
||||||
|
<exclude-output />
|
||||||
|
<content url="file://$MODULE_DIR$">
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/.gradle" />
|
||||||
|
</content>
|
||||||
|
<orderEntry type="inheritedJdk" />
|
||||||
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
|
</component>
|
||||||
|
</module>
|
||||||
1
Android/BewoKlientenApp/app/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
/build
|
||||||
114
Android/BewoKlientenApp/app/app.iml
Normal file
@@ -0,0 +1,114 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<module external.linked.project.id=":app" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/.." external.system.id="GRADLE" external.system.module.group="BewoKlientenApp" external.system.module.version="unspecified" type="JAVA_MODULE" version="4">
|
||||||
|
<component name="FacetManager">
|
||||||
|
<facet type="android-gradle" name="Android-Gradle">
|
||||||
|
<configuration>
|
||||||
|
<option name="GRADLE_PROJECT_PATH" value=":app" />
|
||||||
|
</configuration>
|
||||||
|
</facet>
|
||||||
|
<facet type="android" name="Android">
|
||||||
|
<configuration>
|
||||||
|
<option name="SELECTED_BUILD_VARIANT" value="debug" />
|
||||||
|
<option name="SELECTED_TEST_ARTIFACT" value="_android_test_" />
|
||||||
|
<option name="ASSEMBLE_TASK_NAME" value="assembleDebug" />
|
||||||
|
<option name="COMPILE_JAVA_TASK_NAME" value="compileDebugSources" />
|
||||||
|
<afterSyncTasks>
|
||||||
|
<task>generateDebugSources</task>
|
||||||
|
</afterSyncTasks>
|
||||||
|
<option name="ALLOW_USER_CONFIGURATION" value="false" />
|
||||||
|
<option name="MANIFEST_FILE_RELATIVE_PATH" value="/src/main/AndroidManifest.xml" />
|
||||||
|
<option name="RES_FOLDER_RELATIVE_PATH" value="/src/main/res" />
|
||||||
|
<option name="RES_FOLDERS_RELATIVE_PATH" value="file://$MODULE_DIR$/src/main/res" />
|
||||||
|
<option name="ASSETS_FOLDER_RELATIVE_PATH" value="/src/main/assets" />
|
||||||
|
</configuration>
|
||||||
|
</facet>
|
||||||
|
</component>
|
||||||
|
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-compiler-output="false">
|
||||||
|
<output url="file://$MODULE_DIR$/build/intermediates/classes/debug" />
|
||||||
|
<output-test url="file://$MODULE_DIR$/build/intermediates/classes/test/debug" />
|
||||||
|
<exclude-output />
|
||||||
|
<content url="file://$MODULE_DIR$">
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/debug" isTestSource="false" generated="true" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/debug" isTestSource="false" generated="true" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/debug" isTestSource="false" generated="true" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/debug" isTestSource="false" generated="true" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/debug" type="java-resource" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/debug" type="java-resource" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/androidTest/debug" isTestSource="true" generated="true" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/androidTest/debug" isTestSource="true" generated="true" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/androidTest/debug" isTestSource="true" generated="true" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/androidTest/debug" isTestSource="true" generated="true" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/androidTest/debug" type="java-test-resource" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/androidTest/debug" type="java-test-resource" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/src/debug/res" type="java-resource" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/src/debug/resources" type="java-resource" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/src/debug/assets" type="java-resource" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/src/debug/aidl" isTestSource="false" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/src/debug/java" isTestSource="false" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/src/debug/jni" isTestSource="false" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/src/debug/rs" isTestSource="false" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/src/debug/shaders" isTestSource="false" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/res" type="java-test-resource" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/resources" type="java-test-resource" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/assets" type="java-test-resource" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/aidl" isTestSource="true" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/java" isTestSource="true" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/jni" isTestSource="true" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/rs" isTestSource="true" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/shaders" isTestSource="true" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/src/main/res" type="java-resource" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/src/main/assets" type="java-resource" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/src/main/aidl" isTestSource="false" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
|
||||||
|
<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/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" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/aidl" isTestSource="true" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" />
|
||||||
|
<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/bundles" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dependency-cache" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/appcompat-v7/21.0.3/jars" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-v4/21.0.3/jars" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental-classes" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental-runtime-classes" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental-safeguard" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental-verifier" />
|
||||||
|
<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/reload-dex" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/restart-dex" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/shaders" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/transforms" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/build/outputs" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/build/tmp" />
|
||||||
|
</content>
|
||||||
|
<orderEntry type="jdk" jdkName="Android API 21 Platform" jdkType="Android SDK" />
|
||||||
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
|
<orderEntry type="library" exported="" name="appcompat-v7-21.0.3" level="project" />
|
||||||
|
<orderEntry type="library" exported="" name="support-v4-21.0.3" level="project" />
|
||||||
|
<orderEntry type="library" exported="" name="support-annotations-21.0.3" level="project" />
|
||||||
|
</component>
|
||||||
|
</module>
|
||||||
44
Android/BewoKlientenApp/app/build.gradle
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
apply plugin: 'com.android.application'
|
||||||
|
|
||||||
|
|
||||||
|
android {
|
||||||
|
compileSdkVersion 21
|
||||||
|
buildToolsVersion "23.0.2"
|
||||||
|
|
||||||
|
defaultConfig {
|
||||||
|
applicationId "beyondsoft.bewoklientenapp"
|
||||||
|
minSdkVersion 18
|
||||||
|
targetSdkVersion 21
|
||||||
|
versionCode 1
|
||||||
|
versionName "1.0"
|
||||||
|
}
|
||||||
|
buildTypes {
|
||||||
|
release {
|
||||||
|
minifyEnabled false
|
||||||
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
compileOptions {
|
||||||
|
sourceCompatibility = JavaVersion.VERSION_1_7
|
||||||
|
targetCompatibility = JavaVersion.VERSION_1_7
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
compile fileTree(include: ['*.jar'], dir: 'libs')
|
||||||
|
compile 'com.android.support:appcompat-v7:21.0.3'
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
configurations {
|
||||||
|
sql
|
||||||
|
}
|
||||||
|
dependencies {
|
||||||
|
sql 'mysql:mysql-connector-java:5.1.16'
|
||||||
|
}
|
||||||
|
task buildTravelDatabase << {
|
||||||
|
ant.sql(classpath: configurations.sql.asPath)
|
||||||
|
}*/
|
||||||
17
Android/BewoKlientenApp/app/proguard-rules.pro
vendored
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
# Add project specific ProGuard rules here.
|
||||||
|
# By default, the flags in this file are appended to flags specified
|
||||||
|
# in C:\Users\bib\AppData\Local\Android\sdk/tools/proguard/proguard-android.txt
|
||||||
|
# You can edit the include path and order by changing the proguardFiles
|
||||||
|
# directive in build.gradle.
|
||||||
|
#
|
||||||
|
# For more details, see
|
||||||
|
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||||
|
|
||||||
|
# Add any project specific keep options here:
|
||||||
|
|
||||||
|
# If your project uses WebView with JS, uncomment the following
|
||||||
|
# and specify the fully qualified class name to the JavaScript interface
|
||||||
|
# class:
|
||||||
|
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||||
|
# public *;
|
||||||
|
#}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package beyondsoft.bewoklientenapp;
|
||||||
|
|
||||||
|
import android.app.Application;
|
||||||
|
import android.test.ApplicationTestCase;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a>
|
||||||
|
*/
|
||||||
|
public class ApplicationTest extends ApplicationTestCase<Application> {
|
||||||
|
public ApplicationTest() {
|
||||||
|
super(Application.class);
|
||||||
|
}
|
||||||
|
}
|
||||||
77
Android/BewoKlientenApp/app/src/main/AndroidManifest.xml
Normal file
@@ -0,0 +1,77 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
package="beyondsoft.bewoklientenapp" >
|
||||||
|
|
||||||
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
|
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||||
|
|
||||||
|
|
||||||
|
<application
|
||||||
|
android:allowBackup="true"
|
||||||
|
android:icon="@mipmap/ic_launcher"
|
||||||
|
android:label="@string/app_name"
|
||||||
|
android:theme="@style/AppTheme">
|
||||||
|
|
||||||
|
|
||||||
|
<activity
|
||||||
|
android:name=".SplashScreenActivity"
|
||||||
|
android:theme="@android:style/Theme.NoTitleBar" >
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
|
</intent-filter>
|
||||||
|
</activity>
|
||||||
|
|
||||||
|
<activity
|
||||||
|
android:name=".MainActivityKlient"
|
||||||
|
android:label="@string/app_name" >
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.activity_main_activity_klient" />
|
||||||
|
|
||||||
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
|
</intent-filter>
|
||||||
|
</activity>
|
||||||
|
|
||||||
|
<activity
|
||||||
|
android:name=".UberprufungsActiviti"
|
||||||
|
android:label="@string/app_name" >
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.approve" />
|
||||||
|
|
||||||
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
|
</intent-filter>
|
||||||
|
</activity>
|
||||||
|
|
||||||
|
<activity
|
||||||
|
android:name=".kasseActiviti"
|
||||||
|
android:label="@string/app_name" >
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.kasse" />
|
||||||
|
|
||||||
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
|
</intent-filter>
|
||||||
|
</activity>
|
||||||
|
|
||||||
|
<activity
|
||||||
|
android:name=".CalenderActiviti"
|
||||||
|
android:label="@string/app_name" >
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.calender" />
|
||||||
|
|
||||||
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
|
</intent-filter>
|
||||||
|
</activity>
|
||||||
|
|
||||||
|
<activity
|
||||||
|
android:name=".chatActiviti"
|
||||||
|
android:label="@string/app_name" >
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.chat" />
|
||||||
|
|
||||||
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
|
</intent-filter>
|
||||||
|
</activity>
|
||||||
|
|
||||||
|
</application>
|
||||||
|
|
||||||
|
</manifest>
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
package beyondsoft.bewoklientenapp;
|
||||||
|
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.support.v7.app.ActionBarActivity;
|
||||||
|
import android.view.Menu;
|
||||||
|
import android.view.MenuItem;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by bib on 29.04.2016.
|
||||||
|
*/
|
||||||
|
public class CalenderActiviti extends ActionBarActivity {
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.calender);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onCreateOptionsMenu(Menu menu) {
|
||||||
|
// Inflate the menu; this adds items to the action bar if it is present.
|
||||||
|
getMenuInflater().inflate(R.menu.menu_calender, menu);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
|
// Handle action bar item clicks here. The action bar will
|
||||||
|
// automatically handle clicks on the Home/Up button, so long
|
||||||
|
// as you specify a parent activity in AndroidManifest.xml.
|
||||||
|
int id = item.getItemId();
|
||||||
|
|
||||||
|
//noinspection SimplifiableIfStatement
|
||||||
|
if (id == R.id.action_back) {
|
||||||
|
|
||||||
|
finish();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return super.onOptionsItemSelected(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
package beyondsoft.bewoklientenapp;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by bib on 19.05.2016.
|
||||||
|
*/
|
||||||
|
public class ChatMessageFormat {
|
||||||
|
|
||||||
|
private boolean isMe;
|
||||||
|
private String message;
|
||||||
|
private String datum;
|
||||||
|
|
||||||
|
//villeicht eine issend variable einbauen
|
||||||
|
|
||||||
|
ChatMessageFormat(String message, boolean isMe, String datum){
|
||||||
|
this.message = message;
|
||||||
|
this.isMe = isMe;
|
||||||
|
this.datum = datum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean getIsME(){return isMe;}
|
||||||
|
|
||||||
|
public String getMessage(){return message;}
|
||||||
|
|
||||||
|
public String getDatum(){return datum;}
|
||||||
|
}
|
||||||
@@ -0,0 +1,143 @@
|
|||||||
|
package beyondsoft.bewoklientenapp;
|
||||||
|
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.support.v7.app.ActionBarActivity;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.view.Menu;
|
||||||
|
import android.view.MenuItem;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.Button;
|
||||||
|
|
||||||
|
|
||||||
|
public class MainActivityKlient extends ActionBarActivity {
|
||||||
|
//##################### Variablen ####################
|
||||||
|
protected Button kalenderbutton;
|
||||||
|
protected Button kassenbutton;
|
||||||
|
protected Button chatbutton;
|
||||||
|
protected Button logoutbutton;
|
||||||
|
//####################################################
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.activity_main_activity_klient);
|
||||||
|
|
||||||
|
|
||||||
|
setzeButtonListener();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onCreateOptionsMenu(Menu menu) {
|
||||||
|
// Inflate the menu; this adds items to the action bar if it is present.
|
||||||
|
getMenuInflater().inflate(R.menu.menu_main_activity_klient, menu);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
|
// Handle action bar item clicks here. The action bar will
|
||||||
|
// automatically handle clicks on the Home/Up button, so long
|
||||||
|
// as you specify a parent activity in AndroidManifest.xml.
|
||||||
|
int id = item.getItemId();
|
||||||
|
|
||||||
|
//noinspection SimplifiableIfStatement
|
||||||
|
//R.id.action_settings
|
||||||
|
//
|
||||||
|
|
||||||
|
if(id == R.id.action_Logout){
|
||||||
|
System.exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
return super.onOptionsItemSelected(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
//########################## Action events der Jeweiligen Buttons
|
||||||
|
//########################## Start Kalender
|
||||||
|
public void startKalenderActiviti(){
|
||||||
|
|
||||||
|
//Intent intent = new Intent((), CalenderActiviti.class);
|
||||||
|
//startActivity(intent);
|
||||||
|
startActivity(new Intent(getBaseContext(),CalenderActiviti.class));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//########################## Start Kasse
|
||||||
|
public void startKassenActiviti(){
|
||||||
|
|
||||||
|
startActivity(new Intent(getBaseContext(),kasseActiviti.class));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//########################## Start Chat
|
||||||
|
public void startChatActiviti(){
|
||||||
|
|
||||||
|
startActivity(new Intent(getBaseContext(),chatActiviti.class));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//########################## Start Logout
|
||||||
|
public void startLogoutActiviti(){
|
||||||
|
|
||||||
|
System.exit(0);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//###############################################################
|
||||||
|
|
||||||
|
|
||||||
|
//---------------- Gesetzte Listener der Einzelnen Buttons ------------
|
||||||
|
|
||||||
|
public void setzeButtonListener(){
|
||||||
|
|
||||||
|
//################## Kalender Button ######################
|
||||||
|
kalenderbutton = (Button) findViewById(R.id.KalenderButton);
|
||||||
|
kalenderbutton.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
|
||||||
|
startKalenderActiviti();
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
//################# Kassen Button #########################
|
||||||
|
kassenbutton = (Button) findViewById(R.id.KassenButton);
|
||||||
|
kassenbutton.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
|
||||||
|
startKassenActiviti();
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
//################## Chat Button ###########################
|
||||||
|
chatbutton = (Button) findViewById(R.id.Chatbutton);
|
||||||
|
chatbutton.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
|
||||||
|
startChatActiviti();
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
//################## Logout Button ###########################
|
||||||
|
logoutbutton = (Button) findViewById(R.id.Logoutbutton);
|
||||||
|
logoutbutton.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
|
||||||
|
startLogoutActiviti();
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,108 @@
|
|||||||
|
package beyondsoft.bewoklientenapp;
|
||||||
|
|
||||||
|
import android.app.Activity;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.ArrayAdapter;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by bib on 20.05.2016.
|
||||||
|
*/
|
||||||
|
public class MessageAdapter extends ArrayAdapter<ChatMessageFormat> {
|
||||||
|
|
||||||
|
private Activity activity;
|
||||||
|
private List<ChatMessageFormat> messages;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public MessageAdapter(Activity context, int resource, List<ChatMessageFormat> objects) {
|
||||||
|
super(context, resource, objects);
|
||||||
|
this.activity = context;
|
||||||
|
this.messages = objects;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public View getView(int position, View convertView, ViewGroup parent) {
|
||||||
|
ViewHolder holder;
|
||||||
|
LayoutInflater inflater = (LayoutInflater) activity.getSystemService(Activity.LAYOUT_INFLATER_SERVICE);
|
||||||
|
|
||||||
|
int layoutResource = 0; // determined by view type
|
||||||
|
ChatMessageFormat chatMessage = getItem(position);
|
||||||
|
int viewType = getItemViewType(position);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//Splitt message um zu wissen ob from server oder nicht
|
||||||
|
String line = chatMessage.getMessage();
|
||||||
|
|
||||||
|
String[] splitt = line.split(":");
|
||||||
|
|
||||||
|
//Server nachricht kenntlich machen
|
||||||
|
if (chatMessage.getIsME()) {
|
||||||
|
layoutResource = R.layout.item_chat_left;
|
||||||
|
} else if(splitt[0].equals("Server")) {
|
||||||
|
layoutResource = R.layout.item_chat_sever_right;
|
||||||
|
}else {
|
||||||
|
layoutResource = R.layout.item_chat_right;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Original
|
||||||
|
if (chatMessage.getIsME()) {
|
||||||
|
layoutResource = R.layout.item_chat_left;
|
||||||
|
} else {
|
||||||
|
layoutResource = R.layout.item_chat_right;
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
/* if (convertView != null) {
|
||||||
|
holder = (ViewHolder) convertView.getTag();
|
||||||
|
Log.v("Status","Bin ich hier ?? ");
|
||||||
|
} else {*/
|
||||||
|
convertView = inflater.inflate(layoutResource, parent, false);
|
||||||
|
holder = new ViewHolder(convertView);
|
||||||
|
convertView.setTag(holder);
|
||||||
|
//}
|
||||||
|
|
||||||
|
//set message content
|
||||||
|
holder.msg.setText(chatMessage.getMessage());
|
||||||
|
|
||||||
|
if(chatMessage.getIsME()){
|
||||||
|
holder.dateOut.setText(chatMessage.getDatum());
|
||||||
|
}else {
|
||||||
|
holder.dateIn.setText(chatMessage.getDatum());
|
||||||
|
}
|
||||||
|
|
||||||
|
return convertView;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getViewTypeCount() {
|
||||||
|
// return the total number of view types. this value should never change
|
||||||
|
// at runtime
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getItemViewType(int position) {
|
||||||
|
// return a value between 0 and (getViewTypeCount - 1)
|
||||||
|
return position % 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
private class ViewHolder {
|
||||||
|
private TextView msg;
|
||||||
|
private TextView dateOut;
|
||||||
|
private TextView dateIn;
|
||||||
|
|
||||||
|
public ViewHolder(View v) {
|
||||||
|
msg = (TextView) v.findViewById(R.id.txt_msg);
|
||||||
|
dateOut = (TextView)v.findViewById(R.id.DateOUT);
|
||||||
|
dateIn = (TextView)v.findViewById(R.id.DateIN);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,91 @@
|
|||||||
|
package beyondsoft.bewoklientenapp;
|
||||||
|
|
||||||
|
import android.app.Activity;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import java.sql.Connection;
|
||||||
|
|
||||||
|
import java.sql.*;
|
||||||
|
import java.sql.DriverManager;
|
||||||
|
import java.sql.ResultSetMetaData;
|
||||||
|
import java.sql.ResultSet;
|
||||||
|
import java.sql.SQLException;
|
||||||
|
import java.sql.Statement;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by bib on 29.04.2016.
|
||||||
|
*/
|
||||||
|
public class ServerAnbindung extends Activity {
|
||||||
|
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
|
connect();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void connect(){
|
||||||
|
|
||||||
|
String DBip = "192.168.1.115";
|
||||||
|
String DBport = "3306";
|
||||||
|
String DBname = "1234567890";
|
||||||
|
String DBusername = "root";
|
||||||
|
String DBpasswd = "root";
|
||||||
|
|
||||||
|
try {
|
||||||
|
|
||||||
|
|
||||||
|
Connection con = null;
|
||||||
|
|
||||||
|
//Class.forName("com.mysql.jdbc.Driver").newInstance();
|
||||||
|
|
||||||
|
|
||||||
|
System.out.println("Wenn hier: Das problem liegt nicht an der klasse ");
|
||||||
|
|
||||||
|
// con = DriverManager.getConnection("jdbc:mysql://"+DBip+":"+DBport+"/"+DBname+"?"+"user="+DBusername+"&"+"password="+DBpasswd);
|
||||||
|
|
||||||
|
System.out.println("Serververbindung steht");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}catch (Exception e){
|
||||||
|
|
||||||
|
|
||||||
|
System.out.println("-------------------------------- ");
|
||||||
|
System.out.println("alles kaput");
|
||||||
|
e.printStackTrace();
|
||||||
|
System.out.println("SQLException: " + e.getMessage());
|
||||||
|
|
||||||
|
System.out.println("-------------------------------- ");
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
package beyondsoft.bewoklientenapp;
|
||||||
|
|
||||||
|
import android.app.Activity;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.os.Bundle;
|
||||||
|
|
||||||
|
import java.util.logging.Handler;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by bib on 23.05.2016.
|
||||||
|
*/
|
||||||
|
public class SplashScreenActivity extends Activity {
|
||||||
|
|
||||||
|
|
||||||
|
private static final int SPLASH_DURATION = 4000;
|
||||||
|
private Handler startMain;
|
||||||
|
|
||||||
|
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.splashscreen);
|
||||||
|
|
||||||
|
Thread logoTimer = new Thread() {
|
||||||
|
public void run(){
|
||||||
|
try{
|
||||||
|
int logoTimer = 0;
|
||||||
|
while(logoTimer < 2125){
|
||||||
|
sleep(75);
|
||||||
|
logoTimer = logoTimer +100;
|
||||||
|
};
|
||||||
|
startActivity(new Intent(getBaseContext(),UberprufungsActiviti.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
catch (InterruptedException e) {
|
||||||
|
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
finally{
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
logoTimer.start();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,61 @@
|
|||||||
|
package beyondsoft.bewoklientenapp;
|
||||||
|
|
||||||
|
import android.app.Activity;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.Button;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by bib on 01.06.2016.
|
||||||
|
*/
|
||||||
|
public class UberprufungsActiviti extends Activity {
|
||||||
|
|
||||||
|
|
||||||
|
Button approve;
|
||||||
|
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.approve);
|
||||||
|
|
||||||
|
SetButtonAktive();
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void SetButtonAktive(){
|
||||||
|
|
||||||
|
approve =(Button)findViewById(R.id.button);
|
||||||
|
|
||||||
|
approve.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
|
||||||
|
boolean x = ÜberprüfeRecht();
|
||||||
|
|
||||||
|
if(x) {
|
||||||
|
startActivity(new Intent(getBaseContext(), MainActivityKlient.class));
|
||||||
|
}else{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public boolean ÜberprüfeRecht(){
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,559 @@
|
|||||||
|
package beyondsoft.bewoklientenapp;
|
||||||
|
|
||||||
|
import android.app.Notification;
|
||||||
|
import android.app.NotificationManager;
|
||||||
|
import android.app.PendingIntent;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.graphics.Color;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.support.v4.app.NotificationCompat;
|
||||||
|
import android.support.v7.app.ActionBar;
|
||||||
|
import android.support.v7.app.ActionBarActivity;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.Menu;
|
||||||
|
import android.view.MenuItem;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.ArrayAdapter;
|
||||||
|
import android.widget.Button;
|
||||||
|
import android.widget.EditText;
|
||||||
|
import android.widget.ImageView;
|
||||||
|
import android.widget.ListView;
|
||||||
|
import android.widget.TextView;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import java.io.BufferedReader;
|
||||||
|
import java.io.DataOutputStream;
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.FileInputStream;
|
||||||
|
import java.io.FileOutputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.InputStreamReader;
|
||||||
|
import java.net.Socket;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Calendar;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by bib on 03.05.2016.
|
||||||
|
*/
|
||||||
|
public class chatActiviti extends ActionBarActivity {
|
||||||
|
|
||||||
|
//View Variablen
|
||||||
|
protected TextView chat;
|
||||||
|
protected EditText text;
|
||||||
|
protected Button senden;
|
||||||
|
|
||||||
|
//Server Variablen
|
||||||
|
public static Socket socket;
|
||||||
|
protected static final String dstAddress = "192.168.1.115"; //10.0.2.2"
|
||||||
|
protected static final int dstPort = 5000;
|
||||||
|
DataOutputStream st;
|
||||||
|
|
||||||
|
|
||||||
|
//Design View
|
||||||
|
protected ListView listView;
|
||||||
|
protected boolean isMe = true;
|
||||||
|
protected List<ChatMessageFormat> chatMessages;
|
||||||
|
protected ArrayAdapter<ChatMessageFormat> adapter;
|
||||||
|
ChatMessageFormat chatMessage;
|
||||||
|
|
||||||
|
|
||||||
|
//Save/ Load Variblen
|
||||||
|
File file;
|
||||||
|
|
||||||
|
//Chat Name
|
||||||
|
protected String name;
|
||||||
|
|
||||||
|
|
||||||
|
//Für Notification
|
||||||
|
private static boolean isOnStop = false;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.chat);
|
||||||
|
|
||||||
|
|
||||||
|
//########### Custom Action Bar ##################################
|
||||||
|
ActionBar action = getSupportActionBar();
|
||||||
|
|
||||||
|
action.setDisplayShowHomeEnabled(false);
|
||||||
|
action.setDisplayShowTitleEnabled(false);
|
||||||
|
|
||||||
|
LayoutInflater inflate = LayoutInflater.from(this);
|
||||||
|
View mCustomView = inflate.inflate(R.layout.custom_menuebar,null);
|
||||||
|
|
||||||
|
//get Daten aus vorheriger Activity
|
||||||
|
// Bundle zielkorb = getIntent().getExtras();
|
||||||
|
name = "Hanz";//zielkorb.getString("Name");
|
||||||
|
|
||||||
|
// Initialiesiere die Variablen
|
||||||
|
TextView titlename = (TextView)mCustomView.findViewById(R.id.PersonalName);
|
||||||
|
ImageView titlepic = (ImageView)mCustomView.findViewById(R.id.PersonalPic);
|
||||||
|
|
||||||
|
titlepic.setImageResource(R.drawable.katze3);
|
||||||
|
titlename.setText(name);
|
||||||
|
|
||||||
|
action.setCustomView(mCustomView);
|
||||||
|
action.setDisplayShowCustomEnabled(true);
|
||||||
|
//###########################################################################################
|
||||||
|
|
||||||
|
senden = (Button)findViewById(R.id.Sendebutton);
|
||||||
|
//chat = (TextView)findViewById(R.id.ChatText);
|
||||||
|
|
||||||
|
//################### Initial Design Variabeln #############################################
|
||||||
|
chatMessages = new ArrayList<>();
|
||||||
|
|
||||||
|
listView = (ListView)findViewById(R.id.list_msg);
|
||||||
|
|
||||||
|
adapter = new MessageAdapter(this, R.layout.item_chat_left,chatMessages);
|
||||||
|
listView.setAdapter(adapter);
|
||||||
|
|
||||||
|
//############################ Initial Design Variablen ende ###############################
|
||||||
|
|
||||||
|
//############## Safe / Write gedöns #########################################################
|
||||||
|
CreateFile();
|
||||||
|
|
||||||
|
ReadMessageToStorage();
|
||||||
|
|
||||||
|
//##########################################################################################
|
||||||
|
|
||||||
|
|
||||||
|
//Öffnet eine Verbindung zum Server
|
||||||
|
new Thread(new OpenConnection()).start();
|
||||||
|
|
||||||
|
|
||||||
|
text = (EditText)findViewById(R.id.editText);
|
||||||
|
|
||||||
|
//Sendet eine Nachricht an den Server/Clienten
|
||||||
|
senden.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
|
||||||
|
//isMe = true;
|
||||||
|
|
||||||
|
if(text.getText().toString().equals("exit")){
|
||||||
|
//eine möglich keit die connection zu schließen
|
||||||
|
new Thread(new ConnectionClose()).start();
|
||||||
|
}else if(!text.getText().toString().equals("")){
|
||||||
|
new Thread(new SendMS()).start();
|
||||||
|
}else{
|
||||||
|
Toast.makeText(chatActiviti.this, "Sie müssen schon Text eingeben ", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
//Erstelle einen immer horchenden Listener
|
||||||
|
Thread t = new Thread(new SocketListener());
|
||||||
|
t.start();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//######################### Server/ Client gedöns ##################################################
|
||||||
|
public class OpenConnection implements Runnable{
|
||||||
|
public void run(){
|
||||||
|
try {
|
||||||
|
socket = new Socket(dstAddress,dstPort);
|
||||||
|
// Log.v("Status: ","Vorhanden 3");
|
||||||
|
|
||||||
|
//nachricht an server senden welcher name jetz aktiv connected ist
|
||||||
|
st = new DataOutputStream(socket.getOutputStream());
|
||||||
|
name=name+"/1";
|
||||||
|
byte[] ts = name.getBytes();
|
||||||
|
st.write(ts);
|
||||||
|
st.flush();
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
// e.printStackTrace();
|
||||||
|
Log.v("Connection: ","Konnte nicht Aufgebaut");
|
||||||
|
socket = null;
|
||||||
|
//methode zur abfrage
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class SendMS implements Runnable{
|
||||||
|
public void run(){
|
||||||
|
String al = text.getText().toString();
|
||||||
|
// Log.v("TExt ist :",text.getText().toString());
|
||||||
|
byte[] ts = al.getBytes();
|
||||||
|
try{
|
||||||
|
if(socket!= null ) {
|
||||||
|
// st = new DataOutputStream(socket.getOutputStream());
|
||||||
|
st.write(ts);
|
||||||
|
st.flush();
|
||||||
|
}
|
||||||
|
|
||||||
|
listView.post(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
Calendar c = Calendar.getInstance();
|
||||||
|
SimpleDateFormat df = new SimpleDateFormat("dd-MM-yyyy HH:mm:ss");
|
||||||
|
String formattedDate = df.format(c.getTime());
|
||||||
|
|
||||||
|
WriteMessagesfromStorage(text.getText().toString()+"/"+isMe+"%"+formattedDate+"\n");
|
||||||
|
|
||||||
|
chatMessage = new ChatMessageFormat(text.getText().toString(), isMe, formattedDate);
|
||||||
|
chatMessages.add(chatMessage);
|
||||||
|
adapter.notifyDataSetChanged();
|
||||||
|
|
||||||
|
text.setText("");
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}catch(IOException s){
|
||||||
|
Log.v("Status: ","Senden einer Nachricht konnte nicht ausgeführt werden");
|
||||||
|
//Log.v("hallo",);
|
||||||
|
s.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ConnectionClose implements Runnable{
|
||||||
|
public void run(){
|
||||||
|
try {
|
||||||
|
// Log.v("Bin ich Überhaupt", "Hier drinne");
|
||||||
|
if (st != null) {
|
||||||
|
st.flush();
|
||||||
|
st.close();
|
||||||
|
}
|
||||||
|
if (socket != null)
|
||||||
|
socket.close();
|
||||||
|
// Log.v("Schliesen :","?? Möglich");
|
||||||
|
// }
|
||||||
|
Log.v("Status","Socket succesfull closed");
|
||||||
|
}catch(IOException se){
|
||||||
|
Log.v("Status: ","Schließen nicht möglich. Es ist ein Fehler aufgetreten");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public class SocketListener implements Runnable{
|
||||||
|
|
||||||
|
String str;
|
||||||
|
long i = 1;
|
||||||
|
BufferedReader in = null;
|
||||||
|
public void run(){
|
||||||
|
try{
|
||||||
|
//DesignTechnische gründe
|
||||||
|
|
||||||
|
while(true){
|
||||||
|
|
||||||
|
if (socket != null) {
|
||||||
|
if(socket.isConnected()) {
|
||||||
|
Log.v("Connection Steht ", "Connection Steht");
|
||||||
|
|
||||||
|
//final TextView text = (TextView)findViewById(R.id.ChatText);
|
||||||
|
|
||||||
|
final ListView listV = (ListView) findViewById(R.id.list_msg);
|
||||||
|
|
||||||
|
|
||||||
|
in = new BufferedReader(new InputStreamReader(socket.getInputStream()));
|
||||||
|
|
||||||
|
String s = in.readLine();
|
||||||
|
|
||||||
|
CharSequence cs = text.getText();
|
||||||
|
|
||||||
|
// wir nehmen mal cs raus
|
||||||
|
//str = cs + "\r\n" + s;
|
||||||
|
str = s;
|
||||||
|
|
||||||
|
if (s == null)
|
||||||
|
break;
|
||||||
|
|
||||||
|
//Design Spezifisch
|
||||||
|
listV.post(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
|
||||||
|
Calendar c = Calendar.getInstance();
|
||||||
|
SimpleDateFormat df = new SimpleDateFormat("dd-MM-yyyy HH:mm:ss");
|
||||||
|
String formattedDate = df.format(c.getTime());
|
||||||
|
|
||||||
|
boolean determind = false;
|
||||||
|
|
||||||
|
WriteMessagesfromStorage(str+"/"+determind+"%"+formattedDate+"\n");
|
||||||
|
|
||||||
|
chatMessage = new ChatMessageFormat(str, determind, formattedDate);
|
||||||
|
chatMessages.add(chatMessage);
|
||||||
|
adapter.notifyDataSetChanged();
|
||||||
|
|
||||||
|
if(isOnStop == true){
|
||||||
|
SetNotifi("Bärtiger Hanz",str);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
|
||||||
|
if (in != null)
|
||||||
|
in.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
// else Log.v("Connection","nicht aufgebaut"); nach tausend versuchen break und fehler ausgabe
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}catch(Exception e){
|
||||||
|
Log.v("Status ","Verbindung zum Server wurde seitens dem Server getrennt ");
|
||||||
|
// Log.e(getClass().getName(),e.getMessage());
|
||||||
|
// e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//#################################### Server Client Ende ##########################################
|
||||||
|
|
||||||
|
//########################### Speichere Message für Server bei unsend #####################################
|
||||||
|
public void SaveAfterLoseConnection(){
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SendAfterGetConnection(){
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void CreateCustomFileForConnection(){
|
||||||
|
try{
|
||||||
|
File pfad = getBaseContext().getFilesDir();
|
||||||
|
|
||||||
|
//Für external Save
|
||||||
|
//File pfad = getBaseContext().getExternalFilesDir(null);
|
||||||
|
|
||||||
|
//Erstelle das File Objekt
|
||||||
|
file = new File(pfad,name+"Unsend"+".txt");
|
||||||
|
|
||||||
|
}catch(Exception e){
|
||||||
|
Log.v("Fehler"," Das erstellen/öffnen einer Datei ist Derzeit nicht möglich");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void DeletUnsendMessage(){
|
||||||
|
file.delete();
|
||||||
|
recreate();
|
||||||
|
}
|
||||||
|
|
||||||
|
//####################### Ende Unsend Message Gedöns ###########################################
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//############### Menue Bereich ################################################################
|
||||||
|
|
||||||
|
public boolean onCreateOptionsMenu(Menu menu) {
|
||||||
|
// Inflate the menu; this adds items to the action bar if it is present.
|
||||||
|
getMenuInflater().inflate(R.menu.menu_chat, menu);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
|
// Handle item selection
|
||||||
|
switch (item.getItemId()) {
|
||||||
|
case R.id.action_delet_Storage:
|
||||||
|
file.delete(); //Delet aktuell gespeicherte message
|
||||||
|
recreate(); // ---> gegebenenfals umändern, aber fürs erste reichts
|
||||||
|
return true;
|
||||||
|
default:
|
||||||
|
return super.onOptionsItemSelected(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//################################################################################################
|
||||||
|
|
||||||
|
|
||||||
|
//############## Setze Notification ############################################################
|
||||||
|
|
||||||
|
public void SetNotifi(String Username,String message){
|
||||||
|
|
||||||
|
//Convertiert in Pic Resource in ein Bitmap
|
||||||
|
//BitmapFactory.decodeResource(getResources(), R.drawable.bslogo)
|
||||||
|
|
||||||
|
NotificationCompat.Builder mBuilder =
|
||||||
|
new NotificationCompat.Builder(this)
|
||||||
|
.setSmallIcon(R.drawable.bslogo)
|
||||||
|
.setContentTitle(Username)
|
||||||
|
.setContentText(message)
|
||||||
|
.setAutoCancel(true)
|
||||||
|
//ab hier neuland
|
||||||
|
.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);
|
||||||
|
//neuland ende
|
||||||
|
|
||||||
|
Intent resultIntent = new Intent(this, chatActiviti.class);
|
||||||
|
//versuch ab hier neuland
|
||||||
|
resultIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
|
||||||
|
//neuland ende
|
||||||
|
PendingIntent resultPendingIntent =
|
||||||
|
PendingIntent.getActivity(
|
||||||
|
this.getApplicationContext(),
|
||||||
|
0,
|
||||||
|
resultIntent,
|
||||||
|
PendingIntent.FLAG_UPDATE_CURRENT
|
||||||
|
|
||||||
|
);
|
||||||
|
NotificationManager mNotifyMgr =
|
||||||
|
(NotificationManager) getSystemService(NOTIFICATION_SERVICE);
|
||||||
|
|
||||||
|
|
||||||
|
mBuilder.setContentIntent(resultPendingIntent);
|
||||||
|
|
||||||
|
mNotifyMgr.notify(001, mBuilder.build());
|
||||||
|
}
|
||||||
|
|
||||||
|
//##############################################################################################
|
||||||
|
|
||||||
|
|
||||||
|
//################ Activit abfragen ############################################################
|
||||||
|
public void onResume() {
|
||||||
|
// Log.v("Stuss","Hier nochmals on creat aufrufen");
|
||||||
|
isOnStop = false;
|
||||||
|
|
||||||
|
super.onResume();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onStop(){
|
||||||
|
// Thread t = new Thread(new ConnectionClose());
|
||||||
|
// t.start();
|
||||||
|
|
||||||
|
isOnStop = true;
|
||||||
|
super.onStop();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onDestroy(){
|
||||||
|
Thread t = new Thread(new ConnectionClose());
|
||||||
|
t.start();
|
||||||
|
|
||||||
|
super.onDestroy();
|
||||||
|
}
|
||||||
|
//##############################################################################################
|
||||||
|
|
||||||
|
//################# Lade/Speichere Die Messages ################################################
|
||||||
|
//create a File
|
||||||
|
public void CreateFile(){
|
||||||
|
|
||||||
|
try{
|
||||||
|
|
||||||
|
File pfad = getBaseContext().getFilesDir();
|
||||||
|
|
||||||
|
//Für external Save
|
||||||
|
//File pfad = getBaseContext().getExternalFilesDir(null);
|
||||||
|
|
||||||
|
//Erstelle das File Objekt
|
||||||
|
file = new File(pfad,name+".txt");
|
||||||
|
|
||||||
|
}catch(Exception e){
|
||||||
|
Log.v("Fehler"," Das erstellen/öffnen einer Datei ist Derzeit nicht möglich");
|
||||||
|
}
|
||||||
|
// WriteMessagesfromStorage("\n ich teste weiter mit "+name);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//Internal Storage
|
||||||
|
public void WriteMessagesfromStorage(String message){
|
||||||
|
try{
|
||||||
|
FileOutputStream stream = new FileOutputStream(file,true);
|
||||||
|
|
||||||
|
try{
|
||||||
|
stream.write(message.getBytes());
|
||||||
|
}finally {
|
||||||
|
stream.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Log.v("Status","Text: "+message+" wurde gespeichert." );
|
||||||
|
|
||||||
|
}catch (Exception e){
|
||||||
|
Log.v("Fehler 1 ",e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//Internal storage
|
||||||
|
public void ReadMessageToStorage(){
|
||||||
|
try{
|
||||||
|
|
||||||
|
// Log.v("Status","Verbindung steht 1");
|
||||||
|
int lenght = (int) file.length();
|
||||||
|
|
||||||
|
byte[] bytes = new byte[lenght];
|
||||||
|
|
||||||
|
FileInputStream stream = new FileInputStream(file);
|
||||||
|
|
||||||
|
|
||||||
|
// Log.v("Status","Verbindung steht 2");
|
||||||
|
InputStreamReader in = new InputStreamReader(stream);
|
||||||
|
|
||||||
|
BufferedReader readLn = new BufferedReader(in);
|
||||||
|
|
||||||
|
String line = readLn.readLine();
|
||||||
|
String allLines="";
|
||||||
|
//Build a readLine konstrukt
|
||||||
|
while (line != null) {
|
||||||
|
allLines += line;
|
||||||
|
|
||||||
|
//Funktion für das korrekte anzeigen der Geladenen Nachrichten hier implementieren
|
||||||
|
//---> <---//
|
||||||
|
//String[] splitt = line.split("/");
|
||||||
|
|
||||||
|
// Log.v("Status",line);
|
||||||
|
|
||||||
|
String[] splitt = line.split("/");
|
||||||
|
|
||||||
|
if(splitt.length >1 ) {
|
||||||
|
String[] ArtDate = splitt[1].split("%"); //<------------ im code sind als seperator ? gesetzt // lösung einfach alle löschen und neuen chat speichern !!
|
||||||
|
|
||||||
|
final String message = splitt[0];
|
||||||
|
|
||||||
|
final boolean art = Boolean.valueOf(ArtDate[0]);
|
||||||
|
|
||||||
|
final String datetime = ArtDate[1];
|
||||||
|
|
||||||
|
listView.post(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
chatMessage = new ChatMessageFormat(message, art, datetime);
|
||||||
|
chatMessages.add(chatMessage);
|
||||||
|
adapter.notifyDataSetChanged();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
line = readLn.readLine();
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
stream.close();
|
||||||
|
in.close();
|
||||||
|
|
||||||
|
// Log.v("Local Storage",allLines);
|
||||||
|
|
||||||
|
}catch(Exception e){
|
||||||
|
Log.v("Fehler 2 ",e.getMessage());
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//##############################################################################################
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,59 @@
|
|||||||
|
package beyondsoft.bewoklientenapp;
|
||||||
|
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.support.v7.app.ActionBarActivity;
|
||||||
|
import android.view.Menu;
|
||||||
|
import android.view.MenuItem;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Waldi on 29.04.2016.
|
||||||
|
*/
|
||||||
|
public class kasseActiviti extends ActionBarActivity {
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.kasse);
|
||||||
|
|
||||||
|
/* new Thread(new Runnable() {
|
||||||
|
public void run() {
|
||||||
|
|
||||||
|
// ServerAnbindung a1 = new ServerAnbindung();
|
||||||
|
|
||||||
|
a1.connect();
|
||||||
|
}
|
||||||
|
}).start();
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onCreateOptionsMenu(Menu menu) {
|
||||||
|
// Inflate the menu; this adds items to the action bar if it is present.
|
||||||
|
getMenuInflater().inflate(R.menu.menu_kasse, menu);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
|
// Handle action bar item clicks here. The action bar will
|
||||||
|
// automatically handle clicks on the Home/Up button, so long
|
||||||
|
// as you specify a parent activity in AndroidManifest.xml.
|
||||||
|
int id = item.getItemId();
|
||||||
|
|
||||||
|
//noinspection SimplifiableIfStatement
|
||||||
|
if (id == R.id.action_back) {
|
||||||
|
|
||||||
|
finish();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return super.onOptionsItemSelected(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
BIN
Android/BewoKlientenApp/app/src/main/res/drawable/bslogo.gif
Normal file
|
After Width: | Height: | Size: 11 KiB |
@@ -0,0 +1,13 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:thickness="0dp"
|
||||||
|
android:shape="rectangle">
|
||||||
|
<stroke android:width="3dp"
|
||||||
|
android:color="#4799E8"/>
|
||||||
|
<corners android:radius="5dp" />
|
||||||
|
<gradient
|
||||||
|
android:startColor="#C8C8C8"
|
||||||
|
android:endColor="#FFFFFF"
|
||||||
|
android:type="linear"
|
||||||
|
android:angle="270"/>
|
||||||
|
</shape>
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:thickness="0dp"
|
||||||
|
android:shape="rectangle">
|
||||||
|
<stroke android:width="3dp"
|
||||||
|
android:color="#742324"/>
|
||||||
|
<corners android:radius="0dp" />
|
||||||
|
<gradient
|
||||||
|
android:startColor="#C8C8C8"
|
||||||
|
android:endColor="#FFFFFF"
|
||||||
|
android:type="linear"
|
||||||
|
android:angle="270"/>
|
||||||
|
</shape>
|
||||||
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
BIN
Android/BewoKlientenApp/app/src/main/res/drawable/katze3.jpg
Normal file
|
After Width: | Height: | Size: 107 KiB |
|
After Width: | Height: | Size: 1.0 KiB |
@@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:shape="ring">
|
||||||
|
<solid android:color="#FF9900"/>
|
||||||
|
<fill android:color="#FF9900"/>
|
||||||
|
|
||||||
|
|
||||||
|
</shape>
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin"
|
||||||
|
android:paddingRight="@dimen/activity_horizontal_margin"
|
||||||
|
android:paddingTop="@dimen/activity_vertical_margin"
|
||||||
|
android:paddingBottom="@dimen/activity_vertical_margin" tools:context=".MainActivityKlient">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="Kalender"
|
||||||
|
android:id="@+id/KalenderButton"
|
||||||
|
android:layout_alignParentTop="true"
|
||||||
|
android:layout_alignParentStart="true"
|
||||||
|
android:layout_marginStart="25dp"
|
||||||
|
android:layout_marginTop="50dp"
|
||||||
|
android:layout_marginEnd="25dp"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="Kasse"
|
||||||
|
android:id="@+id/KassenButton"
|
||||||
|
android:layout_below="@+id/KalenderButton"
|
||||||
|
android:layout_alignStart="@+id/KalenderButton"
|
||||||
|
android:layout_marginTop="50dp"
|
||||||
|
android:layout_marginEnd="25dp"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="Chat"
|
||||||
|
android:id="@+id/Chatbutton"
|
||||||
|
android:layout_below="@+id/KassenButton"
|
||||||
|
android:layout_alignStart="@+id/KassenButton"
|
||||||
|
android:layout_marginEnd="25dp"
|
||||||
|
android:layout_marginTop="50dp"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="Logout"
|
||||||
|
android:id="@+id/Logoutbutton"
|
||||||
|
android:layout_below="@+id/Chatbutton"
|
||||||
|
android:layout_alignEnd="@+id/Chatbutton"
|
||||||
|
android:layout_alignStart="@+id/Chatbutton"
|
||||||
|
android:layout_marginTop="50dp"
|
||||||
|
/>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
39
Android/BewoKlientenApp/app/src/main/res/layout/approve.xml
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:orientation="vertical" android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:layout_width="200dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="Überprüfen"
|
||||||
|
android:id="@+id/button"
|
||||||
|
android:layout_gravity="center_horizontal"
|
||||||
|
android:layout_marginTop="59dp"
|
||||||
|
android:layout_below="@+id/textView"
|
||||||
|
android:layout_centerHorizontal="true" />
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:layout_width="200dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textAppearance="?android:attr/textAppearanceLarge"
|
||||||
|
android:text="Large Text"
|
||||||
|
android:id="@+id/textView"
|
||||||
|
android:layout_marginTop="227dp"
|
||||||
|
android:layout_alignParentTop="true"
|
||||||
|
android:layout_alignParentEnd="true"
|
||||||
|
android:layout_alignStart="@+id/button" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="Code:"
|
||||||
|
android:id="@+id/textView2"
|
||||||
|
android:layout_alignBottom="@+id/textView"
|
||||||
|
android:layout_alignParentStart="true"
|
||||||
|
android:layout_alignTop="@+id/textView"
|
||||||
|
android:layout_toStartOf="@+id/textView"
|
||||||
|
android:textSize="30dp"
|
||||||
|
android:textIsSelectable="false" />
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:orientation="vertical" android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
82
Android/BewoKlientenApp/app/src/main/res/layout/chat.xml
Normal file
@@ -0,0 +1,82 @@
|
|||||||
|
<?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:orientation="vertical"
|
||||||
|
android:padding="@dimen/activity_horizontal_margin"
|
||||||
|
android:background="@android:color/holo_orange_dark"
|
||||||
|
>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="0.9">
|
||||||
|
|
||||||
|
<ListView
|
||||||
|
android:id="@+id/list_msg"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_marginBottom="@dimen/activity_horizontal_margin"
|
||||||
|
android:divider="@null"
|
||||||
|
android:listSelector="@android:color/transparent"
|
||||||
|
android:transcriptMode="alwaysScroll" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="22dp"
|
||||||
|
android:layout_weight="0.1"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
>
|
||||||
|
|
||||||
|
<!--Linear Layout: android:layout_height="0dp" //50
|
||||||
|
Edit Text : android:layout_height="match_parent" android:minHeight="75dp"
|
||||||
|
-->
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:layout_width="275dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@drawable/edittext"
|
||||||
|
android:id="@+id/editText"
|
||||||
|
android:hint="@string/hinttxt_chat"
|
||||||
|
android:padding="10dp"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<!-- width -> 300dp heigh -> 60dp android:layout_marginBottom="30dp" android:layout_marginBottom="30dp"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
android:layout_alignParentBottom="true"
|
||||||
|
android:layout_alignParentStart="true"
|
||||||
|
|
||||||
|
match parent
|
||||||
|
|
||||||
|
android:background="@drawable/roundedbutton"
|
||||||
|
|
||||||
|
|
||||||
|
android:layout_alignParentBottom="true"
|
||||||
|
android:layout_alignParentEnd="true"
|
||||||
|
android:layout_below="@+id/ChatText"
|
||||||
|
android:layout_toRightOf="@+id/editText"
|
||||||
|
|
||||||
|
Button height match parent
|
||||||
|
-->
|
||||||
|
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/Chatbutton_name"
|
||||||
|
android:background="@drawable/abc_btn_radio_material"
|
||||||
|
android:id="@+id/Sendebutton"
|
||||||
|
/>
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
<?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="45dp"
|
||||||
|
|
||||||
|
>
|
||||||
|
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="40dp"
|
||||||
|
android:layout_height="40dp"
|
||||||
|
android:id="@+id/PersonalPic"
|
||||||
|
android:layout_alignParentLeft="true"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:layout_marginLeft="2dp"
|
||||||
|
/>
|
||||||
|
<!-- android:src="@drawable/bslogo"
|
||||||
|
|
||||||
|
android:textAppearance="?android:attr/textAppearanceLarge"
|
||||||
|
android:textAllCaps="true"-->
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
|
||||||
|
android:textColor="@android:color/white"
|
||||||
|
android:layout_centerInParent="true"
|
||||||
|
android:id="@+id/PersonalName"
|
||||||
|
android:layout_margin="45dp"
|
||||||
|
|
||||||
|
/>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Merke das design muss noch angepasst werden da der text über dem bild liegt /
|
||||||
|
vorläufig gelöst mit margin dies kann aber nicht die endgültige lösung sein -->
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
<?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">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_alignParentLeft="true"
|
||||||
|
android:background="@drawable/out_message_bg"
|
||||||
|
android:paddingBottom="4dp"
|
||||||
|
android:orientation="vertical"
|
||||||
|
>
|
||||||
|
|
||||||
|
<!-- in diesem bereich noch das datum anzeigen und uhrzeit -->
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:id="@+id/DateOUT"
|
||||||
|
android:textSize="8dp"
|
||||||
|
/>
|
||||||
|
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/txt_msg"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:padding="5dp"
|
||||||
|
android:maxWidth="250dp"
|
||||||
|
android:textColor="@android:color/black" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<!-- padding 10 -->
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
<?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">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:background="@drawable/in_message_bg"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:paddingBottom="4dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:id="@+id/DateIN"
|
||||||
|
android:textSize="8dp"
|
||||||
|
/>
|
||||||
|
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/txt_msg"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:maxWidth="250dp"
|
||||||
|
android:padding="5dp"
|
||||||
|
android:textColor="@android:color/black"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<!-- -->
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
<?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">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:background="@drawable/in_server_message_bg"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:paddingBottom="4dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:id="@+id/DateIN"
|
||||||
|
android:textSize="8dp"
|
||||||
|
/>
|
||||||
|
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/txt_msg"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:maxWidth="250dp"
|
||||||
|
android:padding="5dp"
|
||||||
|
android:textColor="@android:color/black"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:orientation="vertical" android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:orientation="vertical" android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:background="#ffffffff"
|
||||||
|
android:id="@+id/imageView1"
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_height="fill_parent"
|
||||||
|
android:layout_alignParentBottom="true"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:src="@drawable/bslogo"
|
||||||
|
android:scaleType="fitCenter" />
|
||||||
|
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
tools:context=".CalenderActiviti">
|
||||||
|
|
||||||
|
|
||||||
|
<!--<item
|
||||||
|
android:id="@+id/action_settings"
|
||||||
|
android:title="@string/action_settings"
|
||||||
|
android:orderInCategory="100"
|
||||||
|
app:showAsAction="never"
|
||||||
|
/>-->
|
||||||
|
|
||||||
|
<item
|
||||||
|
android:id="@+id/action_back"
|
||||||
|
android:title="@string/action_back"
|
||||||
|
android:orderInCategory="100"
|
||||||
|
app:showAsAction="never"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<!-- <item
|
||||||
|
android:id="@+id/action_Logout"
|
||||||
|
android:title="@string/action_Logout"
|
||||||
|
android:orderInCategory="100"
|
||||||
|
app:showAsAction="never"
|
||||||
|
/>-->
|
||||||
|
|
||||||
|
|
||||||
|
</menu>
|
||||||
28
Android/BewoKlientenApp/app/src/main/res/menu/menu_chat.xml
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
tools:context=".chatActiviti">
|
||||||
|
|
||||||
|
|
||||||
|
<!-- <item
|
||||||
|
android:id="@+id/action_settings"
|
||||||
|
android:title="@string/action_settings"
|
||||||
|
android:orderInCategory="100"
|
||||||
|
app:showAsAction="never"
|
||||||
|
/>-->
|
||||||
|
|
||||||
|
<item
|
||||||
|
android:id="@+id/action_delet_Storage"
|
||||||
|
android:title="@string/Clear"
|
||||||
|
android:orderInCategory="100"
|
||||||
|
/>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- <item
|
||||||
|
android:id="@+id/action_Logout"
|
||||||
|
android:title="@string/action_Logout"
|
||||||
|
android:orderInCategory="100"
|
||||||
|
app:showAsAction="never"
|
||||||
|
/>-->
|
||||||
|
|
||||||
|
</menu>
|
||||||
28
Android/BewoKlientenApp/app/src/main/res/menu/menu_kasse.xml
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
tools:context=".kasseActiviti">
|
||||||
|
|
||||||
|
|
||||||
|
<!--<item
|
||||||
|
android:id="@+id/action_settings"
|
||||||
|
android:title="@string/action_settings"
|
||||||
|
android:orderInCategory="100"
|
||||||
|
app:showAsAction="never"
|
||||||
|
/>-->
|
||||||
|
|
||||||
|
<item
|
||||||
|
android:id="@+id/action_back"
|
||||||
|
android:title="@string/action_back"
|
||||||
|
android:orderInCategory="100"
|
||||||
|
app:showAsAction="never"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<!-- <item
|
||||||
|
android:id="@+id/action_Logout"
|
||||||
|
android:title="@string/action_Logout"
|
||||||
|
android:orderInCategory="100"
|
||||||
|
app:showAsAction="never"
|
||||||
|
/>-->
|
||||||
|
|
||||||
|
</menu>
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
tools:context=".MainActivityKlient">
|
||||||
|
|
||||||
|
|
||||||
|
<!--<item Settings zum einstellen villeicht
|
||||||
|
android:id="@+id/action_settings"
|
||||||
|
android:title="@string/action_settings"
|
||||||
|
android:orderInCategory="100"
|
||||||
|
app:showAsAction="never"
|
||||||
|
/>-->
|
||||||
|
|
||||||
|
<item
|
||||||
|
android:id="@+id/action_Logout"
|
||||||
|
android:title="@string/action_Logout"
|
||||||
|
android:orderInCategory="100"
|
||||||
|
app:showAsAction="never"
|
||||||
|
/>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</menu>
|
||||||
|
After Width: | Height: | Size: 3.3 KiB |
|
After Width: | Height: | Size: 2.2 KiB |
|
After Width: | Height: | Size: 4.7 KiB |
|
After Width: | Height: | Size: 7.5 KiB |
@@ -0,0 +1,6 @@
|
|||||||
|
<resources>
|
||||||
|
<!-- Example customization of dimensions originally defined in res/values/dimens.xml
|
||||||
|
(such as screen margins) for screens with more than 820dp of available width. This
|
||||||
|
would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively). -->
|
||||||
|
<dimen name="activity_horizontal_margin">64dp</dimen>
|
||||||
|
</resources>
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
<resources>
|
||||||
|
<!-- Default screen margins, per the Android Design guidelines. -->
|
||||||
|
<dimen name="activity_horizontal_margin">16dp</dimen>
|
||||||
|
<dimen name="activity_vertical_margin">16dp</dimen>
|
||||||
|
</resources>
|
||||||
14
Android/BewoKlientenApp/app/src/main/res/values/strings.xml
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
<resources>
|
||||||
|
<string name="app_name">BewoKlientenApp</string>
|
||||||
|
<string name="action_Logout">Logout</string>
|
||||||
|
<string name="action_back">Zurück</string>
|
||||||
|
<string name="action_settings">Settings</string>
|
||||||
|
|
||||||
|
<string name="message_hint">Sag Was</string>
|
||||||
|
<string name="send">Senderon</string>
|
||||||
|
|
||||||
|
<string name="Chatbutton_name" >S</string>
|
||||||
|
<string name="hinttxt_chat">Nachricht Schreiben</string>
|
||||||
|
|
||||||
|
<string name="Clear">Lösche Konversation</string>
|
||||||
|
</resources>
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
<resources>
|
||||||
|
|
||||||
|
<!-- Base application theme. -->
|
||||||
|
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
|
||||||
|
<!-- Customize your theme here. -->
|
||||||
|
</style>
|
||||||
|
|
||||||
|
</resources>
|
||||||
19
Android/BewoKlientenApp/build.gradle
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||||
|
|
||||||
|
buildscript {
|
||||||
|
repositories {
|
||||||
|
jcenter()
|
||||||
|
}
|
||||||
|
dependencies {
|
||||||
|
classpath 'com.android.tools.build:gradle:2.1.0'
|
||||||
|
// NOTE: Do not place your application dependencies here; they belong
|
||||||
|
// in the individual module build.gradle files
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
allprojects {
|
||||||
|
repositories {
|
||||||
|
jcenter()
|
||||||
|
}
|
||||||
|
}
|
||||||
18
Android/BewoKlientenApp/gradle.properties
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
# Project-wide Gradle settings.
|
||||||
|
|
||||||
|
# IDE (e.g. Android Studio) users:
|
||||||
|
# Gradle settings configured through the IDE *will override*
|
||||||
|
# any settings specified in this file.
|
||||||
|
|
||||||
|
# For more details on how to configure your build environment visit
|
||||||
|
# http://www.gradle.org/docs/current/userguide/build_environment.html
|
||||||
|
|
||||||
|
# Specifies the JVM arguments used for the daemon process.
|
||||||
|
# The setting is particularly useful for tweaking memory settings.
|
||||||
|
# Default value: -Xmx10248m -XX:MaxPermSize=256m
|
||||||
|
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
|
||||||
|
|
||||||
|
# When configured, Gradle will run in incubating parallel mode.
|
||||||
|
# This option should only be used with decoupled projects. More details, visit
|
||||||
|
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
|
||||||
|
# org.gradle.parallel=true
|
||||||
BIN
Android/BewoKlientenApp/gradle/wrapper/gradle-wrapper.jar
vendored
Normal file
6
Android/BewoKlientenApp/gradle/wrapper/gradle-wrapper.properties
vendored
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
#Mon May 09 08:53:20 CEST 2016
|
||||||
|
distributionBase=GRADLE_USER_HOME
|
||||||
|
distributionPath=wrapper/dists
|
||||||
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
zipStorePath=wrapper/dists
|
||||||
|
distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip
|
||||||
164
Android/BewoKlientenApp/gradlew
vendored
Normal file
@@ -0,0 +1,164 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
##############################################################################
|
||||||
|
##
|
||||||
|
## Gradle start up script for UN*X
|
||||||
|
##
|
||||||
|
##############################################################################
|
||||||
|
|
||||||
|
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
|
DEFAULT_JVM_OPTS=""
|
||||||
|
|
||||||
|
APP_NAME="Gradle"
|
||||||
|
APP_BASE_NAME=`basename "$0"`
|
||||||
|
|
||||||
|
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||||
|
MAX_FD="maximum"
|
||||||
|
|
||||||
|
warn ( ) {
|
||||||
|
echo "$*"
|
||||||
|
}
|
||||||
|
|
||||||
|
die ( ) {
|
||||||
|
echo
|
||||||
|
echo "$*"
|
||||||
|
echo
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
# OS specific support (must be 'true' or 'false').
|
||||||
|
cygwin=false
|
||||||
|
msys=false
|
||||||
|
darwin=false
|
||||||
|
case "`uname`" in
|
||||||
|
CYGWIN* )
|
||||||
|
cygwin=true
|
||||||
|
;;
|
||||||
|
Darwin* )
|
||||||
|
darwin=true
|
||||||
|
;;
|
||||||
|
MINGW* )
|
||||||
|
msys=true
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# For Cygwin, ensure paths are in UNIX format before anything is touched.
|
||||||
|
if $cygwin ; then
|
||||||
|
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Attempt to set APP_HOME
|
||||||
|
# Resolve links: $0 may be a link
|
||||||
|
PRG="$0"
|
||||||
|
# Need this for relative symlinks.
|
||||||
|
while [ -h "$PRG" ] ; do
|
||||||
|
ls=`ls -ld "$PRG"`
|
||||||
|
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||||
|
if expr "$link" : '/.*' > /dev/null; then
|
||||||
|
PRG="$link"
|
||||||
|
else
|
||||||
|
PRG=`dirname "$PRG"`"/$link"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
SAVED="`pwd`"
|
||||||
|
cd "`dirname \"$PRG\"`/" >&-
|
||||||
|
APP_HOME="`pwd -P`"
|
||||||
|
cd "$SAVED" >&-
|
||||||
|
|
||||||
|
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||||
|
|
||||||
|
# Determine the Java command to use to start the JVM.
|
||||||
|
if [ -n "$JAVA_HOME" ] ; then
|
||||||
|
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||||
|
# IBM's JDK on AIX uses strange locations for the executables
|
||||||
|
JAVACMD="$JAVA_HOME/jre/sh/java"
|
||||||
|
else
|
||||||
|
JAVACMD="$JAVA_HOME/bin/java"
|
||||||
|
fi
|
||||||
|
if [ ! -x "$JAVACMD" ] ; then
|
||||||
|
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
||||||
|
|
||||||
|
Please set the JAVA_HOME variable in your environment to match the
|
||||||
|
location of your Java installation."
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
JAVACMD="java"
|
||||||
|
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||||
|
|
||||||
|
Please set the JAVA_HOME variable in your environment to match the
|
||||||
|
location of your Java installation."
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Increase the maximum file descriptors if we can.
|
||||||
|
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
|
||||||
|
MAX_FD_LIMIT=`ulimit -H -n`
|
||||||
|
if [ $? -eq 0 ] ; then
|
||||||
|
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
|
||||||
|
MAX_FD="$MAX_FD_LIMIT"
|
||||||
|
fi
|
||||||
|
ulimit -n $MAX_FD
|
||||||
|
if [ $? -ne 0 ] ; then
|
||||||
|
warn "Could not set maximum file descriptor limit: $MAX_FD"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# For Darwin, add options to specify how the application appears in the dock
|
||||||
|
if $darwin; then
|
||||||
|
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
||||||
|
fi
|
||||||
|
|
||||||
|
# For Cygwin, switch paths to Windows format before running java
|
||||||
|
if $cygwin ; then
|
||||||
|
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
||||||
|
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
||||||
|
|
||||||
|
# We build the pattern for arguments to be converted via cygpath
|
||||||
|
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
|
||||||
|
SEP=""
|
||||||
|
for dir in $ROOTDIRSRAW ; do
|
||||||
|
ROOTDIRS="$ROOTDIRS$SEP$dir"
|
||||||
|
SEP="|"
|
||||||
|
done
|
||||||
|
OURCYGPATTERN="(^($ROOTDIRS))"
|
||||||
|
# Add a user-defined pattern to the cygpath arguments
|
||||||
|
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
|
||||||
|
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
|
||||||
|
fi
|
||||||
|
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||||
|
i=0
|
||||||
|
for arg in "$@" ; do
|
||||||
|
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
|
||||||
|
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
|
||||||
|
|
||||||
|
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
|
||||||
|
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
|
||||||
|
else
|
||||||
|
eval `echo args$i`="\"$arg\""
|
||||||
|
fi
|
||||||
|
i=$((i+1))
|
||||||
|
done
|
||||||
|
case $i in
|
||||||
|
(0) set -- ;;
|
||||||
|
(1) set -- "$args0" ;;
|
||||||
|
(2) set -- "$args0" "$args1" ;;
|
||||||
|
(3) set -- "$args0" "$args1" "$args2" ;;
|
||||||
|
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
||||||
|
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
||||||
|
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
||||||
|
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
||||||
|
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
||||||
|
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
|
||||||
|
function splitJvmOpts() {
|
||||||
|
JVM_OPTS=("$@")
|
||||||
|
}
|
||||||
|
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
|
||||||
|
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
|
||||||
|
|
||||||
|
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
|
||||||
90
Android/BewoKlientenApp/gradlew.bat
vendored
Normal file
@@ -0,0 +1,90 @@
|
|||||||
|
@if "%DEBUG%" == "" @echo off
|
||||||
|
@rem ##########################################################################
|
||||||
|
@rem
|
||||||
|
@rem Gradle startup script for Windows
|
||||||
|
@rem
|
||||||
|
@rem ##########################################################################
|
||||||
|
|
||||||
|
@rem Set local scope for the variables with windows NT shell
|
||||||
|
if "%OS%"=="Windows_NT" setlocal
|
||||||
|
|
||||||
|
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
|
set DEFAULT_JVM_OPTS=
|
||||||
|
|
||||||
|
set DIRNAME=%~dp0
|
||||||
|
if "%DIRNAME%" == "" set DIRNAME=.
|
||||||
|
set APP_BASE_NAME=%~n0
|
||||||
|
set APP_HOME=%DIRNAME%
|
||||||
|
|
||||||
|
@rem Find java.exe
|
||||||
|
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||||
|
|
||||||
|
set JAVA_EXE=java.exe
|
||||||
|
%JAVA_EXE% -version >NUL 2>&1
|
||||||
|
if "%ERRORLEVEL%" == "0" goto init
|
||||||
|
|
||||||
|
echo.
|
||||||
|
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||||
|
echo.
|
||||||
|
echo Please set the JAVA_HOME variable in your environment to match the
|
||||||
|
echo location of your Java installation.
|
||||||
|
|
||||||
|
goto fail
|
||||||
|
|
||||||
|
:findJavaFromJavaHome
|
||||||
|
set JAVA_HOME=%JAVA_HOME:"=%
|
||||||
|
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||||
|
|
||||||
|
if exist "%JAVA_EXE%" goto init
|
||||||
|
|
||||||
|
echo.
|
||||||
|
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||||
|
echo.
|
||||||
|
echo Please set the JAVA_HOME variable in your environment to match the
|
||||||
|
echo location of your Java installation.
|
||||||
|
|
||||||
|
goto fail
|
||||||
|
|
||||||
|
:init
|
||||||
|
@rem Get command-line arguments, handling Windowz variants
|
||||||
|
|
||||||
|
if not "%OS%" == "Windows_NT" goto win9xME_args
|
||||||
|
if "%@eval[2+2]" == "4" goto 4NT_args
|
||||||
|
|
||||||
|
:win9xME_args
|
||||||
|
@rem Slurp the command line arguments.
|
||||||
|
set CMD_LINE_ARGS=
|
||||||
|
set _SKIP=2
|
||||||
|
|
||||||
|
:win9xME_args_slurp
|
||||||
|
if "x%~1" == "x" goto execute
|
||||||
|
|
||||||
|
set CMD_LINE_ARGS=%*
|
||||||
|
goto execute
|
||||||
|
|
||||||
|
:4NT_args
|
||||||
|
@rem Get arguments from the 4NT Shell from JP Software
|
||||||
|
set CMD_LINE_ARGS=%$
|
||||||
|
|
||||||
|
:execute
|
||||||
|
@rem Setup the command line
|
||||||
|
|
||||||
|
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||||
|
|
||||||
|
@rem Execute Gradle
|
||||||
|
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
|
||||||
|
|
||||||
|
:end
|
||||||
|
@rem End local scope for the variables with windows NT shell
|
||||||
|
if "%ERRORLEVEL%"=="0" goto mainEnd
|
||||||
|
|
||||||
|
:fail
|
||||||
|
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||||
|
rem the _cmd.exe /c_ return code!
|
||||||
|
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
||||||
|
exit /b 1
|
||||||
|
|
||||||
|
:mainEnd
|
||||||
|
if "%OS%"=="Windows_NT" endlocal
|
||||||
|
|
||||||
|
:omega
|
||||||
1
Android/BewoKlientenApp/settings.gradle
Normal file
@@ -0,0 +1 @@
|
|||||||
|
include ':app'
|
||||||
6
Android/BewoMitarbeiterApp/.gitignore
vendored
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
.gradle
|
||||||
|
/local.properties
|
||||||
|
/.idea/workspace.xml
|
||||||
|
/.idea/libraries
|
||||||
|
.DS_Store
|
||||||
|
/build
|
||||||
1
Android/BewoMitarbeiterApp/.idea/.name
generated
Normal file
@@ -0,0 +1 @@
|
|||||||
|
BewoMitarbeiterApp
|
||||||
22
Android/BewoMitarbeiterApp/.idea/compiler.xml
generated
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="CompilerConfiguration">
|
||||||
|
<resourceExtensions />
|
||||||
|
<wildcardResourcePatterns>
|
||||||
|
<entry name="!?*.java" />
|
||||||
|
<entry name="!?*.form" />
|
||||||
|
<entry name="!?*.class" />
|
||||||
|
<entry name="!?*.groovy" />
|
||||||
|
<entry name="!?*.scala" />
|
||||||
|
<entry name="!?*.flex" />
|
||||||
|
<entry name="!?*.kt" />
|
||||||
|
<entry name="!?*.clj" />
|
||||||
|
<entry name="!?*.aj" />
|
||||||
|
</wildcardResourcePatterns>
|
||||||
|
<annotationProcessing>
|
||||||
|
<profile default="true" name="Default" enabled="false">
|
||||||
|
<processorPath useClasspath="true" />
|
||||||
|
</profile>
|
||||||
|
</annotationProcessing>
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
3
Android/BewoMitarbeiterApp/.idea/copyright/profiles_settings.xml
generated
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
<component name="CopyrightManager">
|
||||||
|
<settings default="" />
|
||||||
|
</component>
|
||||||
6
Android/BewoMitarbeiterApp/.idea/encodings.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="Encoding">
|
||||||
|
<file url="PROJECT" charset="UTF-8" />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
26
Android/BewoMitarbeiterApp/.idea/gradle.xml
generated
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="GradleSettings">
|
||||||
|
<option name="linkedExternalProjectsSettings">
|
||||||
|
<GradleProjectSettings>
|
||||||
|
<option name="distributionType" value="LOCAL" />
|
||||||
|
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||||
|
<option name="gradleHome" value="C:\Program Files\Android\Android Studio\gradle\gradle-2.10" />
|
||||||
|
<option name="modules">
|
||||||
|
<set>
|
||||||
|
<option value="$PROJECT_DIR$" />
|
||||||
|
<option value="$PROJECT_DIR$/app" />
|
||||||
|
<option value="$PROJECT_DIR$/volley" />
|
||||||
|
</set>
|
||||||
|
</option>
|
||||||
|
<option name="myModules">
|
||||||
|
<set>
|
||||||
|
<option value="$PROJECT_DIR$" />
|
||||||
|
<option value="$PROJECT_DIR$/app" />
|
||||||
|
<option value="$PROJECT_DIR$/volley" />
|
||||||
|
</set>
|
||||||
|
</option>
|
||||||
|
</GradleProjectSettings>
|
||||||
|
</option>
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
49
Android/BewoMitarbeiterApp/.idea/misc.xml
generated
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="EntryPointsManager">
|
||||||
|
<entry_points version="2.0" />
|
||||||
|
</component>
|
||||||
|
<component name="NullableNotNullManager">
|
||||||
|
<option name="myDefaultNullable" value="android.support.annotation.Nullable" />
|
||||||
|
<option name="myDefaultNotNull" value="android.support.annotation.NonNull" />
|
||||||
|
<option name="myNullables">
|
||||||
|
<value>
|
||||||
|
<list size="4">
|
||||||
|
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.Nullable" />
|
||||||
|
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nullable" />
|
||||||
|
<item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.Nullable" />
|
||||||
|
<item index="3" class="java.lang.String" itemvalue="android.support.annotation.Nullable" />
|
||||||
|
</list>
|
||||||
|
</value>
|
||||||
|
</option>
|
||||||
|
<option name="myNotNulls">
|
||||||
|
<value>
|
||||||
|
<list size="4">
|
||||||
|
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.NotNull" />
|
||||||
|
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nonnull" />
|
||||||
|
<item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.NonNull" />
|
||||||
|
<item index="3" class="java.lang.String" itemvalue="android.support.annotation.NonNull" />
|
||||||
|
</list>
|
||||||
|
</value>
|
||||||
|
</option>
|
||||||
|
</component>
|
||||||
|
<component name="ProjectLevelVcsManager" settingsEditedManually="false">
|
||||||
|
<OptionsSetting value="true" id="Add" />
|
||||||
|
<OptionsSetting value="true" id="Remove" />
|
||||||
|
<OptionsSetting value="true" id="Checkout" />
|
||||||
|
<OptionsSetting value="true" id="Update" />
|
||||||
|
<OptionsSetting value="true" id="Status" />
|
||||||
|
<OptionsSetting value="true" id="Edit" />
|
||||||
|
<ConfirmationsSetting value="0" id="Add" />
|
||||||
|
<ConfirmationsSetting value="0" id="Remove" />
|
||||||
|
</component>
|
||||||
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.7" project-jdk-type="JavaSDK">
|
||||||
|
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||||
|
</component>
|
||||||
|
<component name="ProjectType">
|
||||||
|
<option name="id" value="Android" />
|
||||||
|
</component>
|
||||||
|
<component name="SvnBranchConfigurationManager">
|
||||||
|
<option name="mySupportsUserInfoFilter" value="true" />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
10
Android/BewoMitarbeiterApp/.idea/modules.xml
generated
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="ProjectModuleManager">
|
||||||
|
<modules>
|
||||||
|
<module fileurl="file://$PROJECT_DIR$/BewoMitarbeiterApp.iml" filepath="$PROJECT_DIR$/BewoMitarbeiterApp.iml" />
|
||||||
|
<module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" />
|
||||||
|
<module fileurl="file://$PROJECT_DIR$/volley/volley.iml" filepath="$PROJECT_DIR$/volley/volley.iml" />
|
||||||
|
</modules>
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
12
Android/BewoMitarbeiterApp/.idea/runConfigurations.xml
generated
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="RunConfigurationProducerService">
|
||||||
|
<option name="ignoredProducers">
|
||||||
|
<set>
|
||||||
|
<option value="org.jetbrains.plugins.gradle.execution.test.runner.AllInPackageGradleConfigurationProducer" />
|
||||||
|
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestClassGradleConfigurationProducer" />
|
||||||
|
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestMethodGradleConfigurationProducer" />
|
||||||
|
</set>
|
||||||
|
</option>
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
6
Android/BewoMitarbeiterApp/.idea/vcs.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="VcsDirectoryMappings">
|
||||||
|
<mapping directory="" vcs="svn" />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
19
Android/BewoMitarbeiterApp/BewoMitarbeiterApp.iml
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<module external.linked.project.id="BewoMitarbeiterApp" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" external.system.module.group="" external.system.module.version="unspecified" type="JAVA_MODULE" version="4">
|
||||||
|
<component name="FacetManager">
|
||||||
|
<facet type="java-gradle" name="Java-Gradle">
|
||||||
|
<configuration>
|
||||||
|
<option name="BUILD_FOLDER_PATH" value="$MODULE_DIR$/build" />
|
||||||
|
<option name="BUILDABLE" value="false" />
|
||||||
|
</configuration>
|
||||||
|
</facet>
|
||||||
|
</component>
|
||||||
|
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-compiler-output="true">
|
||||||
|
<exclude-output />
|
||||||
|
<content url="file://$MODULE_DIR$">
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/.gradle" />
|
||||||
|
</content>
|
||||||
|
<orderEntry type="inheritedJdk" />
|
||||||
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
|
</component>
|
||||||
|
</module>
|
||||||
1
Android/BewoMitarbeiterApp/app/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
/build
|
||||||
123
Android/BewoMitarbeiterApp/app/app.iml
Normal file
@@ -0,0 +1,123 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<module external.linked.project.id=":app" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/.." external.system.id="GRADLE" external.system.module.group="BewoMitarbeiterApp" external.system.module.version="unspecified" type="JAVA_MODULE" version="4">
|
||||||
|
<component name="FacetManager">
|
||||||
|
<facet type="android-gradle" name="Android-Gradle">
|
||||||
|
<configuration>
|
||||||
|
<option name="GRADLE_PROJECT_PATH" value=":app" />
|
||||||
|
</configuration>
|
||||||
|
</facet>
|
||||||
|
<facet type="android" name="Android">
|
||||||
|
<configuration>
|
||||||
|
<option name="SELECTED_BUILD_VARIANT" value="debug" />
|
||||||
|
<option name="SELECTED_TEST_ARTIFACT" value="_android_test_" />
|
||||||
|
<option name="ASSEMBLE_TASK_NAME" value="assembleDebug" />
|
||||||
|
<option name="COMPILE_JAVA_TASK_NAME" value="compileDebugSources" />
|
||||||
|
<afterSyncTasks>
|
||||||
|
<task>generateDebugSources</task>
|
||||||
|
</afterSyncTasks>
|
||||||
|
<option name="ALLOW_USER_CONFIGURATION" value="false" />
|
||||||
|
<option name="MANIFEST_FILE_RELATIVE_PATH" value="/src/main/AndroidManifest.xml" />
|
||||||
|
<option name="RES_FOLDER_RELATIVE_PATH" value="/src/main/res" />
|
||||||
|
<option name="RES_FOLDERS_RELATIVE_PATH" value="file://$MODULE_DIR$/src/main/res" />
|
||||||
|
<option name="ASSETS_FOLDER_RELATIVE_PATH" value="/src/main/assets" />
|
||||||
|
</configuration>
|
||||||
|
</facet>
|
||||||
|
</component>
|
||||||
|
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-compiler-output="false">
|
||||||
|
<output url="file://$MODULE_DIR$/build/intermediates/classes/debug" />
|
||||||
|
<output-test url="file://$MODULE_DIR$/build/intermediates/classes/test/debug" />
|
||||||
|
<exclude-output />
|
||||||
|
<content url="file://$MODULE_DIR$">
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/debug" isTestSource="false" generated="true" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/debug" isTestSource="false" generated="true" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/debug" isTestSource="false" generated="true" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/debug" isTestSource="false" generated="true" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/debug" type="java-resource" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/debug" type="java-resource" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/androidTest/debug" isTestSource="true" generated="true" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/androidTest/debug" isTestSource="true" generated="true" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/androidTest/debug" isTestSource="true" generated="true" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/androidTest/debug" isTestSource="true" generated="true" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/androidTest/debug" type="java-test-resource" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/androidTest/debug" type="java-test-resource" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/src/debug/res" type="java-resource" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/src/debug/resources" type="java-resource" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/src/debug/assets" type="java-resource" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/src/debug/aidl" isTestSource="false" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/src/debug/java" isTestSource="false" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/src/debug/jni" isTestSource="false" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/src/debug/rs" isTestSource="false" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/src/debug/shaders" isTestSource="false" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/res" type="java-test-resource" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/resources" type="java-test-resource" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/assets" type="java-test-resource" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/aidl" isTestSource="true" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/java" isTestSource="true" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/jni" isTestSource="true" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/rs" isTestSource="true" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/shaders" isTestSource="true" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/src/main/res" type="java-resource" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/src/main/assets" type="java-resource" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/src/main/aidl" isTestSource="false" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
|
||||||
|
<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" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/aidl" isTestSource="true" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" />
|
||||||
|
<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" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/assets" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/blame" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/builds" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/bundles" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dependency-cache" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/appcompat-v7/21.0.3/jars" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-v4/21.0.3/jars" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental-classes" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental-runtime-classes" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental-safeguard" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental-verifier" />
|
||||||
|
<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/reload-dex" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/restart-dex" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/shaders" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/transforms" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/build/outputs" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/build/tmp" />
|
||||||
|
</content>
|
||||||
|
<orderEntry type="jdk" jdkName="Android API 21 Platform" jdkType="Android SDK" />
|
||||||
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
|
<orderEntry type="library" exported="" name="appcompat-v7-21.0.3" level="project" />
|
||||||
|
<orderEntry type="library" exported="" name="ksoap2-android-assembly-3.6.0-jar-with-dependencies" level="project" />
|
||||||
|
<orderEntry type="library" exported="" name="gson-2.6.2" level="project" />
|
||||||
|
<orderEntry type="library" exported="" name="support-v4-21.0.3" level="project" />
|
||||||
|
<orderEntry type="library" exported="" name="support-annotations-21.0.3" level="project" />
|
||||||
|
<orderEntry type="library" exported="" name="commons-lang3-3.3.2" level="project" />
|
||||||
|
<orderEntry type="library" exported="" name="commons-io-1.3.2" level="project" />
|
||||||
|
<orderEntry type="library" exported="" name="robospice-1.4.14" level="project" />
|
||||||
|
<orderEntry type="library" exported="" name="robospice-cache-1.4.14" level="project" />
|
||||||
|
<orderEntry type="module" module-name="volley" exported="" />
|
||||||
|
<orderEntry type="library" exported="" name="android-android-21" level="project" />
|
||||||
|
</component>
|
||||||
|
</module>
|
||||||
29
Android/BewoMitarbeiterApp/app/build.gradle
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
apply plugin: 'com.android.application'
|
||||||
|
|
||||||
|
android {
|
||||||
|
compileSdkVersion 21
|
||||||
|
buildToolsVersion '23.0.2'
|
||||||
|
|
||||||
|
defaultConfig {
|
||||||
|
applicationId "beyondsoft.bewomitarbeiterapp"
|
||||||
|
minSdkVersion 18
|
||||||
|
targetSdkVersion 21
|
||||||
|
versionCode 1
|
||||||
|
versionName "1.0"
|
||||||
|
}
|
||||||
|
buildTypes {
|
||||||
|
release {
|
||||||
|
minifyEnabled false
|
||||||
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
//compile fileTree(dir: 'libs', include: ['*.jar'])
|
||||||
|
compile 'com.android.support:appcompat-v7:21.0.3'
|
||||||
|
compile files('libs/gson-2.6.2.jar')
|
||||||
|
compile files('libs/ksoap2-android-assembly-3.6.0-jar-with-dependencies.jar')
|
||||||
|
compile 'com.octo.android.robospice:robospice:1.4.14'
|
||||||
|
compile project(":volley")
|
||||||
|
}
|
||||||
17
Android/BewoMitarbeiterApp/app/proguard-rules.pro
vendored
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
# Add project specific ProGuard rules here.
|
||||||
|
# By default, the flags in this file are appended to flags specified
|
||||||
|
# in C:\Users\bib\AppData\Local\Android\sdk/tools/proguard/proguard-android.txt
|
||||||
|
# You can edit the include path and order by changing the proguardFiles
|
||||||
|
# directive in build.gradle.
|
||||||
|
#
|
||||||
|
# For more details, see
|
||||||
|
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||||
|
|
||||||
|
# Add any project specific keep options here:
|
||||||
|
|
||||||
|
# If your project uses WebView with JS, uncomment the following
|
||||||
|
# and specify the fully qualified class name to the JavaScript interface
|
||||||
|
# class:
|
||||||
|
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||||
|
# public *;
|
||||||
|
#}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package beyondsoft.bewomitarbeiterapp;
|
||||||
|
|
||||||
|
import android.app.Application;
|
||||||
|
import android.test.ApplicationTestCase;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a>
|
||||||
|
*/
|
||||||
|
public class ApplicationTest extends ApplicationTestCase<Application> {
|
||||||
|
public ApplicationTest() {
|
||||||
|
super(Application.class);
|
||||||
|
}
|
||||||
|
}
|
||||||
73
Android/BewoMitarbeiterApp/app/src/main/AndroidManifest.xml
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
package="beyondsoft.bewomitarbeiterapp">
|
||||||
|
|
||||||
|
<uses-permission android:name="android.permission.INTERNET"/>
|
||||||
|
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
|
||||||
|
|
||||||
|
<application
|
||||||
|
android:allowBackup="true"
|
||||||
|
android:icon="@mipmap/ic_launcher"
|
||||||
|
android:label="@string/app_name"
|
||||||
|
android:theme="@style/AppTheme">
|
||||||
|
<activity
|
||||||
|
android:name=".SplashScreenActivity"
|
||||||
|
android:theme="@android:style/Theme.NoTitleBar">
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.MAIN"/>
|
||||||
|
|
||||||
|
<category android:name="android.intent.category.LAUNCHER"/>
|
||||||
|
</intent-filter>
|
||||||
|
</activity>
|
||||||
|
<activity
|
||||||
|
android:name=".MainActivityMitarbeiter"
|
||||||
|
android:label="@string/app_name_haupt">
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.activity_main_activity_mitarbeiter"/>
|
||||||
|
|
||||||
|
<category android:name="android.intent.category.DEFAULT"/>
|
||||||
|
</intent-filter>
|
||||||
|
</activity>
|
||||||
|
<activity
|
||||||
|
android:name=".KontaktChatActivity"
|
||||||
|
android:label="@string/app_name_kontakt">
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.kontakt_list_chat"/>
|
||||||
|
|
||||||
|
<category android:name="android.intent.category.DEFAULT"/>
|
||||||
|
</intent-filter>
|
||||||
|
</activity>
|
||||||
|
<activity
|
||||||
|
android:name=".WebdokuActivity"
|
||||||
|
android:label="@string/app_name">
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.webdoku"/>
|
||||||
|
|
||||||
|
<category android:name="android.intent.category.DEFAULT"/>
|
||||||
|
</intent-filter>
|
||||||
|
</activity>
|
||||||
|
<activity
|
||||||
|
android:name=".ChatActivity"
|
||||||
|
android:label="@string/app_name_chat">
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.chat"/>
|
||||||
|
|
||||||
|
<category android:name="android.intent.category.DEFAULT"/>
|
||||||
|
</intent-filter>
|
||||||
|
</activity>
|
||||||
|
|
||||||
|
<!-- android:noHistory="true" -->
|
||||||
|
|
||||||
|
<activity
|
||||||
|
android:name=".LoginActivity"
|
||||||
|
android:label="@string/title_activity_login">
|
||||||
|
</activity>
|
||||||
|
<activity android:name=".TokenActivity">
|
||||||
|
</activity>
|
||||||
|
|
||||||
|
<service
|
||||||
|
android:name="com.octo.android.robospice.UncachedSpiceService"
|
||||||
|
android:exported="false" />
|
||||||
|
</application>
|
||||||
|
|
||||||
|
</manifest>
|
||||||
@@ -0,0 +1,750 @@
|
|||||||
|
package beyondsoft.bewomitarbeiterapp;
|
||||||
|
|
||||||
|
import android.app.Activity;
|
||||||
|
import android.app.Notification;
|
||||||
|
import android.app.NotificationManager;
|
||||||
|
import android.app.PendingIntent;
|
||||||
|
import android.content.ClipData;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.graphics.Bitmap;
|
||||||
|
import android.graphics.BitmapFactory;
|
||||||
|
import android.graphics.Canvas;
|
||||||
|
import android.graphics.Color;
|
||||||
|
import android.graphics.Paint;
|
||||||
|
import android.graphics.PorterDuff;
|
||||||
|
import android.graphics.PorterDuffXfermode;
|
||||||
|
import android.graphics.Rect;
|
||||||
|
import android.graphics.RectF;
|
||||||
|
import android.graphics.drawable.BitmapDrawable;
|
||||||
|
import android.graphics.drawable.Drawable;
|
||||||
|
import android.os.AsyncTask;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.os.Message;
|
||||||
|
import android.support.v4.app.NotificationCompat;
|
||||||
|
import android.support.v4.content.IntentCompat;
|
||||||
|
import android.support.v7.app.ActionBar;
|
||||||
|
import android.support.v7.app.ActionBarActivity;
|
||||||
|
import android.text.Html;
|
||||||
|
import android.text.format.DateFormat;
|
||||||
|
import android.text.method.ScrollingMovementMethod;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.view.KeyEvent;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.Menu;
|
||||||
|
import android.view.MenuItem;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.ArrayAdapter;
|
||||||
|
import android.widget.Button;
|
||||||
|
import android.widget.EditText;
|
||||||
|
import android.widget.ImageView;
|
||||||
|
import android.widget.ListView;
|
||||||
|
import android.widget.RelativeLayout;
|
||||||
|
import android.widget.TextView;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import java.io.BufferedReader;
|
||||||
|
import java.io.BufferedWriter;
|
||||||
|
import java.io.ByteArrayOutputStream;
|
||||||
|
import java.io.DataOutputStream;
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.FileInputStream;
|
||||||
|
import java.io.FileOutputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.io.InputStreamReader;
|
||||||
|
import java.io.OutputStream;
|
||||||
|
import java.io.OutputStreamWriter;
|
||||||
|
import java.io.PrintWriter;
|
||||||
|
import java.net.DatagramPacket;
|
||||||
|
import java.net.DatagramSocket;
|
||||||
|
import java.net.InetAddress;
|
||||||
|
import java.net.InetSocketAddress;
|
||||||
|
import java.net.Socket;
|
||||||
|
import java.net.SocketAddress;
|
||||||
|
import java.net.UnknownHostException;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Calendar;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Locale;
|
||||||
|
import java.util.TimeZone;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by bib on 03.05.2016.
|
||||||
|
*/
|
||||||
|
public class ChatActiviti extends ActionBarActivity{
|
||||||
|
|
||||||
|
//View Variablen
|
||||||
|
protected TextView chat;
|
||||||
|
protected EditText text;
|
||||||
|
protected Button senden;
|
||||||
|
|
||||||
|
//Server Variablen
|
||||||
|
public static Socket socket;
|
||||||
|
protected static final String dstAddress = "192.168.1.115"; //10.0.2.2"
|
||||||
|
protected static final int dstPort = 5000;
|
||||||
|
DataOutputStream st;
|
||||||
|
|
||||||
|
String SaveCompletteMS;
|
||||||
|
|
||||||
|
BufferedReader in = null;
|
||||||
|
|
||||||
|
//Design View
|
||||||
|
protected ListView listView;
|
||||||
|
protected boolean isMe = true;
|
||||||
|
protected List<ChatMessageFormat> chatMessages;
|
||||||
|
protected ArrayAdapter<ChatMessageFormat> adapter;
|
||||||
|
ChatMessageFormat chatMessage;
|
||||||
|
|
||||||
|
|
||||||
|
Thread currentlisten;
|
||||||
|
|
||||||
|
//Save/ Load Variblen
|
||||||
|
File file;
|
||||||
|
File Unsendfile = null;
|
||||||
|
//Chat Name
|
||||||
|
protected String name;
|
||||||
|
|
||||||
|
|
||||||
|
//Für Notification
|
||||||
|
private static boolean isOnStop = false;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.chat);
|
||||||
|
|
||||||
|
//########### Custom Action Bar ##################################
|
||||||
|
ActionBar action = getSupportActionBar();
|
||||||
|
|
||||||
|
action.setDisplayShowHomeEnabled(false);
|
||||||
|
action.setDisplayShowTitleEnabled(false);
|
||||||
|
|
||||||
|
LayoutInflater inflate = LayoutInflater.from(this);
|
||||||
|
View mCustomView = inflate.inflate(R.layout.custom_menuebar,null);
|
||||||
|
|
||||||
|
|
||||||
|
// Initialiesiere die Variablen
|
||||||
|
TextView titlename = (TextView)mCustomView.findViewById(R.id.PersonalName);
|
||||||
|
ImageView titlepic = (ImageView)mCustomView.findViewById(R.id.PersonalPic);
|
||||||
|
|
||||||
|
//get Daten aus vorheriger Activity
|
||||||
|
Bundle zielkorb = getIntent().getExtras();
|
||||||
|
name = zielkorb.getString("Name");
|
||||||
|
|
||||||
|
byte[] bildArray = zielkorb.getByteArray("Bild");
|
||||||
|
Bitmap customerImage;
|
||||||
|
|
||||||
|
//ein try catch wäre vorteilhaft || Später
|
||||||
|
if(bildArray != null) {
|
||||||
|
customerImage = BitmapFactory.decodeByteArray(bildArray, 0, bildArray.length);
|
||||||
|
titlepic.setImageBitmap(GetCircleBitmap(customerImage));
|
||||||
|
}
|
||||||
|
|
||||||
|
//Online Status listener
|
||||||
|
/* ImageView img = (ImageView) mCustomView.findViewById(R.id.status);
|
||||||
|
img.setOnClickListener(new View.OnClickListener() {
|
||||||
|
public void onClick(View v) {
|
||||||
|
ChatActiviti.this.openOptionsMenu(); // activity's onCreateOptionsMenu gets called
|
||||||
|
//optionsMenu.performIdentifierAction(R.id., 0);
|
||||||
|
}
|
||||||
|
});*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
titlename.setText(name);
|
||||||
|
|
||||||
|
action.setCustomView(mCustomView);
|
||||||
|
action.setDisplayShowCustomEnabled(true);
|
||||||
|
//###########################################################################################
|
||||||
|
|
||||||
|
senden = (Button)findViewById(R.id.Sendebutton);
|
||||||
|
//chat = (TextView)findViewById(R.id.ChatText);
|
||||||
|
|
||||||
|
//################### Initial Design Variabeln Message Adapter #############################################
|
||||||
|
chatMessages = new ArrayList<>();
|
||||||
|
|
||||||
|
listView = (ListView)findViewById(R.id.list_msg);
|
||||||
|
|
||||||
|
adapter = new MessageAdapter(this, R.layout.item_chat_left,chatMessages);
|
||||||
|
listView.setAdapter(adapter);
|
||||||
|
|
||||||
|
//############################ Initial Design Variablen ende ###############################
|
||||||
|
|
||||||
|
//########################### Initial Socket ###############################################
|
||||||
|
try {
|
||||||
|
MainActivityMitarbeiter.isThreadPause = true;
|
||||||
|
|
||||||
|
socket = MainActivityMitarbeiter.socket;
|
||||||
|
|
||||||
|
in = MainActivityMitarbeiter.in;
|
||||||
|
//nachricht an server senden welcher name jetz aktiv connected ist
|
||||||
|
st = new DataOutputStream(socket.getOutputStream());
|
||||||
|
}catch(Exception e){/*Fail*/}
|
||||||
|
|
||||||
|
|
||||||
|
// MainActivityMitarbeiter.listen.interrupt();
|
||||||
|
// MainActivityMitarbeiter.listen = null;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//##########################################################################################
|
||||||
|
|
||||||
|
//############## Safe / Write gedöns #########################################################
|
||||||
|
CreateFile();
|
||||||
|
|
||||||
|
ReadMessageToStorage();
|
||||||
|
|
||||||
|
//##########################################################################################
|
||||||
|
|
||||||
|
|
||||||
|
//Öffnet eine Verbindung zum Server
|
||||||
|
// new Thread(new OpenConnection()).start();
|
||||||
|
|
||||||
|
|
||||||
|
text = (EditText)findViewById(R.id.editText);
|
||||||
|
|
||||||
|
//Sendet eine Nachricht an den Server/Clienten
|
||||||
|
senden.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
|
||||||
|
//isMe = true;
|
||||||
|
|
||||||
|
if(text.getText().toString().equals("exit")){
|
||||||
|
//eine möglich keit die connection zu schließen
|
||||||
|
// new Thread(new ConnectionClose()).start();
|
||||||
|
}else if(!text.getText().toString().equals("")){
|
||||||
|
new Thread(new SendMS()).start();
|
||||||
|
}else{
|
||||||
|
Toast.makeText(ChatActiviti.this, "Sie müssen schon Text eingeben ", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
//Erstelle einen immer horchenden Listener
|
||||||
|
Thread t = new Thread(new SocketListener());
|
||||||
|
t.start();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//MainActivityMitarbeiter.listen.sus
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//######################### Server/ Client gedöns ##################################################
|
||||||
|
/*public class OpenConnection implements Runnable{
|
||||||
|
public void run(){
|
||||||
|
try {
|
||||||
|
socket = new Socket(dstAddress,dstPort);
|
||||||
|
// Log.v("Status: ","Vorhanden 3");
|
||||||
|
|
||||||
|
//nachricht an server senden welcher name jetz aktiv connected ist
|
||||||
|
st = new DataOutputStream(socket.getOutputStream());
|
||||||
|
name=name+"/1";
|
||||||
|
byte[] ts = name.getBytes();
|
||||||
|
st.write(ts);
|
||||||
|
st.flush();
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
// e.printStackTrace();
|
||||||
|
Log.v("Connection: ","Konnte nicht Aufgebaut");
|
||||||
|
socket = null;
|
||||||
|
//methode zur abfrage
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}*/
|
||||||
|
|
||||||
|
public class SendMS implements Runnable{
|
||||||
|
public void run(){
|
||||||
|
String al = text.getText().toString();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
byte[] ts = al.getBytes();
|
||||||
|
try{
|
||||||
|
if(socket!= null ) {
|
||||||
|
|
||||||
|
//try catch bei catch SaveAfterLoseConnection();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
st.write(ts);
|
||||||
|
st.flush();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
listView.post(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
Calendar c = Calendar.getInstance();
|
||||||
|
SimpleDateFormat df = new SimpleDateFormat("dd-MM-yyyy HH:mm:ss");
|
||||||
|
String formattedDate = df.format(c.getTime());
|
||||||
|
|
||||||
|
SaveCompletteMS = text.getText().toString()+"/"+isMe+"%"+formattedDate+"\n";
|
||||||
|
|
||||||
|
WriteMessagesfromStorage(text.getText().toString()+"/"+isMe+"%"+formattedDate+"\n");
|
||||||
|
|
||||||
|
chatMessage = new ChatMessageFormat(text.getText().toString(), isMe, formattedDate);
|
||||||
|
chatMessages.add(chatMessage);
|
||||||
|
adapter.notifyDataSetChanged();
|
||||||
|
|
||||||
|
text.setText("");
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}catch(IOException s){
|
||||||
|
Log.v("Status: ","Senden einer Nachricht konnte nicht ausgeführt werden. Save wird ausgeführt");
|
||||||
|
//Log.v("hallo",);
|
||||||
|
|
||||||
|
|
||||||
|
SaveAfterLoseConnection(SaveCompletteMS);
|
||||||
|
s.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* public class ConnectionClose implements Runnable{
|
||||||
|
public void run(){
|
||||||
|
try {
|
||||||
|
// Log.v("Bin ich Überhaupt", "Hier drinne");
|
||||||
|
if (st != null) {
|
||||||
|
st.flush();
|
||||||
|
st.close();
|
||||||
|
}
|
||||||
|
if (socket != null)
|
||||||
|
socket = null;
|
||||||
|
// Log.v("Schliesen :","?? Möglich");
|
||||||
|
// }
|
||||||
|
Log.v("Status","Socket succesfull closed");
|
||||||
|
}catch(IOException se){
|
||||||
|
Log.v("Status: ","Schließen nicht möglich. Es ist ein Fehler aufgetreten");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}*/
|
||||||
|
|
||||||
|
// Erhalte Messages all the time
|
||||||
|
public class SocketListener implements Runnable{
|
||||||
|
|
||||||
|
|
||||||
|
String str;
|
||||||
|
long i = 1;
|
||||||
|
//BufferedReader in = null;
|
||||||
|
public void run(){
|
||||||
|
try{
|
||||||
|
//DesignTechnische gründe
|
||||||
|
Log.v("Komme","ICh den Rein");
|
||||||
|
while(true){
|
||||||
|
|
||||||
|
if (socket != null) {
|
||||||
|
Log.v("Komme","So wie es aussieht nicht ");
|
||||||
|
if(socket.isConnected()) {
|
||||||
|
Log.v("Connection Steht ", "Connection Steht");
|
||||||
|
Log.v("Komme","So wie es aussieht nicht2 ");
|
||||||
|
//final TextView text = (TextView)findViewById(R.id.ChatText);
|
||||||
|
|
||||||
|
final ListView listV = (ListView) findViewById(R.id.list_msg);
|
||||||
|
|
||||||
|
Log.v("Komme","So wie es aussieht nicht 3");
|
||||||
|
// in = new BufferedReader(new InputStreamReader(MainActivityMitarbeiter.socket.getInputStream()));
|
||||||
|
|
||||||
|
/*---> da wird das pendant ausgeführt und nicht dieses */ String s = in.readLine();
|
||||||
|
Log.v("Komme","So wie es aussieht nicht 4");
|
||||||
|
CharSequence cs = text.getText();
|
||||||
|
|
||||||
|
// wir nehmen mal cs raus
|
||||||
|
//str = cs + "\r\n" + s;
|
||||||
|
str = s;
|
||||||
|
|
||||||
|
if (s == null)
|
||||||
|
break;
|
||||||
|
|
||||||
|
//Design Spezifisch
|
||||||
|
listV.post(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
|
||||||
|
Calendar c = Calendar.getInstance();
|
||||||
|
SimpleDateFormat df = new SimpleDateFormat("dd-MM-yyyy HH:mm:ss");
|
||||||
|
String formattedDate = df.format(c.getTime());
|
||||||
|
|
||||||
|
boolean determind = false;
|
||||||
|
|
||||||
|
WriteMessagesfromStorage(str+"/"+determind+"%"+formattedDate+"\n");
|
||||||
|
|
||||||
|
chatMessage = new ChatMessageFormat(str, determind, formattedDate);
|
||||||
|
chatMessages.add(chatMessage);
|
||||||
|
adapter.notifyDataSetChanged();
|
||||||
|
|
||||||
|
Log.v("","");
|
||||||
|
|
||||||
|
if(isOnStop == true){
|
||||||
|
SetNotifi("Bärtiger Hanz",str);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
|
||||||
|
if (in != null)
|
||||||
|
in.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
// else Log.v("Connection","nicht aufgebaut"); nach tausend versuchen break und fehler ausgabe
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}catch(Exception e){
|
||||||
|
Log.v("Status ","Verbindung zum Server wurde seitens dem Server getrennt ");
|
||||||
|
// Log.e(getClass().getName(),e.getMessage());
|
||||||
|
// e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//#################################### Server Client Ende ##########################################
|
||||||
|
|
||||||
|
//########################### Speichere Message für Server bei unsend #####################################
|
||||||
|
public void SaveAfterLoseConnection(String UnsendMessage){
|
||||||
|
CreateCustomFileForUnSendMessage();
|
||||||
|
try{
|
||||||
|
FileOutputStream stream = new FileOutputStream(Unsendfile,true);
|
||||||
|
|
||||||
|
try{
|
||||||
|
stream.write(UnsendMessage.getBytes());
|
||||||
|
}finally {
|
||||||
|
stream.close();
|
||||||
|
}
|
||||||
|
}catch (Exception e){
|
||||||
|
Log.v("Fehler",e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SendAfterGetConnection(){
|
||||||
|
|
||||||
|
//ist eine UnsendMessage File vorhanden
|
||||||
|
if(Unsendfile != null && socket.isConnected()){
|
||||||
|
try{
|
||||||
|
FileInputStream stream = new FileInputStream(Unsendfile);
|
||||||
|
InputStreamReader in = new InputStreamReader(stream);
|
||||||
|
BufferedReader readLn = new BufferedReader(in);
|
||||||
|
|
||||||
|
String line = readLn.readLine();
|
||||||
|
String allLines="";
|
||||||
|
|
||||||
|
while (line != null) {
|
||||||
|
allLines += line;
|
||||||
|
|
||||||
|
String[] splitt = line.split("/");
|
||||||
|
|
||||||
|
if(splitt.length >1 ) {
|
||||||
|
String[] ArtDate = splitt[1].split("%");
|
||||||
|
|
||||||
|
final String message = splitt[0];
|
||||||
|
final boolean art = Boolean.valueOf(ArtDate[0]);
|
||||||
|
final String datetime = ArtDate[1];
|
||||||
|
|
||||||
|
//für jede Gelesene Line Sende Nachricht
|
||||||
|
new Thread(new SendUnsendMS(message)).start();
|
||||||
|
}
|
||||||
|
line = readLn.readLine();
|
||||||
|
}
|
||||||
|
stream.close();
|
||||||
|
in.close();
|
||||||
|
Unsendfile.delete();
|
||||||
|
}catch(Exception fe){
|
||||||
|
Log.v("Status","Ein problem ist im BEreich Unsend Ms Aufgetreten");
|
||||||
|
}
|
||||||
|
//recreate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class SendUnsendMS implements Runnable{
|
||||||
|
|
||||||
|
String al;
|
||||||
|
|
||||||
|
SendUnsendMS(String unMS){
|
||||||
|
this.al = unMS;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void run() {
|
||||||
|
//String al = text.getText().toString();
|
||||||
|
|
||||||
|
byte[] ts = al.getBytes();
|
||||||
|
try {
|
||||||
|
if (socket != null && st != null) {
|
||||||
|
|
||||||
|
//try catch bei catch SaveAfterLoseConnection();
|
||||||
|
st.write(ts);
|
||||||
|
st.flush();
|
||||||
|
}
|
||||||
|
}catch(Exception xs){
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void CreateCustomFileForUnSendMessage(){
|
||||||
|
try{
|
||||||
|
File pfad = getBaseContext().getFilesDir();
|
||||||
|
|
||||||
|
//Für external Save
|
||||||
|
//File pfad = getBaseContext().getExternalFilesDir(null);
|
||||||
|
|
||||||
|
//Erstelle das File Objekt
|
||||||
|
Unsendfile = new File(pfad,name+"_Unsend"+".txt");
|
||||||
|
|
||||||
|
}catch(Exception e){
|
||||||
|
Log.v("Fehler"," Das erstellen/öffnen einer Datei ist Derzeit nicht möglich");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//####################### Ende Unsend Message Gedöns ###########################################
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//############### Menue Bereich ################################################################
|
||||||
|
|
||||||
|
public boolean onCreateOptionsMenu(Menu menu) {
|
||||||
|
// Inflate the menu; this adds items to the action bar if it is present.
|
||||||
|
getMenuInflater().inflate(R.menu.menue_chat, menu);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
|
// Handle item selection
|
||||||
|
switch (item.getItemId()) {
|
||||||
|
case R.id.action_delet_Storage:
|
||||||
|
file.delete(); //Delet aktuell gespeicherte message
|
||||||
|
recreate(); // ---> gegebenenfals umändern, aber fürs erste reichts
|
||||||
|
return true;
|
||||||
|
default:
|
||||||
|
return super.onOptionsItemSelected(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//################################################################################################
|
||||||
|
|
||||||
|
|
||||||
|
//############## Setze Notification ############################################################
|
||||||
|
|
||||||
|
public void SetNotifi(String Username,String message){
|
||||||
|
|
||||||
|
//Convertiert in Pic Resource in ein Bitmap
|
||||||
|
//BitmapFactory.decodeResource(getResources(), R.drawable.bslogo)
|
||||||
|
|
||||||
|
NotificationCompat.Builder mBuilder =
|
||||||
|
new NotificationCompat.Builder(this)
|
||||||
|
.setSmallIcon(R.drawable.bslogo)
|
||||||
|
.setContentTitle(Username)
|
||||||
|
.setContentText(message)
|
||||||
|
.setAutoCancel(true)
|
||||||
|
//ab hier neuland
|
||||||
|
.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);
|
||||||
|
//neuland ende
|
||||||
|
|
||||||
|
Intent resultIntent = new Intent(this, ChatActiviti.class);
|
||||||
|
//versuch ab hier neuland
|
||||||
|
resultIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
|
||||||
|
//neuland ende
|
||||||
|
PendingIntent resultPendingIntent =
|
||||||
|
PendingIntent.getActivity(
|
||||||
|
this.getApplicationContext(),
|
||||||
|
0,
|
||||||
|
resultIntent,
|
||||||
|
PendingIntent.FLAG_UPDATE_CURRENT
|
||||||
|
|
||||||
|
);
|
||||||
|
NotificationManager mNotifyMgr =
|
||||||
|
(NotificationManager) getSystemService(NOTIFICATION_SERVICE);
|
||||||
|
|
||||||
|
|
||||||
|
mBuilder.setContentIntent(resultPendingIntent);
|
||||||
|
|
||||||
|
mNotifyMgr.notify(001, mBuilder.build());
|
||||||
|
}
|
||||||
|
|
||||||
|
//##############################################################################################
|
||||||
|
|
||||||
|
|
||||||
|
//################ Activit abfragen ############################################################
|
||||||
|
public void onResume() {
|
||||||
|
// Log.v("Stuss","Hier nochmals on creat aufrufen");
|
||||||
|
isOnStop = false;
|
||||||
|
|
||||||
|
MainActivityMitarbeiter.isThreadPause = true;
|
||||||
|
|
||||||
|
super.onResume();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onStop(){
|
||||||
|
// Thread t = new Thread(new ConnectionClose());
|
||||||
|
// t.start();
|
||||||
|
|
||||||
|
MainActivityMitarbeiter.isThreadPause = false;
|
||||||
|
|
||||||
|
isOnStop = true;
|
||||||
|
super.onStop();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onDestroy(){
|
||||||
|
// Thread t = new Thread(new ConnectionClose());
|
||||||
|
// t.start();
|
||||||
|
// currentlisten = null;
|
||||||
|
MainActivityMitarbeiter.isThreadPause = false;
|
||||||
|
|
||||||
|
super.onDestroy();
|
||||||
|
}
|
||||||
|
//##############################################################################################
|
||||||
|
|
||||||
|
//################# Lade/Speichere Die Messages ################################################
|
||||||
|
//create a File
|
||||||
|
public void CreateFile(){
|
||||||
|
|
||||||
|
try{
|
||||||
|
|
||||||
|
File pfad = getBaseContext().getFilesDir();
|
||||||
|
|
||||||
|
//Für external Save
|
||||||
|
//File pfad = getBaseContext().getExternalFilesDir(null);
|
||||||
|
|
||||||
|
//Erstelle das File Objekt
|
||||||
|
//file = new File(pfad,name+".txt");
|
||||||
|
|
||||||
|
//vorläufig ##### für debug zwecke
|
||||||
|
file = new File(pfad,"demo"+".txt");
|
||||||
|
}catch(Exception e){
|
||||||
|
Log.v("Fehler"," Das erstellen/öffnen einer Datei ist Derzeit nicht möglich");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//Internal Storage
|
||||||
|
public void WriteMessagesfromStorage(String message){
|
||||||
|
try{
|
||||||
|
FileOutputStream stream = new FileOutputStream(file,true);
|
||||||
|
|
||||||
|
try{
|
||||||
|
stream.write(message.getBytes());
|
||||||
|
}finally {
|
||||||
|
stream.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Log.v("Status","Text: "+message+" wurde gespeichert." );
|
||||||
|
|
||||||
|
}catch (Exception e){
|
||||||
|
Log.v("Fehler 1 ",e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//Internal storage
|
||||||
|
public void ReadMessageToStorage(){
|
||||||
|
try{
|
||||||
|
|
||||||
|
// Log.v("Status","Verbindung steht 1");
|
||||||
|
int lenght = (int) file.length();
|
||||||
|
|
||||||
|
byte[] bytes = new byte[lenght];
|
||||||
|
|
||||||
|
FileInputStream stream = new FileInputStream(file);
|
||||||
|
|
||||||
|
|
||||||
|
// Log.v("Status","Verbindung steht 2");
|
||||||
|
InputStreamReader in = new InputStreamReader(stream);
|
||||||
|
|
||||||
|
BufferedReader readLn = new BufferedReader(in);
|
||||||
|
|
||||||
|
String line = readLn.readLine();
|
||||||
|
String allLines="";
|
||||||
|
//Build a readLine konstrukt
|
||||||
|
while (line != null) {
|
||||||
|
allLines += line;
|
||||||
|
|
||||||
|
//Funktion für das korrekte anzeigen der Geladenen Nachrichten hier implementieren
|
||||||
|
//---> <---//
|
||||||
|
//String[] splitt = line.split("/");
|
||||||
|
|
||||||
|
// Log.v("Status",line);
|
||||||
|
|
||||||
|
String[] splitt = line.split("/");
|
||||||
|
|
||||||
|
if(splitt.length >1 ) {
|
||||||
|
String[] ArtDate = splitt[1].split("%"); //<------------ im code sind als seperator ? gesetzt // lösung einfach alle löschen und neuen chat speichern !!
|
||||||
|
|
||||||
|
final String message = splitt[0];
|
||||||
|
|
||||||
|
final boolean art = Boolean.valueOf(ArtDate[0]);
|
||||||
|
|
||||||
|
final String datetime = ArtDate[1];
|
||||||
|
|
||||||
|
listView.post(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
chatMessage = new ChatMessageFormat(message, art, datetime);
|
||||||
|
chatMessages.add(chatMessage);
|
||||||
|
adapter.notifyDataSetChanged();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
line = readLn.readLine();
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
stream.close();
|
||||||
|
in.close();
|
||||||
|
|
||||||
|
// Log.v("Local Storage",allLines);
|
||||||
|
|
||||||
|
}catch(Exception e){
|
||||||
|
Log.v("Fehler 2 ",e.getMessage());
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//##############################################################################################
|
||||||
|
|
||||||
|
//################# Convert Bitmap for a circled bitmap ########################################
|
||||||
|
private Bitmap GetCircleBitmap(Bitmap bitmap) {
|
||||||
|
|
||||||
|
Bitmap output = Bitmap.createBitmap(bitmap.getWidth(),
|
||||||
|
bitmap.getHeight(), Bitmap.Config.ARGB_8888);
|
||||||
|
Canvas canvas = new Canvas(output);
|
||||||
|
|
||||||
|
int color = Color.RED;
|
||||||
|
Paint paint = new Paint();
|
||||||
|
Rect rect = new Rect(0, 0, bitmap.getWidth(), bitmap.getHeight());
|
||||||
|
RectF rectF = new RectF(rect);
|
||||||
|
|
||||||
|
//bis hierhin war alles final
|
||||||
|
paint.setAntiAlias(true);
|
||||||
|
canvas.drawARGB(0, 0, 0, 0);
|
||||||
|
paint.setColor(color);
|
||||||
|
canvas.drawOval(rectF, paint);
|
||||||
|
|
||||||
|
paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_IN));
|
||||||
|
canvas.drawBitmap(bitmap, rect, rect, paint);
|
||||||
|
|
||||||
|
bitmap.recycle();
|
||||||
|
|
||||||
|
return output;
|
||||||
|
}
|
||||||
|
//##############################################################################################
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
package beyondsoft.bewomitarbeiterapp;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by bib on 19.05.2016.
|
||||||
|
*/
|
||||||
|
public class ChatMessageFormat {
|
||||||
|
|
||||||
|
private boolean isMe;
|
||||||
|
private String message;
|
||||||
|
private String datum;
|
||||||
|
|
||||||
|
//villeicht eine issend variable einbauen
|
||||||
|
|
||||||
|
ChatMessageFormat(String message, boolean isMe,String datum){
|
||||||
|
this.message = message;
|
||||||
|
this.isMe = isMe;
|
||||||
|
this.datum = datum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean getIsME(){return isMe;}
|
||||||
|
|
||||||
|
public String getMessage(){return message;}
|
||||||
|
|
||||||
|
public String getDatum(){return datum;}
|
||||||
|
}
|
||||||
@@ -0,0 +1,84 @@
|
|||||||
|
package beyondsoft.bewomitarbeiterapp;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by bib on 07.06.2016.
|
||||||
|
*/
|
||||||
|
public class ContactList {
|
||||||
|
|
||||||
|
|
||||||
|
private int _id;
|
||||||
|
private String _kontaktname;
|
||||||
|
private String _art;
|
||||||
|
private byte[] _picture;
|
||||||
|
|
||||||
|
//default Construkt
|
||||||
|
public ContactList(){}
|
||||||
|
|
||||||
|
//Construkt 1
|
||||||
|
public ContactList(int id, String kontaktname, String art,byte[] picture){
|
||||||
|
this._id = id;
|
||||||
|
this._kontaktname = kontaktname;
|
||||||
|
this._art = art;
|
||||||
|
this._picture = picture;
|
||||||
|
}
|
||||||
|
|
||||||
|
//Construkt 2
|
||||||
|
public ContactList(String kontaktname,String art,byte[] picture){
|
||||||
|
this._kontaktname = kontaktname;
|
||||||
|
this._art = art;
|
||||||
|
this._picture = picture;
|
||||||
|
}
|
||||||
|
|
||||||
|
//Construkt 3
|
||||||
|
public ContactList(String kontaktname,String art){
|
||||||
|
this._kontaktname = kontaktname;
|
||||||
|
this._art = art;
|
||||||
|
this._picture = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
//Construkt4
|
||||||
|
public ContactList(int id, String kontaktname, String art){
|
||||||
|
this._id = id;
|
||||||
|
this._kontaktname = kontaktname;
|
||||||
|
this._art = art;
|
||||||
|
this._picture = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
//ID
|
||||||
|
public int getID(){
|
||||||
|
return this._id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setID(int id){
|
||||||
|
this._id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// KONTAKT
|
||||||
|
public String getKontaktName(){
|
||||||
|
return this._kontaktname;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setKontaktName(String k){
|
||||||
|
this._kontaktname = k;
|
||||||
|
}
|
||||||
|
|
||||||
|
//ART
|
||||||
|
public String getArt(){
|
||||||
|
return this._art;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setArt(String a){
|
||||||
|
this._art = a;
|
||||||
|
}
|
||||||
|
|
||||||
|
//Picture
|
||||||
|
public byte[] getPicture(){
|
||||||
|
return this._picture;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPicture(byte[] d){
|
||||||
|
this._picture = d;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,144 @@
|
|||||||
|
package beyondsoft.bewomitarbeiterapp;
|
||||||
|
|
||||||
|
import android.content.ContentValues;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.database.Cursor;
|
||||||
|
import android.database.sqlite.SQLiteDatabase;
|
||||||
|
import android.database.sqlite.SQLiteOpenHelper;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by bib on 07.06.2016.
|
||||||
|
*/
|
||||||
|
public class DatabaseHandler extends SQLiteOpenHelper {
|
||||||
|
|
||||||
|
//DataBase version
|
||||||
|
private static final int DATABASE_VERSION = 1;
|
||||||
|
//Database name
|
||||||
|
private static final String DATABASE_NAME = "Contacts_Manager";
|
||||||
|
//Table Name
|
||||||
|
private static final String TABLE_CONTACTS = "Contactlist";
|
||||||
|
|
||||||
|
|
||||||
|
//Table Columns name
|
||||||
|
private static final String KEY_ID ="id";
|
||||||
|
private static final String KEY_KontaktName = "kontaktname";
|
||||||
|
private static final String KEY_ART = "art";
|
||||||
|
private static final String KEY_Picture_BLOB = "bild";
|
||||||
|
|
||||||
|
|
||||||
|
public DatabaseHandler(Context context){
|
||||||
|
super(context,DATABASE_NAME,null,DATABASE_VERSION);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Erstelle Tabelle | Tabellen construct
|
||||||
|
public void onCreate(SQLiteDatabase db){
|
||||||
|
String CREATE_CONTACTS_TABLE ="CREATE TABLE "+TABLE_CONTACTS +"("+
|
||||||
|
KEY_ID +" INTEGER PRIMARY KEY,"+KEY_KontaktName+ " TEXT,"+
|
||||||
|
KEY_ART +" TEXT," + KEY_Picture_BLOB+ " BLOB"+")";
|
||||||
|
|
||||||
|
db.execSQL(CREATE_CONTACTS_TABLE);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion){
|
||||||
|
|
||||||
|
//drop older Table if existed
|
||||||
|
db.execSQL("DROP TABLE IF EXISTS "+ TABLE_CONTACTS);
|
||||||
|
|
||||||
|
onCreate(db);
|
||||||
|
}
|
||||||
|
|
||||||
|
//Add Neuen Contact
|
||||||
|
void addContact(ContactList contact) {
|
||||||
|
SQLiteDatabase db = this.getWritableDatabase();
|
||||||
|
ContentValues values = new ContentValues();
|
||||||
|
|
||||||
|
//Values übergabe
|
||||||
|
values.put(KEY_KontaktName,contact.getKontaktName());
|
||||||
|
values.put(KEY_ART,contact.getArt());
|
||||||
|
values.put(KEY_Picture_BLOB,contact.getPicture());
|
||||||
|
|
||||||
|
db.insert(TABLE_CONTACTS,null,values);
|
||||||
|
db.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
//Hole ein Bestimten Contact
|
||||||
|
ContactList getContact(int id) {
|
||||||
|
|
||||||
|
SQLiteDatabase db = this.getReadableDatabase();
|
||||||
|
|
||||||
|
Cursor cursor = db.query(TABLE_CONTACTS, new String[]{KEY_ID,KEY_KontaktName,
|
||||||
|
KEY_ART,KEY_Picture_BLOB},KEY_ID +"=?",new String[]{String.valueOf(id)}
|
||||||
|
,null,null,null,null);
|
||||||
|
|
||||||
|
if(cursor !=null)
|
||||||
|
cursor.moveToFirst();
|
||||||
|
|
||||||
|
ContactList clist = new ContactList(Integer.parseInt(cursor.getString(0)),cursor.getString(1),
|
||||||
|
cursor.getString(2),cursor.getBlob(3));
|
||||||
|
return clist;
|
||||||
|
}
|
||||||
|
|
||||||
|
//Holle alle Contacts
|
||||||
|
public List<ContactList> getAllContacts(){
|
||||||
|
List<ContactList> contactList = new ArrayList<ContactList>();
|
||||||
|
// Select All Query
|
||||||
|
String selectQuery = "SELECT * FROM " + TABLE_CONTACTS;
|
||||||
|
|
||||||
|
SQLiteDatabase db = this.getWritableDatabase();
|
||||||
|
Cursor cursor = db.rawQuery(selectQuery, null);
|
||||||
|
|
||||||
|
// looping through all rows and adding to list
|
||||||
|
if (cursor.moveToFirst()) {
|
||||||
|
do {
|
||||||
|
ContactList contact = new ContactList();
|
||||||
|
contact.setID(Integer.parseInt(cursor.getString(0)));
|
||||||
|
contact.setKontaktName(cursor.getString(1));
|
||||||
|
contact.setArt(cursor.getString(2));
|
||||||
|
contact.setPicture(cursor.getBlob(3));
|
||||||
|
|
||||||
|
// Adding contact to list
|
||||||
|
contactList.add(contact);
|
||||||
|
} while (cursor.moveToNext());
|
||||||
|
}
|
||||||
|
|
||||||
|
return contactList;
|
||||||
|
}
|
||||||
|
|
||||||
|
//updating single Contact
|
||||||
|
public int updateContact(ContactList contact) {
|
||||||
|
SQLiteDatabase db = this.getWritableDatabase();
|
||||||
|
|
||||||
|
ContentValues values = new ContentValues();
|
||||||
|
values.put(KEY_KontaktName, contact.getKontaktName());
|
||||||
|
values.put(KEY_ART, contact.getArt());
|
||||||
|
values.put(KEY_Picture_BLOB, contact.getPicture());
|
||||||
|
|
||||||
|
// updating row
|
||||||
|
return db.update(TABLE_CONTACTS, values, KEY_ID + " = ?",
|
||||||
|
new String[] { String.valueOf(contact.getID()) });
|
||||||
|
}
|
||||||
|
|
||||||
|
//Delet single Contact
|
||||||
|
public void deletContacts(ContactList contact){
|
||||||
|
SQLiteDatabase db = this.getWritableDatabase();
|
||||||
|
db.delete(TABLE_CONTACTS, KEY_ID + " = ?",
|
||||||
|
new String[] { String.valueOf(contact.getID()) });
|
||||||
|
db.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getContactsCount(){
|
||||||
|
String countQuery = "SELECT * FROM " + TABLE_CONTACTS;
|
||||||
|
SQLiteDatabase db = this.getReadableDatabase();
|
||||||
|
Cursor cursor = db.rawQuery(countQuery, null);
|
||||||
|
cursor.close();
|
||||||
|
|
||||||
|
// return count
|
||||||
|
return cursor.getCount();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,332 @@
|
|||||||
|
package beyondsoft.bewomitarbeiterapp;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.graphics.Bitmap;
|
||||||
|
import android.graphics.BitmapFactory;
|
||||||
|
import android.graphics.Canvas;
|
||||||
|
import android.graphics.Color;
|
||||||
|
import android.graphics.Paint;
|
||||||
|
import android.graphics.PorterDuff;
|
||||||
|
import android.graphics.PorterDuffXfermode;
|
||||||
|
import android.graphics.Rect;
|
||||||
|
import android.graphics.RectF;
|
||||||
|
import android.graphics.drawable.BitmapDrawable;
|
||||||
|
import android.media.Image;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.ArrayAdapter;
|
||||||
|
import android.widget.Button;
|
||||||
|
import android.widget.ImageButton;
|
||||||
|
import android.widget.ImageView;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import java.io.BufferedReader;
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.FileInputStream;
|
||||||
|
import java.io.InputStreamReader;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by bib on 03.05.2016.
|
||||||
|
*/
|
||||||
|
public class KontaktAdapter extends ArrayAdapter<ContactList> {
|
||||||
|
|
||||||
|
private final Context context;
|
||||||
|
private final ContactList[] values;
|
||||||
|
// private final List<ContactList> contactlist;
|
||||||
|
|
||||||
|
private Bitmap bitmaping;
|
||||||
|
ImageView imageView;
|
||||||
|
TextView minitext;
|
||||||
|
|
||||||
|
private String[] filedaten;
|
||||||
|
|
||||||
|
Thread getM;
|
||||||
|
Thread getPic;
|
||||||
|
|
||||||
|
|
||||||
|
public KontaktAdapter(Context context, ContactList[] values) {
|
||||||
|
super(context, R.layout.kontakt_list_chat,values);
|
||||||
|
this.context = context;
|
||||||
|
this.values = values;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public View getView(int position, View convertView, ViewGroup parent) {
|
||||||
|
LayoutInflater inflater = (LayoutInflater) context
|
||||||
|
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
||||||
|
|
||||||
|
View rowView = inflater.inflate(R.layout.kontakt_list_chat, parent, false);
|
||||||
|
TextView textView = (TextView) rowView.findViewById(R.id.label);
|
||||||
|
minitext = (TextView) rowView.findViewById(R.id.subtitle);
|
||||||
|
// TextView lasttime = (TextView) rowView.findViewById(R.id.lasttime);
|
||||||
|
|
||||||
|
ImageView onlinestats = (ImageView)rowView.findViewById(R.id.status);
|
||||||
|
imageView = (ImageView) rowView.findViewById(R.id.logo);
|
||||||
|
|
||||||
|
// ImageView Bau die Kontakt View auf
|
||||||
|
textView.setText(values[position].getKontaktName());
|
||||||
|
|
||||||
|
|
||||||
|
//Textzuweisung auf die methode verlagern
|
||||||
|
if(values[position].getKontaktName().equals("Demo")) {
|
||||||
|
getM = new Thread(new ReadLastMessage(values[position].getKontaktName(), inflater));
|
||||||
|
getM.start();
|
||||||
|
}else
|
||||||
|
minitext.setText("Hier könnte auch ihre Nachricht stehen");
|
||||||
|
|
||||||
|
|
||||||
|
Log.v("Bis hierhin","Alles correct");
|
||||||
|
|
||||||
|
//get last Message from File
|
||||||
|
//filedaten = ReadLastMessage(values[position].getKontaktName(),inflater);
|
||||||
|
|
||||||
|
//abfrage mit demo ist provisorium weil zurzeit alle auf demo zugreifen würden
|
||||||
|
/*if(values[position].getKontaktName().equals("Demo") && filedaten != null)
|
||||||
|
minitext.setText(filedaten[0]);
|
||||||
|
else
|
||||||
|
minitext.setText("Hier könnte auch ihre Nachricht stehen");*/
|
||||||
|
|
||||||
|
|
||||||
|
//lasttime.setText(filedaten[1]);
|
||||||
|
|
||||||
|
//ab hier fehlerhaft
|
||||||
|
if(values[position].getPicture() != null) {
|
||||||
|
|
||||||
|
//Konvert byte[] to Image
|
||||||
|
Bitmap i = BitmapFactory.decodeByteArray(values[position].getPicture(),0,values[position].getPicture().length);
|
||||||
|
|
||||||
|
getPic = new Thread(new GetCircleBitmap(i));
|
||||||
|
getPic.start();
|
||||||
|
|
||||||
|
// t.interrupt();
|
||||||
|
|
||||||
|
//imageView.setImageBitmap(bitmaping);
|
||||||
|
}else {
|
||||||
|
//wenn der kontakt kein bild besitzt dann nimm Default bild
|
||||||
|
//Bitmap customerImage =((BitmapDrawable).getDrawable(R.drawable.katze3)).getBitmap();
|
||||||
|
Bitmap bitmap = BitmapFactory.decodeResource(inflater.getContext().getResources(), R.drawable.katze3);
|
||||||
|
// imageView.setImageResource(R.drawable.katze3);
|
||||||
|
|
||||||
|
getPic = new Thread(new GetCircleBitmap(bitmap));
|
||||||
|
getPic.start();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// imageView.setImageBitmap(bitmaping);
|
||||||
|
}
|
||||||
|
|
||||||
|
//if statement ob kontakt online oder net
|
||||||
|
if(values[position].getArt().equals("1"))
|
||||||
|
onlinestats.setImageResource(R.drawable.online);
|
||||||
|
else if(values[position].getArt().equals("2"))
|
||||||
|
onlinestats.setImageResource(R.drawable.beschaftigt);
|
||||||
|
else if(values[position].getArt().equals("3"))
|
||||||
|
onlinestats.setImageResource(R.drawable.offline);
|
||||||
|
|
||||||
|
|
||||||
|
return rowView;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public class GetCircleBitmap implements Runnable{
|
||||||
|
|
||||||
|
Bitmap bitmap;
|
||||||
|
GetCircleBitmap(Bitmap _bitmap){
|
||||||
|
this.bitmap = _bitmap;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void run(){
|
||||||
|
final Bitmap output = Bitmap.createBitmap(bitmap.getWidth(),
|
||||||
|
bitmap.getHeight(), Bitmap.Config.ARGB_8888);
|
||||||
|
final Canvas canvas = new Canvas(output);
|
||||||
|
|
||||||
|
final int color = Color.RED;
|
||||||
|
final Paint paint = new Paint();
|
||||||
|
final Rect rect = new Rect(0, 0, bitmap.getWidth(), bitmap.getHeight());
|
||||||
|
final RectF rectF = new RectF(rect);
|
||||||
|
|
||||||
|
paint.setAntiAlias(true);
|
||||||
|
canvas.drawARGB(0, 0, 0, 0);
|
||||||
|
paint.setColor(color);
|
||||||
|
canvas.drawOval(rectF, paint);
|
||||||
|
|
||||||
|
paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_IN));
|
||||||
|
canvas.drawBitmap(bitmap, rect, rect, paint);
|
||||||
|
|
||||||
|
bitmap.recycle();
|
||||||
|
|
||||||
|
bitmaping = output;
|
||||||
|
|
||||||
|
Log.v("GET Circled"," Picture");
|
||||||
|
|
||||||
|
//if(imageView != null)
|
||||||
|
// imageView.setImageBitmap(output);
|
||||||
|
|
||||||
|
|
||||||
|
imageView.post(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
imageView.setImageBitmap(bitmaping);
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//Convert Bitmap for a circled bitmap
|
||||||
|
/*private Bitmap GetCircleBitmap(Bitmap bitmap ) {
|
||||||
|
final Bitmap output = Bitmap.createBitmap(bitmap.getWidth(),
|
||||||
|
bitmap.getHeight(), Bitmap.Config.ARGB_8888);
|
||||||
|
final Canvas canvas = new Canvas(output);
|
||||||
|
|
||||||
|
final int color = Color.RED;
|
||||||
|
final Paint paint = new Paint();
|
||||||
|
final Rect rect = new Rect(0, 0, bitmap.getWidth(), bitmap.getHeight());
|
||||||
|
final RectF rectF = new RectF(rect);
|
||||||
|
|
||||||
|
paint.setAntiAlias(true);
|
||||||
|
canvas.drawARGB(0, 0, 0, 0);
|
||||||
|
paint.setColor(color);
|
||||||
|
canvas.drawOval(rectF, paint);
|
||||||
|
|
||||||
|
paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_IN));
|
||||||
|
canvas.drawBitmap(bitmap, rect, rect, paint);
|
||||||
|
|
||||||
|
bitmap.recycle();
|
||||||
|
|
||||||
|
return output;
|
||||||
|
}*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public class ReadLastMessage implements Runnable{
|
||||||
|
|
||||||
|
LayoutInflater inflater;
|
||||||
|
String filename;
|
||||||
|
|
||||||
|
ReadLastMessage(String _filename,LayoutInflater _inflater){
|
||||||
|
this.inflater = _inflater;
|
||||||
|
this.filename = _filename;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void run(){
|
||||||
|
|
||||||
|
try{
|
||||||
|
File filesDir = inflater.getContext().getFilesDir();
|
||||||
|
|
||||||
|
File file = new File(filesDir, "demo" +".txt"); //---->filename
|
||||||
|
|
||||||
|
FileInputStream stream = new FileInputStream(file);
|
||||||
|
|
||||||
|
InputStreamReader in = new InputStreamReader(stream);
|
||||||
|
|
||||||
|
BufferedReader readLn = new BufferedReader(in);
|
||||||
|
|
||||||
|
String line = readLn.readLine();
|
||||||
|
String allLines="";
|
||||||
|
|
||||||
|
String [] ret= new String[2];
|
||||||
|
|
||||||
|
while (line != null) {
|
||||||
|
allLines += line;
|
||||||
|
|
||||||
|
String[] splitt = line.split("/");
|
||||||
|
|
||||||
|
if(splitt.length >1 ) {
|
||||||
|
String[] ArtDate = splitt[1].split("%");
|
||||||
|
|
||||||
|
final String message = splitt[0];
|
||||||
|
|
||||||
|
final boolean art = Boolean.valueOf(ArtDate[0]);
|
||||||
|
|
||||||
|
final String datetime = ArtDate[1];
|
||||||
|
|
||||||
|
if(!art) {
|
||||||
|
ret[0] = message;
|
||||||
|
ret[1] = datetime;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
line = readLn.readLine();
|
||||||
|
}
|
||||||
|
|
||||||
|
stream.close();
|
||||||
|
in.close();
|
||||||
|
|
||||||
|
|
||||||
|
// filedaten =ret;
|
||||||
|
|
||||||
|
|
||||||
|
if(minitext != null)
|
||||||
|
minitext.setText(ret[0]);
|
||||||
|
|
||||||
|
}catch(Exception e){
|
||||||
|
Log.v("Fehler 2 ",e.getMessage());
|
||||||
|
e.printStackTrace();
|
||||||
|
// return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String[] ReadLastMessage(String filename,LayoutInflater inflater){
|
||||||
|
try{
|
||||||
|
File filesDir = inflater.getContext().getFilesDir();
|
||||||
|
|
||||||
|
File file = new File(filesDir, "demo" +".txt"); //---->filename
|
||||||
|
|
||||||
|
FileInputStream stream = new FileInputStream(file);
|
||||||
|
|
||||||
|
InputStreamReader in = new InputStreamReader(stream);
|
||||||
|
|
||||||
|
BufferedReader readLn = new BufferedReader(in);
|
||||||
|
|
||||||
|
String line = readLn.readLine();
|
||||||
|
String allLines="";
|
||||||
|
|
||||||
|
String [] ret= new String[2];
|
||||||
|
|
||||||
|
while (line != null) {
|
||||||
|
allLines += line;
|
||||||
|
|
||||||
|
String[] splitt = line.split("/");
|
||||||
|
|
||||||
|
if(splitt.length >1 ) {
|
||||||
|
String[] ArtDate = splitt[1].split("%");
|
||||||
|
|
||||||
|
final String message = splitt[0];
|
||||||
|
|
||||||
|
final boolean art = Boolean.valueOf(ArtDate[0]);
|
||||||
|
|
||||||
|
final String datetime = ArtDate[1];
|
||||||
|
|
||||||
|
if(!art) {
|
||||||
|
ret[0] = message;
|
||||||
|
ret[1] = datetime;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
line = readLn.readLine();
|
||||||
|
}
|
||||||
|
|
||||||
|
stream.close();
|
||||||
|
in.close();
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
|
||||||
|
}catch(Exception e){
|
||||||
|
Log.v("Fehler 2 ",e.getMessage());
|
||||||
|
e.printStackTrace();
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,127 @@
|
|||||||
|
package beyondsoft.bewomitarbeiterapp;
|
||||||
|
|
||||||
|
import android.app.Activity;
|
||||||
|
import android.app.ListActivity;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.graphics.Bitmap;
|
||||||
|
import android.graphics.BitmapFactory;
|
||||||
|
import android.graphics.Color;
|
||||||
|
import android.graphics.drawable.BitmapDrawable;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.support.v7.app.ActionBarActivity;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.view.Menu;
|
||||||
|
import android.view.MenuItem;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.AdapterView;
|
||||||
|
import android.widget.ArrayAdapter;
|
||||||
|
import android.widget.Button;
|
||||||
|
import android.widget.ImageView;
|
||||||
|
import android.widget.ListView;
|
||||||
|
import android.widget.StackView;
|
||||||
|
import android.widget.TextView;
|
||||||
|
import android.widget.AdapterView.OnItemClickListener;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import java.io.ByteArrayOutputStream;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by bib on 02.05.2016.
|
||||||
|
*/
|
||||||
|
public class KontaktChatActiviti extends ListActivity {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
|
//erstelle für Demo ein pic einmalig
|
||||||
|
/* ByteArrayOutputStream stream = new ByteArrayOutputStream();
|
||||||
|
Bitmap a =((BitmapDrawable)getResources().getDrawable(R.drawable.bslogo)).getBitmap();
|
||||||
|
a.compress(Bitmap.CompressFormat.JPEG,0,stream);
|
||||||
|
byte[] x = stream.toByteArray();
|
||||||
|
*/
|
||||||
|
DatabaseHandler db = new DatabaseHandler(this);
|
||||||
|
|
||||||
|
//Clear Database from Data
|
||||||
|
/* db.onUpgrade(db.getReadableDatabase(),1,2);
|
||||||
|
//Add New ContactList
|
||||||
|
db.addContact(new ContactList("Demo","1",x));
|
||||||
|
db.addContact(new ContactList("Peter Fritz","2"));
|
||||||
|
db.addContact(new ContactList("mattis Schlitz","3"));
|
||||||
|
db.addContact(new ContactList("jan Detlef","2"));
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
List<ContactList> lc = db.getAllContacts();
|
||||||
|
|
||||||
|
ContactList[] Klientel = lc.toArray(new ContactList[lc.size()]);
|
||||||
|
|
||||||
|
setListAdapter(new KontaktAdapter(this,Klientel));
|
||||||
|
db.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
//############### Menue bereiche ##########################
|
||||||
|
@Override
|
||||||
|
public boolean onCreateOptionsMenu(Menu menu) {
|
||||||
|
// Inflate the menu; this adds items to the action bar if it is present.
|
||||||
|
getMenuInflater().inflate(R.menu.menu_main_activity_mitarbeiter, menu);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
|
// Handle action bar item clicks here. The action bar will
|
||||||
|
// automatically handle clicks on the Home/Up button, so long
|
||||||
|
// as you specify a parent activity in AndroidManifest.xml.
|
||||||
|
int id = item.getItemId();
|
||||||
|
|
||||||
|
//noinspection SimplifiableIfStatement
|
||||||
|
|
||||||
|
if (id == R.id.action_Logout) {
|
||||||
|
System.exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
return super.onOptionsItemSelected(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
//########################################################
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onListItemClick(ListView l, View v, int position, long id) {
|
||||||
|
//get selected items
|
||||||
|
ContactList selectedValue = (ContactList) getListAdapter().getItem(position);
|
||||||
|
Toast.makeText(this, selectedValue.getKontaktName(), Toast.LENGTH_SHORT).show();
|
||||||
|
|
||||||
|
//
|
||||||
|
|
||||||
|
Bundle korb = new Bundle();
|
||||||
|
|
||||||
|
korb.putString("Name",selectedValue.getKontaktName());
|
||||||
|
|
||||||
|
Intent in = new Intent(getBaseContext(), ChatActiviti.class);
|
||||||
|
in.putExtras(korb);
|
||||||
|
|
||||||
|
//gebe bild mit für den Cat
|
||||||
|
if(selectedValue.getPicture() == null){
|
||||||
|
ByteArrayOutputStream stream = new ByteArrayOutputStream();
|
||||||
|
Bitmap a = BitmapFactory.decodeResource(getResources(), R.drawable.katze3);
|
||||||
|
a.compress(Bitmap.CompressFormat.JPEG,0,stream);
|
||||||
|
byte[] x = stream.toByteArray();
|
||||||
|
in.putExtra("Bild",x);
|
||||||
|
}else
|
||||||
|
in.putExtra("Bild",selectedValue.getPicture());
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
startActivity(in);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,115 @@
|
|||||||
|
package beyondsoft.bewomitarbeiterapp;
|
||||||
|
|
||||||
|
import android.app.AlertDialog;
|
||||||
|
import android.content.DialogInterface;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.support.v7.app.ActionBarActivity;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.Button;
|
||||||
|
import android.widget.EditText;
|
||||||
|
import android.widget.TextView;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by bib on 02.05.2016.
|
||||||
|
*/
|
||||||
|
public class LoginActiviti extends ActionBarActivity {
|
||||||
|
//##################### Variablen ####################
|
||||||
|
protected Button loginbutton;
|
||||||
|
protected Button beendenbutton;
|
||||||
|
|
||||||
|
protected EditText kunnr;
|
||||||
|
protected EditText user;
|
||||||
|
protected EditText paswd;
|
||||||
|
protected String[] MitarbeiterloginString = new String[3];
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.login);
|
||||||
|
|
||||||
|
setzeButtonListener();
|
||||||
|
setzeEditText();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//########################## Action events der Jeweiligen Buttons
|
||||||
|
public void LoginApp(){
|
||||||
|
|
||||||
|
//Server Überprüfung mit den werten
|
||||||
|
|
||||||
|
//Hier mus Serveraufruf mit rückgabe wert als string array
|
||||||
|
|
||||||
|
MitarbeiterloginString[0]="placeholder";
|
||||||
|
MitarbeiterloginString[1]="placeholder";
|
||||||
|
MitarbeiterloginString[2]="placeholder";
|
||||||
|
|
||||||
|
|
||||||
|
if(kunnr.getText().toString().equals(MitarbeiterloginString[0]) && user.getText().toString().equals(MitarbeiterloginString[1]) && paswd.getText().toString().equals(MitarbeiterloginString[2])) {
|
||||||
|
|
||||||
|
startActivity(new Intent(getBaseContext(), MainActivityMitarbeiter.class));
|
||||||
|
|
||||||
|
}else if(user.getText().toString().equals("demo")){
|
||||||
|
|
||||||
|
startActivity(new Intent(getBaseContext(), MainActivityMitarbeiter.class));
|
||||||
|
|
||||||
|
}else{
|
||||||
|
|
||||||
|
new AlertDialog.Builder(this).setTitle("Fehler").setMessage("Benutzername oder Passwort falsch!").setNeutralButton("Schließen", null).show();
|
||||||
|
|
||||||
|
kunnr.setText("");
|
||||||
|
user.setText("");
|
||||||
|
paswd.setText("");
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public void LogoutApp(){
|
||||||
|
|
||||||
|
System.exit(0);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void setzeButtonListener(){
|
||||||
|
|
||||||
|
//################## Kalender Button ######################
|
||||||
|
loginbutton = (Button) findViewById(R.id.Loginbutton);
|
||||||
|
loginbutton.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
|
||||||
|
LoginApp();
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
//################# Kassen Button #########################
|
||||||
|
beendenbutton = (Button) findViewById(R.id.Beendenbutton);
|
||||||
|
beendenbutton.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
|
||||||
|
LogoutApp();
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setzeEditText(){
|
||||||
|
kunnr = (EditText) findViewById(R.id.KundennrText);
|
||||||
|
|
||||||
|
user = (EditText) findViewById(R.id.UsernameText);
|
||||||
|
|
||||||
|
paswd = (EditText) findViewById(R.id.PWText);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,448 @@
|
|||||||
|
package beyondsoft.bewomitarbeiterapp;
|
||||||
|
|
||||||
|
import android.app.Activity;
|
||||||
|
import android.app.Notification;
|
||||||
|
import android.app.NotificationManager;
|
||||||
|
import android.app.PendingIntent;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.graphics.Color;
|
||||||
|
import android.support.v4.app.NotificationCompat;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.view.Menu;
|
||||||
|
import android.view.MenuItem;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.Button;
|
||||||
|
|
||||||
|
import java.io.BufferedReader;
|
||||||
|
import java.io.DataOutputStream;
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.FileInputStream;
|
||||||
|
import java.io.FileOutputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.InputStreamReader;
|
||||||
|
import java.net.Socket;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.Calendar;
|
||||||
|
import java.util.Timer;
|
||||||
|
import java.util.TimerTask;
|
||||||
|
|
||||||
|
|
||||||
|
public class MainActivityMitarbeiter extends Activity {
|
||||||
|
|
||||||
|
protected Button dokubutton;
|
||||||
|
protected Button chatbutton;
|
||||||
|
protected Button logoutbutton;
|
||||||
|
|
||||||
|
|
||||||
|
//########### Server Relevante Variablen #######################################################
|
||||||
|
public static Socket socket;
|
||||||
|
protected static final String dstAddress = "192.168.1.117"; //10.0.2.2"
|
||||||
|
protected static final int dstPort = 5000;
|
||||||
|
DataOutputStream st;
|
||||||
|
public static BufferedReader in = null;
|
||||||
|
//Name der Zum Server Gesndet wird
|
||||||
|
protected String name;
|
||||||
|
|
||||||
|
//Name der vom Server Erhalten wird
|
||||||
|
//protected String recname;
|
||||||
|
|
||||||
|
File file;
|
||||||
|
|
||||||
|
File Unsendfile;
|
||||||
|
|
||||||
|
public static Thread listen;
|
||||||
|
|
||||||
|
public static boolean isThreadPause = false;
|
||||||
|
//Für Notification
|
||||||
|
private static boolean isOnStop = false;
|
||||||
|
private static boolean ankommenderName = false;
|
||||||
|
|
||||||
|
//Testweise
|
||||||
|
// protected Map<String,String> MapMessage = new HashMap<>();
|
||||||
|
|
||||||
|
String personoid;
|
||||||
|
//##############################################################################################
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.activity_main_activity_mitarbeiter);
|
||||||
|
|
||||||
|
setzeButtonListener();
|
||||||
|
|
||||||
|
// Das ist der Name des Grade benutzen devices
|
||||||
|
name= "Franz";
|
||||||
|
|
||||||
|
personoid="1";
|
||||||
|
//Erstelle für jedes SQLite DatenSatz ein File
|
||||||
|
// CreateFile();
|
||||||
|
|
||||||
|
|
||||||
|
//Starte hier die Server Connection + Daten receive und speichere daten local in den Datensatz
|
||||||
|
StartServerConnection();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onCreateOptionsMenu(Menu menu) {
|
||||||
|
// Inflate the menu; this adds items to the action bar if it is present.
|
||||||
|
getMenuInflater().inflate(R.menu.menu_main_activity_mitarbeiter, menu);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
|
// Handle action bar item clicks here. The action bar will
|
||||||
|
// automatically handle clicks on the Home/Up button, so long
|
||||||
|
// as you specify a parent activity in AndroidManifest.xml.
|
||||||
|
int id = item.getItemId();
|
||||||
|
|
||||||
|
//noinspection SimplifiableIfStatement
|
||||||
|
|
||||||
|
if (id == R.id.action_Logout) {
|
||||||
|
System.exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
return super.onOptionsItemSelected(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void setzeButtonListener() {
|
||||||
|
|
||||||
|
//################## Kalender Button ######################
|
||||||
|
dokubutton = (Button) findViewById(R.id.Dokubutton);
|
||||||
|
dokubutton.setOnClickListener(new View.OnClickListener() {
|
||||||
|
public void onClick(View v) {
|
||||||
|
|
||||||
|
startActivity(new Intent(getBaseContext(),WebdokuActivity.class));
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
chatbutton = (Button) findViewById(R.id.Chatbutton);
|
||||||
|
chatbutton.setOnClickListener(new View.OnClickListener() {
|
||||||
|
public void onClick(View v) {
|
||||||
|
|
||||||
|
startActivity(new Intent(getBaseContext(),KontaktChatActivity.class));
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
logoutbutton = (Button) findViewById(R.id.Logoutbutton);
|
||||||
|
logoutbutton.setOnClickListener(new View.OnClickListener() {
|
||||||
|
public void onClick(View v) {
|
||||||
|
|
||||||
|
System.exit(0);
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
//################ Server Gedöns Was im Hintergrund der Gesamten app laufen soll ###################
|
||||||
|
public void StartServerConnection(){
|
||||||
|
|
||||||
|
Log.v("Status","Bin in start server connection");
|
||||||
|
new Thread(new OpenConnection()).start();
|
||||||
|
|
||||||
|
//Starte hier die Server Connection + Daten receive und speichere daten local in den Datensatz
|
||||||
|
|
||||||
|
}
|
||||||
|
//##################################################################################################
|
||||||
|
|
||||||
|
public class OpenConnection implements Runnable{
|
||||||
|
public void run(){
|
||||||
|
try {
|
||||||
|
socket = new Socket(dstAddress,dstPort);
|
||||||
|
// Log.v("Status: ","Verbindung wurde aufgebaut");
|
||||||
|
|
||||||
|
//Prüfe und Sende die nicht Gesendeten Nachrichten
|
||||||
|
SendAfterGetConnection();
|
||||||
|
|
||||||
|
//nachricht an server senden welcher name jetz aktiv connected ist
|
||||||
|
st = new DataOutputStream(socket.getOutputStream());
|
||||||
|
name=name+"/1"+"?"+personoid;
|
||||||
|
byte[] ts = name.getBytes();
|
||||||
|
st.write(ts);
|
||||||
|
st.flush();
|
||||||
|
|
||||||
|
// Starte SocketListener
|
||||||
|
listen = new Thread(new SocketListener());
|
||||||
|
listen.start();
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
Log.v("Connection: ","Konnte nicht Aufgebaut werden. Es wird erneut versucht");
|
||||||
|
socket = null;
|
||||||
|
try {
|
||||||
|
new Timer().schedule(new TimerTask() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
Log.v("Status", "Starte jetzt den Neu versuch");
|
||||||
|
StartServerConnection();
|
||||||
|
}
|
||||||
|
}, 120000); //----> Versuche beim Scheitern nach 2 Minuten eine Neue Verbindung aufzubauen
|
||||||
|
}catch(Exception s){
|
||||||
|
Log.v("Fehler",s.getMessage());
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public class SocketListener implements Runnable {
|
||||||
|
|
||||||
|
String str;
|
||||||
|
|
||||||
|
public void run() {
|
||||||
|
try {
|
||||||
|
while (true) {
|
||||||
|
if (socket != null) {
|
||||||
|
if (socket.isConnected()) { //----------> isThreadPausabfrage dass könnte das problem mit dem Socketlistener vorort beheben
|
||||||
|
if(!isThreadPause){
|
||||||
|
in = new BufferedReader(new InputStreamReader(socket.getInputStream()));
|
||||||
|
Log.v("Connection Steht ", "Message Erhalten");
|
||||||
|
String s = in.readLine();
|
||||||
|
|
||||||
|
String[] splitt = s.split(":");
|
||||||
|
|
||||||
|
str = s;
|
||||||
|
|
||||||
|
if (s == null)
|
||||||
|
break;
|
||||||
|
|
||||||
|
Calendar c = Calendar.getInstance();
|
||||||
|
SimpleDateFormat df = new SimpleDateFormat("dd-MM-yyyy HH:mm:ss");
|
||||||
|
String formattedDate = df.format(c.getTime());
|
||||||
|
|
||||||
|
boolean determind = false;
|
||||||
|
|
||||||
|
Log.v("MESSAGE",splitt[0]);
|
||||||
|
CreateFile(splitt[0]);
|
||||||
|
|
||||||
|
//<<<<<<------------ Du ab nach oben
|
||||||
|
//##############-----------------
|
||||||
|
Log.v("MESSAGE", "Komme ich den in den Save Bereich Hinein");
|
||||||
|
|
||||||
|
WriteMessagesfromStorage(splitt[1] + "/" + determind + "%" + formattedDate + "\n");
|
||||||
|
|
||||||
|
SetNotifi(splitt[0], splitt[1]);
|
||||||
|
// adapter.notifyDataSetChanged();
|
||||||
|
//#############------------------ mmmmmmmmmaaaaaaaaaaaannnnnnnnn
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (in != null)
|
||||||
|
in.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}catch(Exception e){
|
||||||
|
Log.v("Status ","Verbindung zum Server wurde seitens dem Server getrennt ");
|
||||||
|
// Log.e(getClass().getName(),e.getMessage());
|
||||||
|
in = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//##################### Close Connection #######################
|
||||||
|
public class ConnectionClose implements Runnable{
|
||||||
|
public void run(){
|
||||||
|
try {
|
||||||
|
if (st != null) {
|
||||||
|
st.flush();
|
||||||
|
st.close();
|
||||||
|
}
|
||||||
|
if (socket != null)
|
||||||
|
socket.close();
|
||||||
|
|
||||||
|
if(in != null)
|
||||||
|
in = null;
|
||||||
|
|
||||||
|
Log.v("Status","Socket succesfull closed");
|
||||||
|
}catch(IOException se){
|
||||||
|
Log.v("Fehler Aufgetreten",se.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//##############################################################
|
||||||
|
|
||||||
|
public void CreateFile(String filename){
|
||||||
|
|
||||||
|
try{
|
||||||
|
|
||||||
|
File pfad = getBaseContext().getFilesDir();
|
||||||
|
|
||||||
|
//Für external Save
|
||||||
|
//File pfad = getBaseContext().getExternalFilesDir(null);
|
||||||
|
|
||||||
|
//Erstelle das File Objekt
|
||||||
|
file = new File(pfad,filename+".txt");
|
||||||
|
|
||||||
|
}catch(Exception e){
|
||||||
|
Log.v("Fehler"," Das erstellen/öffnen einer Datei ist Derzeit nicht möglich");
|
||||||
|
}
|
||||||
|
// WriteMessagesfromStorage("\n ich teste weiter mit "+name);
|
||||||
|
} //---> Zu sortieren der message zum Jeweiligen kontakt
|
||||||
|
|
||||||
|
public void SendAfterGetConnection(){
|
||||||
|
CreateCustomFileForUnSendMessage();
|
||||||
|
|
||||||
|
if(Unsendfile.canRead() && socket.isConnected()){
|
||||||
|
try{
|
||||||
|
Log.v("Info","Eine ungesendete NAchricht wurde gefunden");
|
||||||
|
|
||||||
|
FileInputStream stream = new FileInputStream(Unsendfile);
|
||||||
|
InputStreamReader in = new InputStreamReader(stream);
|
||||||
|
BufferedReader readLn = new BufferedReader(in);
|
||||||
|
|
||||||
|
String line = readLn.readLine();
|
||||||
|
String allLines="";
|
||||||
|
|
||||||
|
while (line != null) {
|
||||||
|
allLines += line;
|
||||||
|
|
||||||
|
Log.v("Info","Eine ungesendete NAchricht 4");
|
||||||
|
String[] splitt = line.split("/");
|
||||||
|
|
||||||
|
if(splitt.length >1 ) {
|
||||||
|
String[] ArtDate = splitt[1].split("%");
|
||||||
|
|
||||||
|
final String message = splitt[0];
|
||||||
|
final boolean art = Boolean.valueOf(ArtDate[0]);
|
||||||
|
final String datetime = ArtDate[1];
|
||||||
|
|
||||||
|
Log.v("Info","Eine ungesendete NAchricht 5");
|
||||||
|
//für jede Gelesene Line Sende Nachricht
|
||||||
|
new Thread(new SendUnsendMS(message)).start();
|
||||||
|
Log.v("Info","Eine ungesendete NAchricht 6");
|
||||||
|
}
|
||||||
|
line = readLn.readLine();
|
||||||
|
}
|
||||||
|
stream.close();
|
||||||
|
in.close();
|
||||||
|
Unsendfile.delete();
|
||||||
|
}catch(Exception fe){
|
||||||
|
Log.v("Status","Ein problem ist im BEreich Unsend Ms Aufgetreten");
|
||||||
|
}
|
||||||
|
//recreate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void CreateCustomFileForUnSendMessage(){
|
||||||
|
try{
|
||||||
|
File pfad = getBaseContext().getFilesDir();
|
||||||
|
|
||||||
|
//Für external Save
|
||||||
|
//File pfad = getBaseContext().getExternalFilesDir(null);
|
||||||
|
|
||||||
|
//Erstelle das File Objekt | name
|
||||||
|
Unsendfile = new File(pfad,"hier der name"+"_Unsend"+".txt");
|
||||||
|
|
||||||
|
}catch(Exception e){
|
||||||
|
Log.v("Fehler"," Das erstellen/öffnen einer Datei ist Derzeit nicht möglich");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class SendUnsendMS implements Runnable{
|
||||||
|
String al;
|
||||||
|
SendUnsendMS(String unMS){
|
||||||
|
this.al = unMS;
|
||||||
|
}
|
||||||
|
public void run() {
|
||||||
|
//String al = text.getText().toString();
|
||||||
|
|
||||||
|
byte[] ts = al.getBytes();
|
||||||
|
try {
|
||||||
|
if (socket != null && st != null) {
|
||||||
|
|
||||||
|
//try catch bei catch SaveAfterLoseConnection();
|
||||||
|
st.write(ts);
|
||||||
|
st.flush();
|
||||||
|
}
|
||||||
|
}catch(Exception xs){
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void WriteMessagesfromStorage(String message){
|
||||||
|
try{
|
||||||
|
|
||||||
|
FileOutputStream stream = new FileOutputStream(file,true);
|
||||||
|
|
||||||
|
try{
|
||||||
|
stream.write(message.getBytes());
|
||||||
|
}finally {
|
||||||
|
stream.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Log.v("Status","Text: "+message+" wurde gespeichert." );
|
||||||
|
|
||||||
|
}catch (Exception e){
|
||||||
|
Log.v("Fehler",e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//setze Notification
|
||||||
|
public void SetNotifi(String Username,String message){
|
||||||
|
|
||||||
|
//Convertiert in Pic Resource in ein Bitmap
|
||||||
|
//BitmapFactory.decodeResource(getResources(), R.drawable.bslogo)
|
||||||
|
|
||||||
|
NotificationCompat.Builder mBuilder =
|
||||||
|
new NotificationCompat.Builder(this)
|
||||||
|
.setSmallIcon(R.drawable.bslogo)
|
||||||
|
.setContentTitle(Username)
|
||||||
|
.setContentText(message)
|
||||||
|
.setAutoCancel(true)
|
||||||
|
//ab hier neuland
|
||||||
|
.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);
|
||||||
|
//neuland ende
|
||||||
|
|
||||||
|
Intent resultIntent = new Intent(this, MainActivityMitarbeiter.class);
|
||||||
|
//versuch ab hier neuland
|
||||||
|
resultIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
|
||||||
|
//neuland ende
|
||||||
|
PendingIntent resultPendingIntent =
|
||||||
|
PendingIntent.getActivity(
|
||||||
|
this.getApplicationContext(),
|
||||||
|
0,
|
||||||
|
resultIntent,
|
||||||
|
PendingIntent.FLAG_UPDATE_CURRENT
|
||||||
|
|
||||||
|
);
|
||||||
|
NotificationManager mNotifyMgr =
|
||||||
|
(NotificationManager) getSystemService(NOTIFICATION_SERVICE);
|
||||||
|
|
||||||
|
|
||||||
|
mBuilder.setContentIntent(resultPendingIntent);
|
||||||
|
|
||||||
|
mNotifyMgr.notify(001, mBuilder.build());
|
||||||
|
}
|
||||||
|
|
||||||
|
//###### Activiti abfragen ##################
|
||||||
|
public void onResume() {
|
||||||
|
// Log.v("Stuss","Hier nochmals on creat aufrufen");
|
||||||
|
isOnStop = false;
|
||||||
|
|
||||||
|
super.onResume();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onStop(){
|
||||||
|
// Thread t = new Thread(new ConnectionClose());
|
||||||
|
// t.start();
|
||||||
|
|
||||||
|
isOnStop = true;
|
||||||
|
super.onStop();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onDestroy(){
|
||||||
|
Thread t = new Thread(new ConnectionClose());
|
||||||
|
t.start();
|
||||||
|
|
||||||
|
super.onDestroy();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,124 @@
|
|||||||
|
package beyondsoft.bewomitarbeiterapp;
|
||||||
|
|
||||||
|
import android.app.Activity;
|
||||||
|
import android.text.Html;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.ArrayAdapter;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.Calendar;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by bib on 20.05.2016.
|
||||||
|
*/
|
||||||
|
public class MessageAdapter extends ArrayAdapter<ChatMessageFormat> {
|
||||||
|
|
||||||
|
private Activity activity;
|
||||||
|
private List<ChatMessageFormat> messages;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public MessageAdapter(Activity context, int resource, List<ChatMessageFormat> objects) {
|
||||||
|
super(context, resource, objects);
|
||||||
|
this.activity = context;
|
||||||
|
this.messages = objects;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public View getView(int position, View convertView, ViewGroup parent) {
|
||||||
|
ViewHolder holder;
|
||||||
|
LayoutInflater inflater = (LayoutInflater) activity.getSystemService(Activity.LAYOUT_INFLATER_SERVICE);
|
||||||
|
|
||||||
|
int layoutResource = 0; // determined by view type
|
||||||
|
ChatMessageFormat chatMessage = getItem(position);
|
||||||
|
int viewType = getItemViewType(position);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//Splitt message um zu wissen ob from server oder nicht
|
||||||
|
String line = chatMessage.getMessage();
|
||||||
|
|
||||||
|
String[] splitt = line.split(":");
|
||||||
|
|
||||||
|
//Server nachricht kenntlich machen
|
||||||
|
if (chatMessage.getIsME()) {
|
||||||
|
layoutResource = R.layout.item_chat_right;
|
||||||
|
} else if(splitt[0].equals("Server")) {
|
||||||
|
layoutResource = R.layout.item_chat_sever_right;
|
||||||
|
}else {
|
||||||
|
layoutResource = R.layout.item_chat_left;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Original
|
||||||
|
if (chatMessage.getIsME()) {
|
||||||
|
layoutResource = R.layout.item_chat_left;
|
||||||
|
} else {
|
||||||
|
layoutResource = R.layout.item_chat_right;
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
/* if (convertView != null) {
|
||||||
|
holder = (ViewHolder) convertView.getTag();
|
||||||
|
Log.v("Status","Bin ich hier ?? ");
|
||||||
|
} else {*/
|
||||||
|
convertView = inflater.inflate(layoutResource, parent, false);
|
||||||
|
holder = new ViewHolder(convertView);
|
||||||
|
convertView.setTag(holder);
|
||||||
|
//}
|
||||||
|
|
||||||
|
//set message content
|
||||||
|
holder.msg.setText(chatMessage.getMessage());
|
||||||
|
|
||||||
|
|
||||||
|
//TODO eine weitere option für Chatmessage hinzufügen zum abfragen wegen send Message
|
||||||
|
|
||||||
|
if(holder.send_tick != null)
|
||||||
|
holder.send_tick.setText(Html.fromHtml("✓")+""+Html.fromHtml("✓"));
|
||||||
|
|
||||||
|
|
||||||
|
if(chatMessage.getIsME()){
|
||||||
|
holder.dateIn.setText(chatMessage.getDatum());
|
||||||
|
}else {
|
||||||
|
holder.dateOut.setText(chatMessage.getDatum());
|
||||||
|
}
|
||||||
|
|
||||||
|
return convertView;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getViewTypeCount() {
|
||||||
|
// return the total number of view types. this value should never change
|
||||||
|
// at runtime
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getItemViewType(int position) {
|
||||||
|
// return a value between 0 and (getViewTypeCount - 1)
|
||||||
|
return position % 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
private class ViewHolder {
|
||||||
|
private TextView msg;
|
||||||
|
private TextView dateOut;
|
||||||
|
private TextView dateIn;
|
||||||
|
|
||||||
|
private TextView send_tick;
|
||||||
|
|
||||||
|
|
||||||
|
public ViewHolder(View v) {
|
||||||
|
msg = (TextView) v.findViewById(R.id.txt_msg);
|
||||||
|
dateOut = (TextView)v.findViewById(R.id.DateOUT);
|
||||||
|
dateIn = (TextView)v.findViewById(R.id.DateIN);
|
||||||
|
send_tick = (TextView)v.findViewById(R.id.txt_msg_tick);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,52 @@
|
|||||||
|
package beyondsoft.bewomitarbeiterapp;
|
||||||
|
|
||||||
|
import android.app.Activity;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.os.Bundle;
|
||||||
|
|
||||||
|
import java.util.logging.Handler;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by bib on 02.05.2016.
|
||||||
|
*/
|
||||||
|
public class SplashScreenActiviti extends Activity {
|
||||||
|
|
||||||
|
|
||||||
|
private static final int SPLASH_DURATION = 4000;
|
||||||
|
private Handler startMain;
|
||||||
|
|
||||||
|
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.splashscreen);
|
||||||
|
|
||||||
|
Thread logoTimer = new Thread() {
|
||||||
|
public void run(){
|
||||||
|
try{
|
||||||
|
int logoTimer = 0;
|
||||||
|
while(logoTimer < 2125){
|
||||||
|
sleep(75);
|
||||||
|
logoTimer = logoTimer +100;
|
||||||
|
};
|
||||||
|
startActivity(new Intent(getBaseContext(),LoginActiviti.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
catch (InterruptedException e) {
|
||||||
|
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
finally{
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
logoTimer.start();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,57 @@
|
|||||||
|
package beyondsoft.bewomitarbeiterapp;
|
||||||
|
|
||||||
|
import android.app.Activity;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.support.v7.app.ActionBarActivity;
|
||||||
|
import android.view.Menu;
|
||||||
|
import android.view.MenuItem;
|
||||||
|
import android.webkit.WebView;
|
||||||
|
import android.webkit.WebViewClient;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by bib on 02.05.2016.
|
||||||
|
*/
|
||||||
|
public class WebdokuActiviti extends ActionBarActivity {
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.webdoku);
|
||||||
|
|
||||||
|
// Uri uri = Uri.parse("http://www.google.com");
|
||||||
|
// Intent intent = new Intent(Intent.ACTION_VIEW, uri);
|
||||||
|
// startActivity(intent);
|
||||||
|
|
||||||
|
|
||||||
|
String URL = "http://192.168.1.115/BewoPlanerMobil/login/demo";
|
||||||
|
WebView view = (WebView) this.findViewById(R.id.webView1);
|
||||||
|
|
||||||
|
view.getSettings().setJavaScriptEnabled(true);
|
||||||
|
view.loadUrl(URL);
|
||||||
|
view.setWebViewClient(new WebViewClient());
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
view.setWebViewClient(new WebViewClient(){
|
||||||
|
|
||||||
|
public void onPageFinished(WebView view,String url){
|
||||||
|
String username = "franz";
|
||||||
|
String passwort = "walter";
|
||||||
|
|
||||||
|
view.loadUrl("javascript:document.getElementbyId('tb_login').value='"+username+"; " +
|
||||||
|
"document.getElementsbyName('tb_password').value='"+passwort+";");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
});*/
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
BIN
Android/BewoMitarbeiterApp/app/src/main/katze-web.png
Normal file
|
After Width: | Height: | Size: 293 KiB |
|
After Width: | Height: | Size: 2.4 KiB |
BIN
Android/BewoMitarbeiterApp/app/src/main/res/drawable/bslogo.gif
Normal file
|
After Width: | Height: | Size: 11 KiB |
@@ -0,0 +1,13 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:thickness="0dp"
|
||||||
|
android:shape="rectangle">
|
||||||
|
<stroke android:width="3dp"
|
||||||
|
android:color="#4799E8"/>
|
||||||
|
<corners android:radius="5dp" />
|
||||||
|
<gradient
|
||||||
|
android:startColor="#C8C8C8"
|
||||||
|
android:endColor="#FFFFFF"
|
||||||
|
android:type="linear"
|
||||||
|
android:angle="270"/>
|
||||||
|
</shape>
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:thickness="0dp"
|
||||||
|
android:shape="rectangle">
|
||||||
|
<stroke android:width="3dp"
|
||||||
|
android:color="#742324"/>
|
||||||
|
<corners android:radius="0dp" />
|
||||||
|
<gradient
|
||||||
|
android:startColor="#C8C8C8"
|
||||||
|
android:endColor="#FFFFFF"
|
||||||
|
android:type="linear"
|
||||||
|
android:angle="270"/>
|
||||||
|
</shape>
|
||||||
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
BIN
Android/BewoMitarbeiterApp/app/src/main/res/drawable/katze3.jpg
Normal file
|
After Width: | Height: | Size: 107 KiB |
BIN
Android/BewoMitarbeiterApp/app/src/main/res/drawable/offline.jpg
Normal file
|
After Width: | Height: | Size: 2.4 KiB |