Premise [download] Android SYS Webview App

Motorola Premise

etc6849

Senior Member
index.php
File Name: Android SYS Webview App
File Submitter: etc6849
File Submitted: 24 Apr 2011
File Category: Premise
Author: etc6849
Contact: PM

Here's an Android webview app I've built specifically for SYS Minibrowser. It seems to be working well, so I thought I'd share.

Requirements
123's minibrowser module or equivalent running on a Premise SYS server. Compiled for Android 2.2 or newer. If you don't use Android 2.2, if you ask nicely, we can figure something out
wink.gif
PS: You can always upgrade to Cyanogenmod which is now 2.3 and very stable; it's also open source.

Install
You will have to enable under Applications: "Unknown sources" which allows installation of non-Market applications. You then can install the app using adb or whatever method you like. The app is signed and should install once you enable "Unknown sources."

Detailed Steps
Download the zip file. Unzip one level to reach apk file (don't unzip apk). Plug your phone into your PC and mount it as a storage device. Copy the apk file to your SD card, then unmount your phone as a storage device. Browse the sd card using Root Explorer and click the apk to install.

If you don't have "Root Explorer" (costs a few dollars and is available in the android market), there are numerous tutorials on how to install the file for free. Google "adb install apk" for additional methods.

Important note: which ever mini browser root you are using, disable refresh by setting UIRefreshInterval to 0. The app will auto refresh on it's own so as to prevent a SYS session timeout. Also screen will be white upon first start; you must hit menu and configure the settings, then click the back button on your phone

Features
1. Gets rid of all bars that you would normally see if you used a web browser. It offers the look and feel of an external app in true full screen mode.
2. Disables the multi-touch zoom, always keeping your mini browser in full screen. This prevents unintended zooming.
3. Scroll bars are auto hidden (e.g. only show up when you're scrolling).
4. Makes full use of the android app "life cycle" since it extends the activity class. This means when your phone goes to standby, nothing happens to save battery life. When it comes out of standby the phone will auto refresh and restart refreshing on a set interval (see below).
5. The app will automatically log in and icons are automatically cached by android (and android does a great job with caching, so I didn't implement my own method).
6. Some preferences come preset, but some such as Server Location MUST be changed in the settings menu upon initial install.

Menu Options
1. Refresh refreshes the screen using the address: http://ip:port/folder name/
2. Quit will finish() the activity (e.g. cause the app to properly close).
3. Under settings you'll find several preferences:
3.1. Server Location (it's preferred to use a free dynamic hosting service such as dyndns.org; for example, your serer location could be myDomain.dyndns.org or an ip address)
3.2. Port Number
3.3. Username (recommended if using minibrowser from the internet and not subnet)
3.4. Password (recommended if using minibrowser from the internet and not subnet)
3.5. Mini Browsser UI Name (name of root folder (e.g. ppc, xb etc.. used for Mini Browser SYS web redirect)
3.6. Refresh Interval
This refreshes the page automatically every x seconds. It must be set greater than 5 seconds, else auto refresh will be disabled. This only happens when the app is in the foreground to save bandwidth and follow the android app life cycle.
3.7. Orientation (used to set orientation in landscape (locked), portrait (locked) or enable orientation via sensor)
3.8. All user preferences (username, password etc...) are stored in a location private to this application only. If you uninstall this app, it will remove this information.

Please post any comments or issues in the support forum. I'll post more screen shots there.

New for RC8
1. A user's password is now completely hidden from view. (It was always protected internally though).
2. A concept called "Refresh After Touch" has been implemented.
A touch listener is used to suspend automatic refreshes. This means if a user interacts with a webpage, the page cannot refresh during the interaction.

To facilitate this, a new preference called "Refresh After Touch" is used to determine the timeout period where no automatic refreshing will take place. "Refresh After Touch" has an added benefit in that it refreshes the page after x seconds; no matter what the preference "Refresh Interval" is set to. Refresh Interval could be disabled and you can still use Refresh After Touch to load an updated page following user interaction. You can also disable "Refresh After Touch" by setting its value to zero.

PS: I'm not sure if this is clear or not, but this program could be used for displaying any webpage. This means it can be used with other HA systems that have html or flash pages.

Click here to download this file
 
Main page after the menu key is hit (Note menu color will be transparent black if you are running Android 2.3)...
 

Attachments

  • android_app_menu.jpg
    android_app_menu.jpg
    75.7 KB · Views: 31
Preference/Settings screen (access from menu->settings)
 

Attachments

  • android_app_settings.jpg
    android_app_settings.jpg
    66.1 KB · Views: 27
ETC! Very nice...so you figured out how to stop the multiple threads...excellent. Built a 'native' Premise Android app! Nice. I'm looking forward to it (of course Ill have to see if I can get my Droid tablet back)...and I guess I'll have to do something for your graphics
wink.gif


Excellent!
 
Thanks for complements! The graphics are the boring/stock, but the good news is they are small in file size. When you're ready to try it out, PM me and I'll send you a copy of the source so that you can modify the menus (the menus are all stock android, but can be changed) or recompile to your specific version of android.

It goes without saying, but the app could be used for displaying any web page you want. If you point it towards your "ip" directory or any root mini broker directory, it will still work ;)
 
I have added a handy feature that automatically refreshes a page following user interaction after a user defined interval. It also suspends all automatic refreshing during the user interaction, which is nice too.
 
I am not a sophisticated user but a long-time user and I am thrilled by the continued work of so many. I have a Lutron homeworks system but since scenes and keypads are not part of the minibrower UI I have been unable to control multiple lights with a single button. However, I noticed on the graphics that were posted that a second row of buttons appear to control multiple lights. Would you be so kind as to explain how you implemented this second row of buttons to control multiple lights?
 
I'm not sure I'm following what you're trying to do - you want one button to control 'n' lights ? Or multiple lights, like 'show all lights'?
 
You just right click on Home, then click New->Custom User Interface Folder. Then you add CustomPanel object under the WebPreferenceFolder that's created. Next, you add Panel Buttons under the CustomPanel object and add a macro under each button. I use script macros since it's easier for me to write a script than click, but you can use any type of macro.

Check out the wiki here and follow the links at the bottom to watch the training videos. In one of the videos this is covered in detail.
 
I havee tried the app and it works well except the audio volume doesnt work. the mute does work.
let me know if ihave something configured wrong.
Thank you for your hard work.
 
Could you please be more specific. Are the audio buttons not working or do you simply hear no sound?

On my phone I don't use the browser to play music directly, but the button presses do make sound as they should. I can also change volume levels. I would download chrome and try things from a PC. If it works in Chrome, it should work in a webview app...
 
Back
Top