Sys Mon App

Have not done anything on this for a long time so it is kind of dead :-(
Android app that monitor a server and displays it in a widget.
Server must generate an XML that describes its status.
  • Show Global status in widgets (1x1 and 4x1).
  • Can show detail status list.
  • Make a sound on status change.
  • Set which days of the week it will monitor.
  • Set time for it to start and stop monitoring during the day.
Here you can download the code: Google Drive

Screenshots


Dependencies (All needed jar is under the lib directory)

Java 1.6
Android SDK (http://developer.android.com/sdk/index.html)

Usage

To open this project in netbeans:
Download and install Android sdk from http://developer.android.com/sdk/index.html
(/opt/android-sdk-linux_x86)
Make all files under tools executable
Extract to disk and execute tools/android (See http://developer.android.com/sdk/installing.html)
Select 'Available Packages' and install Android SDK platform-tools, sdk platform Android 1.6.
Select 'Virtual Devices' and 'New'. Set data below and then create AVD:
Name: Android_1.6
Target: Android 1.6.
SD Card Size: 128MiB
SDCard: yes
AudioOutput: yes
Camera: yes
TouchScreen: yes
GPS: yes
Make all files under platform-tools and platforms/android-4/tools executable
In Netbeans 'Update Center' add this plugin: http://kenai.com/projects/nbandroid/downloads/download/updatecenter/updates.xml
Then install the Android plugin. (See http://gerry.ws/2009/01/1074/how-to-setup-netbeans-for-android-development.html)
Inside Options/Miscellaneous/Android (/opt/android-sdk-linux_x86)

Install on Android:
The Android apk file is located under the dist directory (dist/SteelsquidSysMonApp.apk)
See http://www.brighthub.com/mobile/google-android/articles/37151.aspx

The server:
First there must be a server that returns an XML as below.
The call is a standard HTTP requests.

Application: Name of the Server/application that you monitor.
Time: The time the status is generated.
Totalstatus: The total the status of the server (0=OK, 1=Warning, 2=Error, 3=Information).
Totaldescription: Description of total statuset.
Detaillist: List of all subsystems.
Detail: A subsystem.
Status: Status of a subsystem (0=OK, 1=Warning, 2=Error, 3=Information).
Description: Description of subsystem statuset.

Example XML files:
Use the test XML files located on the bottom of this page.

The app:

The app will read the XML from the server and displaying a widget which shows the status.
You first must configure the app by clicking on the configure icon.
You can also press the magnifying glass to see detailed information.
I think that gui is self-explanatory.

Short description of classes

org.steelsquid.sysmonapp.MainWidget
The widget.
org.steelsquid.sysmonapp.R
This class was automatically generated by the aapt tool from the resource data it found. 
It should not be modified by hand.
org.steelsquid.sysmonapp.ServerConnector
Read xml from server and extract information.
org.steelsquid.sysmonapp.SettingsActivity
Setup the widget.
org.steelsquid.sysmonapp.Status
A status object.
org.steelsquid.sysmonapp.StatusActivity
List all the details from the remote server.
org.steelsquid.sysmonapp.TimerService
Reads status of the remote system periodically.
/res/drawable
Contains all icons
/res/layout/main.xml
The MainWidget layout.
/res/layout/settings.xml
The SettingsActivity layout.
/res/layout/status.xml
The StatusActivity layout.
/res/raw
Sounds
/res/values/strings.xml
String resources used in the application.
/res/xml/widget_provider.xml
Setup the widget
AndroidManifest.xml
The manifest presents essential information about the application to the Android system, information the system must have before it can run any of the application's code.

Revision history

2011-02-18   0.5   Initial release
2011-02-28   0.6   Change layout (Size of widget)
2012-03-01   0.7   Fixed some errors that occurred when sound is played
2012-03-02   0.8   A thread for updating the widget and fixed an error in XML handling
2012-03-03   0.9   Fix error on restart widget
2012-03-05   1.0   Think it works now
2012-03-06   1.1   Some user interface changes
2012-03-07   1.2   Some new icons and fixed a error when status icon shows
2012-03-20   1.3   New icon. Run detail activity from launcher. Log error to ..sdcard/SysMonApp/errors.log
2012-03-21   1.4   Smaler widget (1x1). And som test functionality on steelsquid.org
2012-03-22   1.5   Max size of log file and error in log of stacktrace
2012-03-23   1.6   Fix exception on screen change
2012-03-24   1.7   Fixed some more bugs (NullPointerException)
2012-03-26   1.8   Change from dp and px to sp.
2012-03-26   1.9   Fixed a error i made by last version.
2011-05-09   2.0   Nothing new in the code but using Netbeans 7
ċ
SysMonAppErr.xml
(1k)
Steelsquid,
May 13, 2015, 12:51 PM
ċ
SysMonAppInfo.xml
(1k)
Steelsquid,
May 13, 2015, 12:51 PM
ċ
SysMonAppOk.xml
(1k)
Steelsquid,
May 13, 2015, 12:51 PM
ċ
SysMonAppWarn.xml
(1k)
Steelsquid,
May 13, 2015, 12:51 PM