diff --git a/extras/ChangeLog b/extras/ChangeLog index 1fe5252e65..ba6ad59a80 100644 --- a/extras/ChangeLog +++ b/extras/ChangeLog @@ -1,3 +1,9 @@ +2013-02-22 Miguel de Dios <miguel.dedios@artica.es> + + * PandoraFMS_android_console/*: added first version of PandoraFMS + android console (it is a custom browser standaralone for the + Pandora Web Console Mobile). + 2012-09-11 Dario Rodriguez <dario.rodriguez@artica.es> * chrome_extension/manifest.json, diff --git a/extras/PandoraFMS_android_console/.classpath b/extras/PandoraFMS_android_console/.classpath new file mode 100644 index 0000000000..a4763d1eec --- /dev/null +++ b/extras/PandoraFMS_android_console/.classpath @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="src" path="src"/> + <classpathentry kind="src" path="gen"/> + <classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/> + <classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/> + <classpathentry kind="output" path="bin/classes"/> +</classpath> diff --git a/extras/PandoraFMS_android_console/.project b/extras/PandoraFMS_android_console/.project new file mode 100644 index 0000000000..8b2b291824 --- /dev/null +++ b/extras/PandoraFMS_android_console/.project @@ -0,0 +1,33 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>PandoraFMSAndroidConsole</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>com.android.ide.eclipse.adt.PreCompilerBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>com.android.ide.eclipse.adt.ApkBuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>com.android.ide.eclipse.adt.AndroidNature</nature> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/extras/PandoraFMS_android_console/.settings/org.eclipse.jdt.core.prefs b/extras/PandoraFMS_android_console/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000000..b080d2ddc8 --- /dev/null +++ b/extras/PandoraFMS_android_console/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,4 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/extras/PandoraFMS_android_console/AndroidManifest.xml b/extras/PandoraFMS_android_console/AndroidManifest.xml new file mode 100644 index 0000000000..db7c1210d2 --- /dev/null +++ b/extras/PandoraFMS_android_console/AndroidManifest.xml @@ -0,0 +1,51 @@ +<?xml version="1.0" encoding="utf-8"?> +<manifest xmlns:android="http://schemas.android.com/apk/res/android" + package="pandorafms.pandorafmsandroidconsole" + android:versionCode="1" + android:versionName="1.0" > + + <uses-sdk + android:minSdkVersion="8" + android:targetSdkVersion="17" /> + + <application + android:allowBackup="true" + android:icon="@drawable/ic_launcher" + android:label="@string/app_name" + android:theme="@style/AppTheme" > + + <activity + android:name="pandorafms.pandorafmsandroidconsole.PandoraWebView" + android:label="@string/app_name" + 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=".Help" + android:configChanges="orientation|keyboardHidden" + android:label="@string/app_name" + android:theme="@android:style/Theme.Dialog" > + </activity> + + <activity + android:name=".Options" + android:configChanges="orientation|keyboardHidden" + android:label="@string/app_name" + android:theme="@android:style/Theme.Dialog" > + </activity> + + <activity + android:name=".ConnectionCustomToast" + android:configChanges="orientation|keyboardHidden" + android:label="@string/connection_str" + android:theme="@android:style/Theme.Dialog" > + </activity> + + </application> + + <uses-permission android:name="android.permission.INTERNET" /> +</manifest> \ No newline at end of file diff --git a/extras/PandoraFMS_android_console/ChangeLog b/extras/PandoraFMS_android_console/ChangeLog new file mode 100644 index 0000000000..e69de29bb2 diff --git a/extras/PandoraFMS_android_console/bin/AndroidManifest.xml b/extras/PandoraFMS_android_console/bin/AndroidManifest.xml new file mode 100644 index 0000000000..db7c1210d2 --- /dev/null +++ b/extras/PandoraFMS_android_console/bin/AndroidManifest.xml @@ -0,0 +1,51 @@ +<?xml version="1.0" encoding="utf-8"?> +<manifest xmlns:android="http://schemas.android.com/apk/res/android" + package="pandorafms.pandorafmsandroidconsole" + android:versionCode="1" + android:versionName="1.0" > + + <uses-sdk + android:minSdkVersion="8" + android:targetSdkVersion="17" /> + + <application + android:allowBackup="true" + android:icon="@drawable/ic_launcher" + android:label="@string/app_name" + android:theme="@style/AppTheme" > + + <activity + android:name="pandorafms.pandorafmsandroidconsole.PandoraWebView" + android:label="@string/app_name" + 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=".Help" + android:configChanges="orientation|keyboardHidden" + android:label="@string/app_name" + android:theme="@android:style/Theme.Dialog" > + </activity> + + <activity + android:name=".Options" + android:configChanges="orientation|keyboardHidden" + android:label="@string/app_name" + android:theme="@android:style/Theme.Dialog" > + </activity> + + <activity + android:name=".ConnectionCustomToast" + android:configChanges="orientation|keyboardHidden" + android:label="@string/connection_str" + android:theme="@android:style/Theme.Dialog" > + </activity> + + </application> + + <uses-permission android:name="android.permission.INTERNET" /> +</manifest> \ No newline at end of file diff --git a/extras/PandoraFMS_android_console/bin/classes/pandorafms/pandorafmsandroidconsole/BuildConfig.class b/extras/PandoraFMS_android_console/bin/classes/pandorafms/pandorafmsandroidconsole/BuildConfig.class new file mode 100644 index 0000000000..f7020845d2 Binary files /dev/null and b/extras/PandoraFMS_android_console/bin/classes/pandorafms/pandorafmsandroidconsole/BuildConfig.class differ diff --git a/extras/PandoraFMS_android_console/bin/classes/pandorafms/pandorafmsandroidconsole/ConnectionCustomToast.class b/extras/PandoraFMS_android_console/bin/classes/pandorafms/pandorafmsandroidconsole/ConnectionCustomToast.class new file mode 100644 index 0000000000..86544a35d4 Binary files /dev/null and b/extras/PandoraFMS_android_console/bin/classes/pandorafms/pandorafmsandroidconsole/ConnectionCustomToast.class differ diff --git a/extras/PandoraFMS_android_console/bin/classes/pandorafms/pandorafmsandroidconsole/Help.class b/extras/PandoraFMS_android_console/bin/classes/pandorafms/pandorafmsandroidconsole/Help.class new file mode 100644 index 0000000000..19a1f3cee6 Binary files /dev/null and b/extras/PandoraFMS_android_console/bin/classes/pandorafms/pandorafmsandroidconsole/Help.class differ diff --git a/extras/PandoraFMS_android_console/bin/classes/pandorafms/pandorafmsandroidconsole/Options$1.class b/extras/PandoraFMS_android_console/bin/classes/pandorafms/pandorafmsandroidconsole/Options$1.class new file mode 100644 index 0000000000..c2b2050afb Binary files /dev/null and b/extras/PandoraFMS_android_console/bin/classes/pandorafms/pandorafmsandroidconsole/Options$1.class differ diff --git a/extras/PandoraFMS_android_console/bin/classes/pandorafms/pandorafmsandroidconsole/Options$2.class b/extras/PandoraFMS_android_console/bin/classes/pandorafms/pandorafmsandroidconsole/Options$2.class new file mode 100644 index 0000000000..8a8fa97a9b Binary files /dev/null and b/extras/PandoraFMS_android_console/bin/classes/pandorafms/pandorafmsandroidconsole/Options$2.class differ diff --git a/extras/PandoraFMS_android_console/bin/classes/pandorafms/pandorafmsandroidconsole/Options.class b/extras/PandoraFMS_android_console/bin/classes/pandorafms/pandorafmsandroidconsole/Options.class new file mode 100644 index 0000000000..c3748b235f Binary files /dev/null and b/extras/PandoraFMS_android_console/bin/classes/pandorafms/pandorafmsandroidconsole/Options.class differ diff --git a/extras/PandoraFMS_android_console/bin/classes/pandorafms/pandorafmsandroidconsole/PandoraWebView$1.class b/extras/PandoraFMS_android_console/bin/classes/pandorafms/pandorafmsandroidconsole/PandoraWebView$1.class new file mode 100644 index 0000000000..2f2099204b Binary files /dev/null and b/extras/PandoraFMS_android_console/bin/classes/pandorafms/pandorafmsandroidconsole/PandoraWebView$1.class differ diff --git a/extras/PandoraFMS_android_console/bin/classes/pandorafms/pandorafmsandroidconsole/PandoraWebView.class b/extras/PandoraFMS_android_console/bin/classes/pandorafms/pandorafmsandroidconsole/PandoraWebView.class new file mode 100644 index 0000000000..9621cbda9a Binary files /dev/null and b/extras/PandoraFMS_android_console/bin/classes/pandorafms/pandorafmsandroidconsole/PandoraWebView.class differ diff --git a/extras/PandoraFMS_android_console/bin/classes/pandorafms/pandorafmsandroidconsole/R$attr.class b/extras/PandoraFMS_android_console/bin/classes/pandorafms/pandorafmsandroidconsole/R$attr.class new file mode 100644 index 0000000000..1883d7c262 Binary files /dev/null and b/extras/PandoraFMS_android_console/bin/classes/pandorafms/pandorafmsandroidconsole/R$attr.class differ diff --git a/extras/PandoraFMS_android_console/bin/classes/pandorafms/pandorafmsandroidconsole/R$dimen.class b/extras/PandoraFMS_android_console/bin/classes/pandorafms/pandorafmsandroidconsole/R$dimen.class new file mode 100644 index 0000000000..9b55c67ec6 Binary files /dev/null and b/extras/PandoraFMS_android_console/bin/classes/pandorafms/pandorafmsandroidconsole/R$dimen.class differ diff --git a/extras/PandoraFMS_android_console/bin/classes/pandorafms/pandorafmsandroidconsole/R$drawable.class b/extras/PandoraFMS_android_console/bin/classes/pandorafms/pandorafmsandroidconsole/R$drawable.class new file mode 100644 index 0000000000..edf6821931 Binary files /dev/null and b/extras/PandoraFMS_android_console/bin/classes/pandorafms/pandorafmsandroidconsole/R$drawable.class differ diff --git a/extras/PandoraFMS_android_console/bin/classes/pandorafms/pandorafmsandroidconsole/R$id.class b/extras/PandoraFMS_android_console/bin/classes/pandorafms/pandorafmsandroidconsole/R$id.class new file mode 100644 index 0000000000..14af4e5c7e Binary files /dev/null and b/extras/PandoraFMS_android_console/bin/classes/pandorafms/pandorafmsandroidconsole/R$id.class differ diff --git a/extras/PandoraFMS_android_console/bin/classes/pandorafms/pandorafmsandroidconsole/R$layout.class b/extras/PandoraFMS_android_console/bin/classes/pandorafms/pandorafmsandroidconsole/R$layout.class new file mode 100644 index 0000000000..5e00a17eb0 Binary files /dev/null and b/extras/PandoraFMS_android_console/bin/classes/pandorafms/pandorafmsandroidconsole/R$layout.class differ diff --git a/extras/PandoraFMS_android_console/bin/classes/pandorafms/pandorafmsandroidconsole/R$menu.class b/extras/PandoraFMS_android_console/bin/classes/pandorafms/pandorafmsandroidconsole/R$menu.class new file mode 100644 index 0000000000..c58f15fc26 Binary files /dev/null and b/extras/PandoraFMS_android_console/bin/classes/pandorafms/pandorafmsandroidconsole/R$menu.class differ diff --git a/extras/PandoraFMS_android_console/bin/classes/pandorafms/pandorafmsandroidconsole/R$string.class b/extras/PandoraFMS_android_console/bin/classes/pandorafms/pandorafmsandroidconsole/R$string.class new file mode 100644 index 0000000000..ab1545ced9 Binary files /dev/null and b/extras/PandoraFMS_android_console/bin/classes/pandorafms/pandorafmsandroidconsole/R$string.class differ diff --git a/extras/PandoraFMS_android_console/bin/classes/pandorafms/pandorafmsandroidconsole/R$style.class b/extras/PandoraFMS_android_console/bin/classes/pandorafms/pandorafmsandroidconsole/R$style.class new file mode 100644 index 0000000000..0f4e787ea0 Binary files /dev/null and b/extras/PandoraFMS_android_console/bin/classes/pandorafms/pandorafmsandroidconsole/R$style.class differ diff --git a/extras/PandoraFMS_android_console/bin/classes/pandorafms/pandorafmsandroidconsole/R.class b/extras/PandoraFMS_android_console/bin/classes/pandorafms/pandorafmsandroidconsole/R.class new file mode 100644 index 0000000000..185ac6a9d8 Binary files /dev/null and b/extras/PandoraFMS_android_console/bin/classes/pandorafms/pandorafmsandroidconsole/R.class differ diff --git a/extras/PandoraFMS_android_console/gen/pandorafms/pandorafmsandroidconsole/BuildConfig.java b/extras/PandoraFMS_android_console/gen/pandorafms/pandorafmsandroidconsole/BuildConfig.java new file mode 100644 index 0000000000..b23ef8eb13 --- /dev/null +++ b/extras/PandoraFMS_android_console/gen/pandorafms/pandorafmsandroidconsole/BuildConfig.java @@ -0,0 +1,6 @@ +/** Automatically generated file. DO NOT MODIFY */ +package pandorafms.pandorafmsandroidconsole; + +public final class BuildConfig { + public final static boolean DEBUG = true; +} \ No newline at end of file diff --git a/extras/PandoraFMS_android_console/gen/pandorafms/pandorafmsandroidconsole/R.java b/extras/PandoraFMS_android_console/gen/pandorafms/pandorafmsandroidconsole/R.java new file mode 100644 index 0000000000..e22b99b3ab --- /dev/null +++ b/extras/PandoraFMS_android_console/gen/pandorafms/pandorafmsandroidconsole/R.java @@ -0,0 +1,118 @@ +/* AUTO-GENERATED FILE. DO NOT MODIFY. + * + * This class was automatically generated by the + * aapt tool from the resource data it found. It + * should not be modified by hand. + */ + +package pandorafms.pandorafmsandroidconsole; + +public final class R { + public static final class attr { + } + public static final class dimen { + /** Default screen margins, per the Android Design guidelines. + + Customize dimensions originally defined in res/values/dimens.xml (such as + screen margins) for sw720dp devices (e.g. 10" tablets) in landscape here. + + */ + public static final int activity_horizontal_margin=0x7f040000; + public static final int activity_vertical_margin=0x7f040001; + } + public static final class drawable { + public static final int config=0x7f020000; + public static final int exit=0x7f020001; + public static final int help=0x7f020002; + public static final int ic_launcher=0x7f020003; + public static final int loading=0x7f020004; + public static final int loading_1=0x7f020005; + public static final int loading_10=0x7f020006; + public static final int loading_11=0x7f020007; + public static final int loading_12=0x7f020008; + public static final int loading_2=0x7f020009; + public static final int loading_3=0x7f02000a; + public static final int loading_4=0x7f02000b; + public static final int loading_5=0x7f02000c; + public static final int loading_6=0x7f02000d; + public static final int loading_7=0x7f02000e; + public static final int loading_8=0x7f02000f; + public static final int loading_9=0x7f020010; + public static final int pandorafms_logo=0x7f020011; + public static final int refresh=0x7f020012; + } + public static final class id { + public static final int cancel_options=0x7f080008; + public static final int exit_button_menu_options=0x7f08000d; + public static final int help_button_menu_options=0x7f08000c; + public static final int img_logo_about=0x7f080002; + public static final int loading_anim=0x7f080001; + public static final int options_button_menu_options=0x7f08000a; + public static final int password_option=0x7f080007; + public static final int refresh_button_menu_options=0x7f08000b; + public static final int save_options=0x7f080009; + public static final int tableRow1=0x7f080004; + public static final int url_option=0x7f080005; + public static final int url_pandora=0x7f080003; + public static final int user_option=0x7f080006; + public static final int webview=0x7f080000; + } + public static final class layout { + public static final int activity_web_view=0x7f030000; + public static final int connection_custom_toast=0x7f030001; + public static final int help=0x7f030002; + public static final int options=0x7f030003; + } + public static final class menu { + public static final int web_view=0x7f070000; + } + public static final class string { + public static final int app_name=0x7f050001; + public static final int cancel_button_str=0x7f050010; + public static final int connection_str=0x7f050011; + public static final int const_string_preferences=0x7f050000; + public static final int dont_show_again=0x7f050007; + public static final int exit_label_str=0x7f050005; + public static final int help_label_str=0x7f050003; + public static final int loading_desc=0x7f050012; + public static final int options_label_str=0x7f050002; + public static final int pandorafms_logo_description=0x7f050006; + public static final int pandroid_info_long_txt=0x7f050009; + public static final int pandroid_info_txt=0x7f050008; + public static final int pandroid_options_txt=0x7f05000a; + public static final int password_option=0x7f05000d; + public static final int refresh_label_str=0x7f050004; + public static final int save_button_str=0x7f05000e; + public static final int update_button_str=0x7f05000f; + public static final int url_option=0x7f05000b; + public static final int user_option=0x7f05000c; + } + public static final class style { + /** + Base application theme, dependent on API level. This theme is replaced + by AppBaseTheme from res/values-vXX/styles.xml on newer devices. + + + Theme customizations available in newer API levels can go in + res/values-vXX/styles.xml, while customizations related to + backward-compatibility can go here. + + + Base application theme for API 11+. This theme completely replaces + AppBaseTheme from res/values/styles.xml on API 11+ devices. + + API 11 theme customizations can go here. + + Base application theme for API 14+. This theme completely replaces + AppBaseTheme from BOTH res/values/styles.xml and + res/values-v11/styles.xml on API 14+ devices. + + API 14 theme customizations can go here. + */ + public static final int AppBaseTheme=0x7f060000; + /** Application theme. + All customizations that are NOT specific to a particular API-level can go here. + */ + public static final int AppTheme=0x7f060001; + } +} diff --git a/extras/PandoraFMS_android_console/ic_launcher-web.png b/extras/PandoraFMS_android_console/ic_launcher-web.png new file mode 100644 index 0000000000..a18cbb48c4 Binary files /dev/null and b/extras/PandoraFMS_android_console/ic_launcher-web.png differ diff --git a/extras/PandoraFMS_android_console/libs/android-support-v4.jar b/extras/PandoraFMS_android_console/libs/android-support-v4.jar new file mode 100644 index 0000000000..6080877d4a Binary files /dev/null and b/extras/PandoraFMS_android_console/libs/android-support-v4.jar differ diff --git a/extras/PandoraFMS_android_console/proguard-project.txt b/extras/PandoraFMS_android_console/proguard-project.txt new file mode 100644 index 0000000000..f2fe1559a2 --- /dev/null +++ b/extras/PandoraFMS_android_console/proguard-project.txt @@ -0,0 +1,20 @@ +# To enable ProGuard in your project, edit project.properties +# to define the proguard.config property as described in that file. +# +# Add project specific ProGuard rules here. +# By default, the flags in this file are appended to flags specified +# in ${sdk.dir}/tools/proguard/proguard-android.txt +# You can edit the include path and order by changing the ProGuard +# include property in project.properties. +# +# 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 *; +#} diff --git a/extras/PandoraFMS_android_console/project.properties b/extras/PandoraFMS_android_console/project.properties new file mode 100644 index 0000000000..a3ee5ab64f --- /dev/null +++ b/extras/PandoraFMS_android_console/project.properties @@ -0,0 +1,14 @@ +# This file is automatically generated by Android Tools. +# Do not modify this file -- YOUR CHANGES WILL BE ERASED! +# +# This file must be checked in Version Control Systems. +# +# To customize properties used by the Ant build system edit +# "ant.properties", and override values to adapt the script to your +# project structure. +# +# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home): +#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt + +# Project target. +target=android-17 diff --git a/extras/PandoraFMS_android_console/res/drawable-hdpi/ic_launcher.png b/extras/PandoraFMS_android_console/res/drawable-hdpi/ic_launcher.png new file mode 100644 index 0000000000..288b66551d Binary files /dev/null and b/extras/PandoraFMS_android_console/res/drawable-hdpi/ic_launcher.png differ diff --git a/extras/PandoraFMS_android_console/res/drawable-ldpi/config.png b/extras/PandoraFMS_android_console/res/drawable-ldpi/config.png new file mode 100644 index 0000000000..a10dc9d5e3 Binary files /dev/null and b/extras/PandoraFMS_android_console/res/drawable-ldpi/config.png differ diff --git a/extras/PandoraFMS_android_console/res/drawable-ldpi/exit.png b/extras/PandoraFMS_android_console/res/drawable-ldpi/exit.png new file mode 100755 index 0000000000..33a383748b Binary files /dev/null and b/extras/PandoraFMS_android_console/res/drawable-ldpi/exit.png differ diff --git a/extras/PandoraFMS_android_console/res/drawable-ldpi/help.png b/extras/PandoraFMS_android_console/res/drawable-ldpi/help.png new file mode 100644 index 0000000000..85c1876b5f Binary files /dev/null and b/extras/PandoraFMS_android_console/res/drawable-ldpi/help.png differ diff --git a/extras/PandoraFMS_android_console/res/drawable-ldpi/pandorafms_logo.png b/extras/PandoraFMS_android_console/res/drawable-ldpi/pandorafms_logo.png new file mode 100644 index 0000000000..bf07e40562 Binary files /dev/null and b/extras/PandoraFMS_android_console/res/drawable-ldpi/pandorafms_logo.png differ diff --git a/extras/PandoraFMS_android_console/res/drawable-ldpi/refresh.png b/extras/PandoraFMS_android_console/res/drawable-ldpi/refresh.png new file mode 100755 index 0000000000..7da5cfd01f Binary files /dev/null and b/extras/PandoraFMS_android_console/res/drawable-ldpi/refresh.png differ diff --git a/extras/PandoraFMS_android_console/res/drawable-mdpi/ic_launcher.png b/extras/PandoraFMS_android_console/res/drawable-mdpi/ic_launcher.png new file mode 100644 index 0000000000..6ae570b4db Binary files /dev/null and b/extras/PandoraFMS_android_console/res/drawable-mdpi/ic_launcher.png differ diff --git a/extras/PandoraFMS_android_console/res/drawable-xhdpi/ic_launcher.png b/extras/PandoraFMS_android_console/res/drawable-xhdpi/ic_launcher.png new file mode 100644 index 0000000000..d4fb7cd9d8 Binary files /dev/null and b/extras/PandoraFMS_android_console/res/drawable-xhdpi/ic_launcher.png differ diff --git a/extras/PandoraFMS_android_console/res/drawable-xxhdpi/ic_launcher.png b/extras/PandoraFMS_android_console/res/drawable-xxhdpi/ic_launcher.png new file mode 100644 index 0000000000..85a6081587 Binary files /dev/null and b/extras/PandoraFMS_android_console/res/drawable-xxhdpi/ic_launcher.png differ diff --git a/extras/PandoraFMS_android_console/res/drawable/loading.xml b/extras/PandoraFMS_android_console/res/drawable/loading.xml new file mode 100644 index 0000000000..dfb91ce015 --- /dev/null +++ b/extras/PandoraFMS_android_console/res/drawable/loading.xml @@ -0,0 +1,14 @@ +<animation-list xmlns:android="http://schemas.android.com/apk/res/android" android:oneshot="false"> + <item android:drawable="@drawable/loading_1" android:duration="60" /> + <item android:drawable="@drawable/loading_2" android:duration="60" /> + <item android:drawable="@drawable/loading_3" android:duration="60" /> + <item android:drawable="@drawable/loading_4" android:duration="60" /> + <item android:drawable="@drawable/loading_5" android:duration="60" /> + <item android:drawable="@drawable/loading_6" android:duration="60" /> + <item android:drawable="@drawable/loading_7" android:duration="60" /> + <item android:drawable="@drawable/loading_8" android:duration="60" /> + <item android:drawable="@drawable/loading_9" android:duration="60" /> + <item android:drawable="@drawable/loading_10" android:duration="60" /> + <item android:drawable="@drawable/loading_11" android:duration="60" /> + <item android:drawable="@drawable/loading_12" android:duration="60" /> +</animation-list> \ No newline at end of file diff --git a/extras/PandoraFMS_android_console/res/drawable/loading_1.png b/extras/PandoraFMS_android_console/res/drawable/loading_1.png new file mode 100644 index 0000000000..8d6d0cf4ad Binary files /dev/null and b/extras/PandoraFMS_android_console/res/drawable/loading_1.png differ diff --git a/extras/PandoraFMS_android_console/res/drawable/loading_10.png b/extras/PandoraFMS_android_console/res/drawable/loading_10.png new file mode 100644 index 0000000000..cdcfc7788d Binary files /dev/null and b/extras/PandoraFMS_android_console/res/drawable/loading_10.png differ diff --git a/extras/PandoraFMS_android_console/res/drawable/loading_11.png b/extras/PandoraFMS_android_console/res/drawable/loading_11.png new file mode 100644 index 0000000000..f3cdb9e434 Binary files /dev/null and b/extras/PandoraFMS_android_console/res/drawable/loading_11.png differ diff --git a/extras/PandoraFMS_android_console/res/drawable/loading_12.png b/extras/PandoraFMS_android_console/res/drawable/loading_12.png new file mode 100644 index 0000000000..b6a9900850 Binary files /dev/null and b/extras/PandoraFMS_android_console/res/drawable/loading_12.png differ diff --git a/extras/PandoraFMS_android_console/res/drawable/loading_2.png b/extras/PandoraFMS_android_console/res/drawable/loading_2.png new file mode 100644 index 0000000000..ee875c2d5b Binary files /dev/null and b/extras/PandoraFMS_android_console/res/drawable/loading_2.png differ diff --git a/extras/PandoraFMS_android_console/res/drawable/loading_3.png b/extras/PandoraFMS_android_console/res/drawable/loading_3.png new file mode 100644 index 0000000000..af2b00a106 Binary files /dev/null and b/extras/PandoraFMS_android_console/res/drawable/loading_3.png differ diff --git a/extras/PandoraFMS_android_console/res/drawable/loading_4.png b/extras/PandoraFMS_android_console/res/drawable/loading_4.png new file mode 100644 index 0000000000..e6b6e22bc8 Binary files /dev/null and b/extras/PandoraFMS_android_console/res/drawable/loading_4.png differ diff --git a/extras/PandoraFMS_android_console/res/drawable/loading_5.png b/extras/PandoraFMS_android_console/res/drawable/loading_5.png new file mode 100644 index 0000000000..b0b58fef06 Binary files /dev/null and b/extras/PandoraFMS_android_console/res/drawable/loading_5.png differ diff --git a/extras/PandoraFMS_android_console/res/drawable/loading_6.png b/extras/PandoraFMS_android_console/res/drawable/loading_6.png new file mode 100644 index 0000000000..9cab37cf30 Binary files /dev/null and b/extras/PandoraFMS_android_console/res/drawable/loading_6.png differ diff --git a/extras/PandoraFMS_android_console/res/drawable/loading_7.png b/extras/PandoraFMS_android_console/res/drawable/loading_7.png new file mode 100644 index 0000000000..a71c8cc8aa Binary files /dev/null and b/extras/PandoraFMS_android_console/res/drawable/loading_7.png differ diff --git a/extras/PandoraFMS_android_console/res/drawable/loading_8.png b/extras/PandoraFMS_android_console/res/drawable/loading_8.png new file mode 100644 index 0000000000..606fe83867 Binary files /dev/null and b/extras/PandoraFMS_android_console/res/drawable/loading_8.png differ diff --git a/extras/PandoraFMS_android_console/res/drawable/loading_9.png b/extras/PandoraFMS_android_console/res/drawable/loading_9.png new file mode 100644 index 0000000000..b8b33c96a2 Binary files /dev/null and b/extras/PandoraFMS_android_console/res/drawable/loading_9.png differ diff --git a/extras/PandoraFMS_android_console/res/layout/activity_web_view.xml b/extras/PandoraFMS_android_console/res/layout/activity_web_view.xml new file mode 100644 index 0000000000..b9912c891f --- /dev/null +++ b/extras/PandoraFMS_android_console/res/layout/activity_web_view.xml @@ -0,0 +1,16 @@ +<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:paddingBottom="0px" + android:paddingLeft="0px" + android:paddingRight="0px" + android:paddingTop="0px" + tools:context=".WebView" > + + <WebView + android:id="@+id/webview" + android:layout_width="fill_parent" + android:layout_height="fill_parent" /> + +</RelativeLayout> \ No newline at end of file diff --git a/extras/PandoraFMS_android_console/res/layout/connection_custom_toast.xml b/extras/PandoraFMS_android_console/res/layout/connection_custom_toast.xml new file mode 100644 index 0000000000..4ae89e9165 --- /dev/null +++ b/extras/PandoraFMS_android_console/res/layout/connection_custom_toast.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="utf-8"?> +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:orientation="vertical" + android:layout_width="fill_parent" + android:layout_height="fill_parent" + android:padding="10dip" + android:gravity="center" > + + <ImageView + android:id="@+id/loading_anim" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:contentDescription="@string/loading_desc" /> + +</LinearLayout> \ No newline at end of file diff --git a/extras/PandoraFMS_android_console/res/layout/help.xml b/extras/PandoraFMS_android_console/res/layout/help.xml new file mode 100644 index 0000000000..fb9fbf372c --- /dev/null +++ b/extras/PandoraFMS_android_console/res/layout/help.xml @@ -0,0 +1,36 @@ +<?xml version="1.0" encoding="utf-8"?> +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:orientation="vertical" + android:layout_width="fill_parent" + android:layout_height="fill_parent" + android:padding="10dip" + android:gravity="center" > + + <ImageView + android:layout_weight="0" + android:contentDescription="@string/pandorafms_logo_description" + android:id="@+id/img_logo_about" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center" + android:padding="5dp" + android:src="@drawable/pandorafms_logo" /> + + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@string/pandroid_info_txt" /> + + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@string/pandroid_info_long_txt" + android:gravity="center_horizontal" /> + + <TextView + android:id="@+id/url_pandora" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:gravity="center_horizontal" /> + +</LinearLayout> \ No newline at end of file diff --git a/extras/PandoraFMS_android_console/res/layout/options.xml b/extras/PandoraFMS_android_console/res/layout/options.xml new file mode 100644 index 0000000000..b73add53fb --- /dev/null +++ b/extras/PandoraFMS_android_console/res/layout/options.xml @@ -0,0 +1,112 @@ +<?xml version="1.0" encoding="utf-8"?> +<ScrollView + xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="fill_parent" + android:layout_height="wrap_content"> + <LinearLayout + android:orientation="vertical" + android:layout_width="fill_parent" + android:layout_height="fill_parent" + android:padding="10dip" > + + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@string/pandroid_options_txt" + /> + + <TableLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" > + + <TableRow + android:id="@+id/tableRow1" + android:layout_width="fill_parent" + android:layout_height="wrap_content" > + + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@string/url_option" + android:singleLine="true" + android:layout_weight="1" /> + + <EditText + android:id="@+id/url_option" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:inputType="text" + android:layout_weight="5" /> + + </TableRow> + + <TableRow + android:layout_width="fill_parent" + android:layout_height="wrap_content" > + + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@string/user_option" + android:singleLine="true" + android:layout_weight="1" /> + + <EditText + android:id="@+id/user_option" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:inputType="text" + android:layout_weight="5" /> + + </TableRow> + + <TableRow + android:layout_width="fill_parent" + android:layout_height="wrap_content" > + + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@string/password_option" + android:singleLine="true" + android:layout_weight="1" /> + + <EditText + android:id="@+id/password_option" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:inputType="textPassword" + android:layout_weight="5" /> + + </TableRow> + + <TableRow + android:layout_width="fill_parent" + android:layout_height="wrap_content" > + + <Button + android:id="@+id/cancel_options" + android:layout_width="fill_parent" + android:layout_height="wrap_content" + android:layout_gravity="center" + android:layout_marginLeft="5dp" + android:layout_marginRight="5dp" + android:text="@string/cancel_button_str" + android:layout_weight="1" /> + + <Button + android:id="@+id/save_options" + android:layout_width="fill_parent" + android:layout_height="wrap_content" + android:layout_gravity="center" + android:layout_marginLeft="5dp" + android:layout_marginRight="5dp" + android:text="@string/save_button_str" + android:layout_weight="1" /> + + </TableRow> + + </TableLayout> + +</LinearLayout> +</ScrollView> \ No newline at end of file diff --git a/extras/PandoraFMS_android_console/res/menu/web_view.xml b/extras/PandoraFMS_android_console/res/menu/web_view.xml new file mode 100644 index 0000000000..09e72041aa --- /dev/null +++ b/extras/PandoraFMS_android_console/res/menu/web_view.xml @@ -0,0 +1,24 @@ +<menu xmlns:android="http://schemas.android.com/apk/res/android" > + + <item + android:id="@+id/options_button_menu_options" + android:icon="@drawable/config" + android:title="@string/options_label_str" /> + + <item + android:id="@+id/refresh_button_menu_options" + android:icon="@drawable/refresh" + android:title="@string/refresh_label_str" /> + + + <item + android:id="@+id/help_button_menu_options" + android:icon="@drawable/help" + android:title="@string/help_label_str" /> + + <item + android:id="@+id/exit_button_menu_options" + android:icon="@drawable/exit" + android:title="@string/exit_label_str" /> + +</menu> \ No newline at end of file diff --git a/extras/PandoraFMS_android_console/res/values-es/strings.xml b/extras/PandoraFMS_android_console/res/values-es/strings.xml new file mode 100644 index 0000000000..6b808ee61b --- /dev/null +++ b/extras/PandoraFMS_android_console/res/values-es/strings.xml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + + <string name="app_name">Pandora FMS Android Console</string> + <string name="options_label_str">Opciones</string> + <string name="help_label_str">Ayuda</string> + <string name="refresh_label_str">Refrescar</string> + <string name="exit_label_str">Salir</string> + <string name="pandorafms_logo_description">Logo PandoraFMS</string> + <string name="dont_show_again">No mostrar más</string> + <string name="pandroid_info_txt">Need a large string for to fill this space with pretty things and rainbows.</string> + <string name="pandroid_info_long_txt">Need a large string for to fill this space with pretty things and rainbows.</string> + <string name="pandroid_options_txt">Need a large string for to fill this space with pretty things and rainbows.</string> + <string name="url_option">URL:</string> + <string name="user_option">Usuario:</string> + <string name="password_option">Contraseña:</string> + <string name="save_button_str">Guardar</string> + <string name="update_button_str">Actualizar</string> + <string name="cancel_button_str">Cancelar</string> + +</resources> \ No newline at end of file diff --git a/extras/PandoraFMS_android_console/res/values-ja/strings.xml b/extras/PandoraFMS_android_console/res/values-ja/strings.xml new file mode 100644 index 0000000000..e418af53c8 --- /dev/null +++ b/extras/PandoraFMS_android_console/res/values-ja/strings.xml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + + <string name="app_name">Pandora FMS Android Console</string> + <string name="options_label_str">オプション</string> + <string name="help_label_str">Help</string> + <string name="refresh_label_str">Refresh</string> + <string name="exit_label_str">Exit</string> + <string name="pandorafms_logo_description">PandoraFMS\'s logo</string> + <string name="dont_show_again">Don\'t show again</string> + <string name="pandroid_info_txt">Need a large string for to fill this space with pretty things and rainbows.</string> + <string name="pandroid_info_long_txt">Need a large string for to fill this space with pretty things and rainbows.</string> + <string name="pandroid_options_txt">Need a large string for to fill this space with pretty things and rainbows.</string> + <string name="url_option">URL:</string> + <string name="user_option">User:</string> + <string name="password_option">Password:</string> + <string name="save_button_str">Save</string> + <string name="update_button_str">Update</string> + <string name="cancel_button_str">Cancel</string> + +</resources> \ No newline at end of file diff --git a/extras/PandoraFMS_android_console/res/values-sw600dp/dimens.xml b/extras/PandoraFMS_android_console/res/values-sw600dp/dimens.xml new file mode 100644 index 0000000000..1ba777d65d --- /dev/null +++ b/extras/PandoraFMS_android_console/res/values-sw600dp/dimens.xml @@ -0,0 +1,8 @@ +<resources> + + <!-- + Customize dimensions originally defined in res/values/dimens.xml (such as + screen margins) for sw600dp devices (e.g. 7" tablets) here. + --> + +</resources> \ No newline at end of file diff --git a/extras/PandoraFMS_android_console/res/values-sw720dp-land/dimens.xml b/extras/PandoraFMS_android_console/res/values-sw720dp-land/dimens.xml new file mode 100644 index 0000000000..eee741a510 --- /dev/null +++ b/extras/PandoraFMS_android_console/res/values-sw720dp-land/dimens.xml @@ -0,0 +1,9 @@ +<resources> + + <!-- + Customize dimensions originally defined in res/values/dimens.xml (such as + screen margins) for sw720dp devices (e.g. 10" tablets) in landscape here. + --> + <dimen name="activity_horizontal_margin">128dp</dimen> + +</resources> \ No newline at end of file diff --git a/extras/PandoraFMS_android_console/res/values-v11/styles.xml b/extras/PandoraFMS_android_console/res/values-v11/styles.xml new file mode 100644 index 0000000000..541752f6ed --- /dev/null +++ b/extras/PandoraFMS_android_console/res/values-v11/styles.xml @@ -0,0 +1,11 @@ +<resources> + + <!-- + Base application theme for API 11+. This theme completely replaces + AppBaseTheme from res/values/styles.xml on API 11+ devices. + --> + <style name="AppBaseTheme" parent="android:Theme.Holo.Light"> + <!-- API 11 theme customizations can go here. --> + </style> + +</resources> \ No newline at end of file diff --git a/extras/PandoraFMS_android_console/res/values-v14/styles.xml b/extras/PandoraFMS_android_console/res/values-v14/styles.xml new file mode 100644 index 0000000000..f20e01501d --- /dev/null +++ b/extras/PandoraFMS_android_console/res/values-v14/styles.xml @@ -0,0 +1,12 @@ +<resources> + + <!-- + Base application theme for API 14+. This theme completely replaces + AppBaseTheme from BOTH res/values/styles.xml and + res/values-v11/styles.xml on API 14+ devices. + --> + <style name="AppBaseTheme" parent="android:Theme.Holo.Light.DarkActionBar"> + <!-- API 14 theme customizations can go here. --> + </style> + +</resources> \ No newline at end of file diff --git a/extras/PandoraFMS_android_console/res/values/dimens.xml b/extras/PandoraFMS_android_console/res/values/dimens.xml new file mode 100644 index 0000000000..a6dd14032e --- /dev/null +++ b/extras/PandoraFMS_android_console/res/values/dimens.xml @@ -0,0 +1,7 @@ +<resources> + + <!-- Default screen margins, per the Android Design guidelines. --> + <dimen name="activity_horizontal_margin">16dp</dimen> + <dimen name="activity_vertical_margin">16dp</dimen> + +</resources> \ No newline at end of file diff --git a/extras/PandoraFMS_android_console/res/values/strings.xml b/extras/PandoraFMS_android_console/res/values/strings.xml new file mode 100644 index 0000000000..6502f5ba9e --- /dev/null +++ b/extras/PandoraFMS_android_console/res/values/strings.xml @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + + <string name="const_string_preferences">PANDROID_EVENT_VIEWER_PREFERENCES</string> + <string name="app_name">Pandora FMS Android Console</string> + + <string name="options_label_str">Options</string> + <string name="help_label_str">Help</string> + <string name="refresh_label_str">Refresh</string> + <string name="exit_label_str">Exit</string> + <string name="pandorafms_logo_description">PandoraFMS\'s logo</string> + <string name="dont_show_again">Don\'t show again</string> + <string name="pandroid_info_txt">Need a large string for to fill this space with pretty things and rainbows.</string> + <string name="pandroid_info_long_txt">Need a large string for to fill this space with pretty things and rainbows.</string> + <string name="pandroid_options_txt">Need a large string for to fill this space with pretty things and rainbows.</string> + <string name="url_option">URL:</string> + <string name="user_option">User:</string> + <string name="password_option">Password:</string> + <string name="save_button_str">Save</string> + <string name="update_button_str">Update</string> + <string name="cancel_button_str">Cancel</string> + <string name="connection_str">Connecting…</string> + <string name="loading_desc">Connecting…</string> + +</resources> \ No newline at end of file diff --git a/extras/PandoraFMS_android_console/res/values/styles.xml b/extras/PandoraFMS_android_console/res/values/styles.xml new file mode 100644 index 0000000000..4a10ca492d --- /dev/null +++ b/extras/PandoraFMS_android_console/res/values/styles.xml @@ -0,0 +1,20 @@ +<resources> + + <!-- + Base application theme, dependent on API level. This theme is replaced + by AppBaseTheme from res/values-vXX/styles.xml on newer devices. + --> + <style name="AppBaseTheme" parent="android:Theme.Light"> + <!-- + Theme customizations available in newer API levels can go in + res/values-vXX/styles.xml, while customizations related to + backward-compatibility can go here. + --> + </style> + + <!-- Application theme. --> + <style name="AppTheme" parent="AppBaseTheme"> + <!-- All customizations that are NOT specific to a particular API-level can go here. --> + </style> + +</resources> \ No newline at end of file diff --git a/extras/PandoraFMS_android_console/src/pandorafms/pandorafmsandroidconsole/ConnectionCustomToast.java b/extras/PandoraFMS_android_console/src/pandorafms/pandorafmsandroidconsole/ConnectionCustomToast.java new file mode 100644 index 0000000000..2e2dcd4af6 --- /dev/null +++ b/extras/PandoraFMS_android_console/src/pandorafms/pandorafmsandroidconsole/ConnectionCustomToast.java @@ -0,0 +1,53 @@ +/* +Pandora FMS - http://pandorafms.com + +================================================== +Copyright (c) 2005-2011 Artica Soluciones Tecnologicas +Please see http://pandorafms.org for full contribution list + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public License +as published by the Free Software Foundation; version 2 + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. +*/ + +/** + * Activity of help view. + * + * @author Miguel de Dios Matías + * + */ + +package pandorafms.pandorafmsandroidconsole; + +import android.app.Activity; +import android.graphics.drawable.AnimationDrawable; +import android.os.Bundle; +import android.widget.ImageView; + +public class ConnectionCustomToast extends Activity { + private AnimationDrawable loadAnimation; + public static Activity activity; + + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + //Hack to close the activity from other activity. + activity = this; + + setContentView(R.layout.connection_custom_toast); + + ImageView loading_anim = (ImageView)findViewById(R.id.loading_anim); + loading_anim.setImageResource(R.drawable.loading); + loadAnimation = (AnimationDrawable)loading_anim.getDrawable(); + } + + @Override + public void onWindowFocusChanged(boolean hasFocus){ + loadAnimation.start(); + } +} diff --git a/extras/PandoraFMS_android_console/src/pandorafms/pandorafmsandroidconsole/Help.java b/extras/PandoraFMS_android_console/src/pandorafms/pandorafmsandroidconsole/Help.java new file mode 100644 index 0000000000..65a01149d4 --- /dev/null +++ b/extras/PandoraFMS_android_console/src/pandorafms/pandorafmsandroidconsole/Help.java @@ -0,0 +1,47 @@ +/* +Pandora FMS - http://pandorafms.com + +================================================== +Copyright (c) 2005-2011 Artica Soluciones Tecnologicas +Please see http://pandorafms.org for full contribution list + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public License +as published by the Free Software Foundation; version 2 + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. +*/ + +/** + * Activity of help view. + * + * @author Miguel de Dios Matías + * + */ + +package pandorafms.pandorafmsandroidconsole; + +import android.app.Activity; +import android.content.SharedPreferences; +import android.os.Bundle; +import android.text.Html; +import android.text.method.LinkMovementMethod; +import android.view.View; +import android.widget.CheckBox; +import android.widget.TextView; + +public class Help extends Activity { + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + setContentView(R.layout.help); + + TextView text = (TextView) findViewById(R.id.url_pandora); + text.setText(Html + .fromHtml("<a href='http://pandorafms.org/'>PandoraFMS.org</a>")); + text.setMovementMethod(LinkMovementMethod.getInstance()); + } +} diff --git a/extras/PandoraFMS_android_console/src/pandorafms/pandorafmsandroidconsole/Options.java b/extras/PandoraFMS_android_console/src/pandorafms/pandorafmsandroidconsole/Options.java new file mode 100644 index 0000000000..c235280b84 --- /dev/null +++ b/extras/PandoraFMS_android_console/src/pandorafms/pandorafmsandroidconsole/Options.java @@ -0,0 +1,101 @@ +/* +Pandora FMS - http://pandorafms.com + +================================================== +Copyright (c) 2005-2011 Artica Soluciones Tecnologicas +Please see http://pandorafms.org for full contribution list + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public License +as published by the Free Software Foundation; version 2 + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. +*/ + +/** + * Activity of option view. + * + * @author Miguel de Dios Matías + * + */ + +package pandorafms.pandorafmsandroidconsole; + +import android.app.Activity; +import android.content.Intent; +import android.content.SharedPreferences; +import android.os.Bundle; +import android.view.View; +import android.widget.Button; +import android.widget.EditText; + +public class Options extends Activity { + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + setContentView(R.layout.options); + + Button save_button = (Button)findViewById(R.id.save_options); + Button cancel_button = (Button)findViewById(R.id.cancel_options); + + SharedPreferences preferences = getSharedPreferences( + getString(R.string.const_string_preferences), + Activity.MODE_PRIVATE); + + EditText field; + + field = (EditText)findViewById(R.id.url_option); + String url_pandora = preferences.getString("url_pandora", ""); + field.setText(url_pandora); + field = (EditText)findViewById(R.id.user_option); + String user = preferences.getString("user", ""); + field.setText(user); + field = (EditText)findViewById(R.id.password_option); + String password = preferences.getString("password", ""); + field.setText(password); + + //Check if not empty the data of connection + if (!url_pandora.equals("") && !user.equals("") && !password.equals("")) { + //And set the label of button as update + save_button.setText(getString(R.string.update_button_str)); + } + + //Add the listener for the save button. + save_button.setOnClickListener(new View.OnClickListener() { + + @Override + public void onClick(View v) { + SharedPreferences preferences = getSharedPreferences( + getString(R.string.const_string_preferences), + Activity.MODE_PRIVATE); + SharedPreferences.Editor editorPreferences = preferences + .edit(); + + EditText field; + + field = (EditText)findViewById(R.id.url_option); + editorPreferences.putString("url_pandora", field.getText().toString()); + field = (EditText)findViewById(R.id.user_option); + editorPreferences.putString("user", field.getText().toString()); + field = (EditText)findViewById(R.id.password_option); + editorPreferences.putString("password", field.getText().toString()); + editorPreferences.commit(); + + setResult(666); + finish(); + } + }); + + cancel_button.setOnClickListener(new View.OnClickListener() { + + @Override + public void onClick(View v) { + finish(); + } + }); + + } +} diff --git a/extras/PandoraFMS_android_console/src/pandorafms/pandorafmsandroidconsole/PandoraWebView.java b/extras/PandoraFMS_android_console/src/pandorafms/pandorafmsandroidconsole/PandoraWebView.java new file mode 100644 index 0000000000..38e753834c --- /dev/null +++ b/extras/PandoraFMS_android_console/src/pandorafms/pandorafmsandroidconsole/PandoraWebView.java @@ -0,0 +1,158 @@ +/* +Pandora FMS - http://pandorafms.com + +================================================== +Copyright (c) 2005-2011 Artica Soluciones Tecnologicas +Please see http://pandorafms.org for full contribution list + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public License +as published by the Free Software Foundation; version 2 + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. +*/ + +/** + * Activity of main view. + * + * @author Miguel de Dios Matías + * + */ + +package pandorafms.pandorafmsandroidconsole; + +import pandorafms.pandorafmsandroidconsole.R; +import pandorafms.pandorafmsandroidconsole.Help; + +import android.os.Bundle; +import android.app.Activity; +import android.content.Intent; +import android.content.SharedPreferences; +import android.util.Log; +import android.view.Menu; +import android.view.MenuItem; +import android.view.View; +import android.webkit.WebSettings; +import android.webkit.WebView; +import android.webkit.WebViewClient; +import android.webkit.SslErrorHandler; +import android.widget.Toast; +import android.net.http.SslError; + +public class PandoraWebView extends Activity { + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + Intent i; + + setContentView(R.layout.activity_web_view); + + SharedPreferences preferences = getSharedPreferences( + getString(R.string.const_string_preferences), + Activity.MODE_PRIVATE); + + String url_pandora = preferences.getString("url_pandora", ""); + String user = preferences.getString("user", ""); + String password = preferences.getString("password", ""); + + WebView myWebView = (WebView) findViewById(R.id.webview); + WebSettings webSettings = myWebView.getSettings(); + webSettings.setJavaScriptEnabled(true); + + myWebView.setWebViewClient(new WebViewClient(){ + + @Override + public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) { + handler.proceed(); // Ignore SSL certificate errors + } + + public void onPageFinished(WebView view, String url) { + //Check the first load the page for to hide a toast with the + //connection message + + //Close the CustomToast (I love this hack, fuck javalovers and yours patterns.). + ConnectionCustomToast connectionCustomToast = new ConnectionCustomToast(); + if (connectionCustomToast.activity != null) + connectionCustomToast.activity.finish(); + } + }); + + //Check if not empty the data of connection + if (url_pandora.equals("")) { + //Show the config dialog for to set a URL (normally the first execution) + i = new Intent(this, Options.class); + startActivityForResult(i, 666); + } + else { + //myWebView.loadUrl("http://192.168.10.14/test.php"); + myWebView.loadUrl(url_pandora + "/index.php?action=login&password=" + password + "&user=" + user); + Log.e("URL", url_pandora + "/index.php?action=login&password=" + password + "&user=" + user); + + i = new Intent(this, ConnectionCustomToast.class); + startActivity(i); + } + + } + + + @Override + public boolean onCreateOptionsMenu(Menu menu) { + // Inflate the menu; this adds items to the action bar if it is present. + getMenuInflater().inflate(R.menu.web_view, menu); + return true; + } + + @Override + public boolean onOptionsItemSelected(MenuItem item) { + Intent i; + switch (item.getItemId()) { + case R.id.options_button_menu_options: + i = new Intent(this, Options.class); + startActivityForResult(i, 666); + break; + case R.id.help_button_menu_options: + i = new Intent(this, Help.class); + startActivity(i); + break; + case R.id.refresh_button_menu_options: + WebView myWebView = (WebView) findViewById(R.id.webview); + + myWebView.reload(); + break; + case R.id.exit_button_menu_options: + finish(); + break; + } + + return true; + } + + @Override + public void onActivityResult(int requestCode, int resultCode, Intent data) { + super.onActivityResult(requestCode, resultCode, data); + + switch(resultCode) { + case 666: + SharedPreferences preferences = getSharedPreferences( + getString(R.string.const_string_preferences), + Activity.MODE_PRIVATE); + + String url_pandora = preferences.getString("url_pandora", ""); + String user = preferences.getString("user", ""); + String password = preferences.getString("password", ""); + + WebView myWebView = (WebView) findViewById(R.id.webview); + myWebView.loadUrl(url_pandora + "/index.php?action=login&password=" + password + "&user=" + user); + Log.e("URL", url_pandora + "/index.php?action=login&password=" + password + "&user=" + user); + + Intent i = new Intent(this, ConnectionCustomToast.class); + startActivity(i); + break; + } + } +}