Commit f7ca36fd authored by Toni Beier's avatar Toni Beier

Initial commit

parents
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="de.bps.asist"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="19" />
<!-- This app has permission to register and receive message -->
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<!--
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.FLASHLIGHT" />-->
<!-- <uses-permission android:name="android.permission.READ_PHONE_STATE" /> -->
<!-- <uses-permission android:name="android.permission.CALL_PHONE" /> -->
<!-- for camera api -->
<!--<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />-->
<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />
<!--<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus" />-->
<!--android:icon="@drawable/app_icon" icon disabledm set back here if needed: -->
<application
android:name="de.bps.asist.core.ASiSTApplication"
android:allowBackup="true"
android:largeHeap="true"
android:logo="@android:color/transparent"
android:label="@string/app_name"
android:theme="@style/ASiSTTheme">
<receiver android:name="de.bps.asist.core.manager.update.UpdateAlarmReceiver"/>
<service
android:name="de.bps.asist.core.receiver.FirebaseReceiver">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT"/>
</intent-filter>
</service>
<service
android:name="de.bps.asist.core.manager.push.FirebaseIDService">
<intent-filter>
<action android:name="com.google.firebase.INSTANCE_ID_EVENT"/>
</intent-filter>
</service>
<receiver
android:name="de.bps.asist.core.manager.update.DateReceiver"
android:enabled="true"
android:exported="false" >
<intent-filter>
<action android:name="android.intent.action.DATE_CHANGED" />
</intent-filter>
</receiver>
<uses-library android:name="com.google.android.maps" />
<activity
android:name="de.bps.asist.module.start.AsistStartActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="de.bps.asist.module.olat.OlatActivity"
android:label="@string/module_olat_name" />
<activity
android:name="de.bps.asist.module.feeds.FeedActivity"
android:label="@string/module_feeds_name" />
<activity
android:name="de.bps.asist.module.lostandfound.LostAndFoundActivity"
android:label="@string/module_lostandfound_name" />
<activity
android:name="de.bps.asist.module.canteen.CanteenActivity"
android:label="@string/module_canteen_name" />
<activity android:name="de.bps.asist.module.feeds.SingleFeedActivity" />
<activity
android:name="de.bps.asist.gui.detail.DetailsActivity"
android:label="@string/title_activity_details" />
<activity
android:name="de.bps.asist.module.library.LibraryAccountActivity"
android:label="@string/module_library_home_nav_account"
android:screenOrientation="portrait" />
<activity
android:name="de.bps.asist.module.library.LibraryBarcodeActivity"
android:label="@string/module_library_home_nav_scan"
android:screenOrientation="portrait" />
<activity
android:name="de.bps.asist.module.library.LibraryFavoritesActivity"
android:label="@string/module_library_home_nav_fav"
android:screenOrientation="portrait" />
<activity
android:name="de.bps.asist.module.timetable.TimetableSelectioncodeAddActivity"
android:label="@string/module_timetable_name" />
<activity
android:name="de.bps.asist.module.timetable.TimetableDetailActivity"
android:label="@string/module_timetable_name" />
<activity
android:name="de.bps.asist.module.library.LibraryExtendedSearchActivity"
android:label="@string/module_library_extended_search" />
<activity
android:name="de.bps.asist.module.canteen.MenuDetailActivity"
android:label="@string/title_activity_details"
android:screenOrientation="portrait" />
<activity android:name="de.bps.asist.module.canteen.SingleCanteenActivity" />
<activity android:name="asist.bps.de.mytuc.module.publictransportationsystem.SingleStationActivity" />
<activity
android:name="de.bps.asist.gui.detail.DetailedTableActivity"
android:label="@string/title_activity_details"
android:screenOrientation="portrait" />
<activity
android:name="de.bps.asist.module.poi.PoiActivity"
android:label="@string/title_activity_details"
android:screenOrientation="portrait" />
<activity
android:name="de.bps.asist.module.lostandfound.LostFoundListActivity"
android:label="Details"
android:screenOrientation="portrait" />
<activity
android:name="de.bps.asist.module.lostandfound.LostFoundDetailActivity"
android:label="Details" />
<activity
android:name="de.bps.asist.module.feedback.FeedbackActivity"
android:label="Feedback"
android:screenOrientation="portrait" />
<activity
android:name="de.bps.asist.module.feedback.FeedbackQuestion"
android:label="@string/module_feedback_question_title"
android:screenOrientation="portrait" />
<activity
android:name="de.bps.asist.module.feedback.FeedbackConfigActivity"
android:label="@string/module_feedback_config"
android:screenOrientation="portrait" />
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="AIzaSyDTZSeTZNdLyH8-6XPMLhfKA2jWGZhbG4E" />
<activity
android:name="de.bps.asist.module.telephonedirectory.TelephoneDirectoryDetailsActivity"
android:label="@string/title_activity_telephone_directory_details" />
<activity
android:name="de.bps.asist.module.lostandfound.LostFoundAddActivity"
android:label="@string/module_lostfound_title" />
<activity
android:name="de.bps.asist.module.library.details.LibraryDetailsActivity"
android:label="@string/title_activity_details" />
<activity
android:name="de.bps.asist.module.library.details.LibraryHoldingsActivity"
android:label="@string/title_activity_details" />
<activity
android:name="de.bps.asist.module.eportfolio.PortfolioCameraActivity"
android:label="@string/portfolio_name"
android:launchMode="singleTop" />
<activity
android:name="de.bps.asist.module.survey.CreateSurveyActivity"
android:label="@string/survey_name" />
<activity
android:name="de.bps.asist.module.officehours.OfficeHoursDetailActivity"
android:label="@string/title_activity_office_hours_detail" />
<activity
android:name=".module.occupancy.OccupancyDetailActivity"
android:label="@string/title_activity_occupany_detail" />
<activity
android:name=".module.survey.SurveyAnswerFreeTextActivity"
android:label="@string/title_activity_details" />
<activity
android:name=".module.survey.SurveyFreetextActivity"
android:label="@string/survey_name" />
<activity android:name=".module.survey.SurveyAnswerOptionsActivity"
android:label="@string/title_activity_details" />
<activity android:name=".module.survey.SurveyEditOptionsActivity"
android:label="@string/survey_edit_button_title" />
<activity android:name=".module.survey.SurveyEvaluationActivity"
android:label="@string/title_activity_details" />
<activity android:name=".module.survey.SurveyOverviewActivity"
android:label="@string/survey_name" />
<activity android:name=".gui.code.GenericAddActivity"
android:label="@string/survey_name" android:theme="@style/GenericAddTheme" />
</application>
</manifest>
\ No newline at end of file
buildscript {
repositories {
mavenCentral()
jcenter()
maven {
url 'https://maven.google.com'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.2'
}
}
apply plugin: 'com.android.library'
apply plugin: 'idea'
idea {
module {
downloadJavadoc = true
downloadSources = true
}
}
repositories {
mavenCentral()
jcenter()
maven {
url 'https://maven.google.com'
}
}
android {
publishNonDefault true
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src/main/java']
resources.srcDirs = ['src/main/java']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['src/main/res']
assets.srcDirs = ['assets']
}
androidTest.setRoot('tests')
}
compileSdkVersion 'Google Inc.:Google APIs:24'
buildToolsVersion '25.0.3'
defaultConfig {
minSdkVersion 14
targetSdkVersion 19
useLibrary 'org.apache.http.legacy'
versionCode 1
versionName '1.0'
}
dexOptions {
javaMaxHeapSize "4g"
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/notice.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/dependencies.txt'
exclude 'META-INF/LGPL2.1'
}
signingConfigs {
debug {
storeFile file('../debug.keystore')
keyAlias 'androiddebugkey'
}
release {
// Nothing here
keyAlias 'ibesbps'
keyPassword 'ibesbps'
storeFile file('../ibesBPS.keystore')
storePassword 'ibesbps'
}
}
productFlavors {
standard {
}
bps {
}
}
buildTypes {
/*doFirst {
def configFilePath = System.getProperty("app.asist.config.file")
File configFile
if( configFilePath == null ) {
configFile = rootProject.file( "app.configuration.properties" )
if( !configFile.exists() ) {
configFile =
}
}
}*/
release {
buildConfigField "boolean", "ASIST_DEBUG", "false"
minifyEnabled true
proguardFile '../proguard.cfg'
signingConfig signingConfigs.release
}
debug {
buildConfigField "boolean", "ASIST_DEBUG", "true"
minifyEnabled true
proguardFile '../proguard.cfg'
versionNameSuffix ' dev'
copy {
from('res/') {
include '**/*.xml'
filter { String line -> line.replaceAll('asistUrl', 'com.example.rev.flavor1.permission.MAPS_RECEIVE') }
}
into "$buildDir/res"
}
}
}
lintOptions {
abortOnError false
}
}
android.libraryVariants.all { variant ->
variant.mergeResources.doLast {
ext.env = System.getenv()
//parseFile("${buildDir}/intermediates/res/${variant.dirName}/values/values.xml")
//parseFile("${buildDir}/intermediates/incremental/mergeResources/${variant.dirName}/merger.xml")
//parseFile("${buildDir}/intermediates/bundles/${variant.dirName}/res/values/values.xml")
//parseFile("res/values/settings.xml")
}
variant.outputs[0].processResources.doLast {
}
}
def version = '1.0'
def parseFile(name) {
File valuesFile = file(name)
println("Replacing revision number in " + valuesFile)
println("Build number = " + ${rootUrl})
String content = valuesFile.getText('UTF-8')
content = content.replaceAll('asistUrl', ${rootUrl})
valuesFile.write(content, 'UTF-8')
}
dependencies {
compile 'org.springframework.android:spring-android-rest-template:1.0.1.RELEASE'
compile 'me.dm7.barcodescanner:zxing:1.9.8'
compile 'com.j256.ormlite:ormlite-android:4.48'
compile 'com.fasterxml.jackson.core:jackson-databind:2.9.4'
compile 'com.android.support:support-v4:25.1.1'
compile 'com.android.support:appcompat-v7:25.1.1'
compile 'com.android.support:design:25.1.1'
compile 'com.android.support:support-annotations:25.1.1'
//simply compile google maps only
//compile 'com.google.android.gms:play-services:11.8.0'
compile 'com.google.android.gms:play-services-maps:11.8.0'
compile 'com.google.android.gms:play-services-location:11.8.0'
compile 'com.google.firebase:firebase-core:11.8.0'
compile 'com.google.firebase:firebase-messaging:11.8.0'
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
compile 'com.jjoe64:graphview:3.1.3'
compile 'com.github.machinarius:preferencefragment:0.1.2'
compile 'com.loopj.android:android-async-http:1.4.5'
compile 'org.greenrobot:eventbus:3.0.0'
compile fileTree(include: ['*.jar'], dir: 'libs')
}
allprojects {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:deprecation" << "-Xlint:unchecked"
}
}
<?xml version="1.0" encoding="UTF-8"?>
<lint>
</lint>
\ No newline at end of file
package de.bps.asist;
import android.app.Activity;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentTransaction;
import android.support.v7.app.ActionBar.Tab;
import android.support.v7.app.ActionBar.TabListener;
public class ASiSTTabListener<T extends Fragment> implements TabListener {
private Fragment mFragment;
private final Activity mActivity;
private final String mTag;
private final Class<T> mClass;
/** Constructor used each time a new tab is created.
* @param activity The host Activity, used to instantiate the fragment
* @param tag The identifier tag for the fragment
* @param clz The fragment's Class, used to instantiate the fragment
*/
public ASiSTTabListener(Activity activity, String tag, Class<T> clz) {
mActivity = activity;
mTag = tag;
mClass = clz;
}
/* The following are each of the ActionBar.TabListener callbacks */
public void onTabSelected(Tab tab, FragmentTransaction ft) {
// Check if the fragment is already initialized
if (mFragment == null) {
// If not, instantiate and add it to the activity
mFragment = Fragment.instantiate(mActivity, mClass.getName());
ft.add(android.R.id.content, mFragment, mTag);
} else {
// If it exists, simply attach it in order to show it
ft.attach(mFragment);
}
}
public void onTabUnselected(Tab tab, FragmentTransaction ft) {
if (mFragment != null) {
// Detach the fragment, because another one is being attached
ft.detach(mFragment);
}
}
public void onTabReselected(Tab tab, FragmentTransaction ft) {
// User selected the already selected tab. Usually do nothing.
}
}
/*
* Copyright 2009 Michael Burton
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions
* and limitations under the License.
*/
package de.bps.asist;
import android.app.Activity;
import android.graphics.Color;
import android.support.v7.app.ActionBarActivity;
import android.text.Spannable;
import android.text.SpannableString;
import android.text.style.ForegroundColorSpan;
import android.view.Menu;
import android.view.MenuItem;
import java.io.Serializable;
import de.bps.asist.gui.list.AbstractGenericListCallback;
public abstract class AbstractAsistActivity extends ActionBarActivity {
@Override
public boolean onPrepareOptionsMenu(Menu menu) {
for (int i=0; i<menu.size(); i++) {
MenuItem mi = menu.getItem(i);
String title = mi.getTitle().toString();
Spannable newTitle = new SpannableString(title);
newTitle.setSpan(new ForegroundColorSpan(Color.BLUE), 0, newTitle.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
// mi.setTitle(newTitle);
}
return true;
}
public void forwardWithObject(Class<? extends Activity> target, Serializable extra){
AbstractGenericListCallback cb = new AbstractGenericListCallback(this, target);
cb.doAction(extra);
}
}
\ No newline at end of file
package de.bps.asist.context;
import de.bps.asist.R;
public class ASiSTConstants {
public static final String PREF_ROOTURL = "rooturl";
public static final String BROADCAST_INTENT_NEW_NOTIFICATIONS = "de.tufreiberg.mytu.NEW_NOTIFICATIONS";
public static final String BROADCAST_INTENT_REDRAW_BADGES = "de.tufreiberg.mytu.REDRAW_BADGES";
public static final String BROADCAST_INTENT_UPDATE_NOTIFICATIONS = "de.tufreiberg.mytu.UPDATE_NOTIFICATIONS";
public static final int NOTIFICATION_ID_NEW_NOTIFICATION = 6953;
public static final int NOTIFICATION_ID_SEND_LOST_AND_FOUND = 6952;
// IDs für Notifications ins der Kopfzeile
public static final int NOTIFICATION_ID_UPDATE = 6951;
public static final String DB_NAME = "ASiST.db";
public static final int DB_VERSION = 8; // DB_Version 4 ab myTU Version
public static final String FEEDBACK_LECTURER_MODE = "feedback.lecturer.mode";
public static final int TABLE_ITEM_TYPE_HEADER = 0;
public static final int TABLE_ITEM_TYPE_CELL = 1;
public static final int TABLE_ITEM_TYPE_MAXCOUNT = 2;
public static final int TABLE_ITEM_TYPE_FEEDBACK = 3;
public static final int TABLE_ITEM_TYPE_MAP = 4;
public static final int timetable_time_title = R.string.timetable_time_title;
}
package de.bps.asist.core;
import android.app.AlarmManager;
import android.app.Application;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.os.Handler;
import com.nostra13.universalimageloader.cache.disc.impl.UnlimitedDiskCache;
import com.nostra13.universalimageloader.core.ImageLoader;
import com.nostra13.universalimageloader.core.ImageLoaderConfiguration;
import com.nostra13.universalimageloader.utils.StorageUtils;
import java.io.File;
import java.util.Arrays;
import java.util.Timer;
import java.util.TimerTask;
import de.bps.asist.R;
import de.bps.asist.core.manager.ASiSTModuleManager;
import de.bps.asist.core.manager.environment.ASiSTCoreDataManager;
import de.bps.asist.core.manager.environment.EnvironmentManager;
import de.bps.asist.core.manager.preferences.ASiSTPreferenceManager;
import de.bps.asist.core.manager.push.PushNotificationManager;
import de.bps.asist.core.manager.update.UpdateAlarmReceiver;
import de.bps.asist.core.manager.update.UpdateManager;
import de.bps.asist.module.AbstractAsistModule;
public class ASiSTApplication extends Application {
private static final String ONLINE_STATUS = "online_status";
private static final String TAG = ASiSTApplication.class.getSimpleName();
private static final String ASIST_START_MODULE_NAME = "de.bps.asist.module.start.AsistStartModule";
private static Context mContext;
//Update alarm
private PendingIntent pendingIntent;
private AlarmManager manager;
public ASiSTApplication() {
super();
////Log.d(TAG, "Starting ASISTApplication now with mode "+ BuildConfig.BUILD_TYPE+" and debug state "+BuildConfig.DEBUG);
}
public static Context getContext() {