This page last changed on Jan 18, 2015 by kurrazyman.

Hi guys,

I have managed to spend a few hours working on the Android console and you can download an unofficial release at: -

https://www.dropbox.com/s/c1x79vncn4cwnc8/Android_Console_2_2_0.apk?dl=0

Based on peoples comments on the previous 2.1.1 & 2.1.0 releases this now includes the ability to specify X & Y Scaling factors which can be applied to your panels which will help you reuse them across different devices (this scaling is not perfect but hopefully it will prove helpful). Unfortunately there is no way to determine the size of the panel on the console so you have to manually enter these scaling values in the individual controller settings.

Also improved the image handling which should further reduce crashes (unfortunately if you are using lots of images in your panel then you may still encounter the Out of Memory errors; there are further improvements that can be made on this but I'll wait to hear your feedback first).

Improved navigation handling.

Thanks to everyone for the feedback and please continue to post your experiences so we can continue to make improvements (when time allows). Particular thanks to Jack Smith for making some code contributions to help with these changes.

Rich


Hi Richard,

thanks for the upgrade.

I'm trying your new version on:
> SmartPad1010i (Android 4.0.4)
> Nexus7 (Android 4.4.4)

Some preliminary comments:

1) My GUI design is using five different screens each one with a different background image; a JPEG with same resolution as the screen.
With 2.2.0, one of this background image (only one....) was loaded entirely but it was shown smaller vs. screen size (about a quarter of the screen). After some restart without success, I changed the image in OR designer and then back to the original image and now it is ok.

2) My previous version of Android Console (2.1.1) used to crash with "Color Picker" widget. With 2.2.0 is ok.

3) Live video streaming still not working ((

Will continue using 2.2.0 in my ongoing design and post any issue.

Thanks

Posted by galbip at Jan 19, 2015 16:19

Paolo,

Thanks for the feedback; your issue relating to the background images sounds a little strange especially if you were able to resolve it by re-adding the image within the designer.

I didn't change anything relating to the color picker so not sure why that is now working ok for you.

What format is the video stream you want to view?

Rich

Posted by kurrazyman at Jan 19, 2015 17:50

Hello,
Many thanks for share new version. I have few screens and all reload ok.
Android 4.1.2 smartfon LGL9 It is possible to implementing M-JPEG streaming from cam?
Scaling option works for button, sliders but it is possible to scaling background image?

Posted by szejkindudi at Jan 19, 2015 18:20

MJPEG Streams are not natively supported on Android; people have hacked together a way of making them work but they are very inefficient and will drain the CPU. What I have done in the past (if your camera supports it is to create a simple web page that uses javascript to grab static JPEGs from the camera every second and display those in a standard webview, this works fairly well and I can share a HTML file with you if you want to try this).

Looking at the source code then indeed background images set to Fullscreen do not stretch to fit the screen, instead they crop to the top left; this initially seems a little odd to me but is historically how things were done and changing this would break panel designs for other users (legacy support is a headache).

Posted by kurrazyman at Jan 19, 2015 18:33

Richard,

not sure I know exactly the video format; the use cases I'm trying to achieve are the following:

1) On my GUI MainScreen, I'd like to have a WebView showing a news channel like this for instance: http://www.rainews.it/dl/rainews/live/ContentItem-3156f2f2-dc70-4953-8e2f-70d7489d4ce9.html

2) In future, I also plan to install an IPCam at the front door and show its recording on GUI SecurityScreen (very similar to Adam case I guess).

For info, browsing on the Internet I found very similar user experience in using WebView: http://stackoverflow.com/questions/12708890/youtube-video-not-playing-in-webview-android

Don't know if the solution can be applicable also for Android Console app... I'm an hardware guy...

Thank you
Paolo

Posted by galbip at Jan 19, 2015 19:14

Hi Richard,

thanks for the update. My first remarks:
1. Larger designs (>6 screens?) fall to load. After spending some time in 'loading resources' I'm back on the controller selection screen.
2. Would be nice if the background image scales as well.

Perhaps you can use some kind of automatic scaling when a pannel size will be embedded in its name? E.g. pannel320x480 and you are on device with screen 480x800 then it will rescale with 1.5 and 1.67

Posted by aktur at Jan 19, 2015 19:28

Hi Michal,

Thanks for the feedback; I have tried with a panel that contains more than 20 screens and it works ok, does the panel you are trying to load have lots of images (background images in particular)? If this is the case then I suspect the Out of Memory exception is to blame.

The X & Y scale factors should provide the same information and this could be used to scale the background image beyond its' intended size (we have the same issue with images used in other widgets so the same technique could be used there also), just need to find another couple of hours to try this out.

Posted by kurrazyman at Jan 19, 2015 21:06

Thank you for information about cam. This method is similar as in this topic?: http://www.openremote.org/display/forums/Webview+and+IP+cam,+how+to+refresh+the+stream

Best regards

Posted by szejkindudi at Jan 21, 2015 02:23

Yes it is the same method; just depends on whether or not you can get a static JPG from your camera.

Posted by kurrazyman at Jan 21, 2015 16:48

Hi Richard excellent work - this is a real time saver for those of us with multiple screen sizes.

I've had a quick play and so far so good except for switches with images that do not seem to change size?

Posted by jules_bike at Jan 21, 2015 22:12

Yes my cam support /snapshot.cgi? and it is no problem with this.
Add img with src="cam address" and add meta http-equiv="refresh" content="2". But it will run only at local area network. If you try connect by 3G network to router and on router redirect port to computer with OpenRemote installed it will not work because local site still redirect question to local IP cam address.e.g. connect to the public IP - Router redirect to local computer with private IP(port forwarding or DMZ used) - on this local computer there is a additional html site on Tomcat to grab snapshots from cam(use src="cam address"in code)- not working-redirect.
Maybe good idea is to add H264 video because it have a native android support? Some IP cameras support H264.

Posted by szejkindudi at Jan 22, 2015 10:43

Hi Jules,

Yes there are limitations to what has currently been done with the scaling and switches are an example.

Problem is that images used for switches (and sliders) have never automatically stretched to fill their container so we have to do a bit more work to make images stretch when using scaling factor but not break the previous behaviour (I just need to find a bit of time to do this).

Rich

Posted by kurrazyman at Jan 22, 2015 18:08

I figured there was something strange with switches as I often have problems with getting them aligned with buttons. Look forward to getting the next release then!

Would it make sense to create designs in high resolution and then downscale them for smaller devices using your new apk? Scaling up seems to highlight poor images.

Also is there a preferred image format - I currently use png?

Posted by jules_bike at Jan 23, 2015 14:30

Would it be possible to have other animations than "right to left"? I'm using transparent layers so fade or without any animation at all would look more natural. I have no experience in android programming but when I skimmed through source code I found there references for other animations but don't know how ready those parts are...

Posted by nokk3r1 at Jan 24, 2015 13:58

Nice work! But I am still having problems with the 20s timeout. I use a Raspberry Pi as Server. Sometimes, if the data failed to load within 20 seconds, the process is aborted and suddenly I see again the start / selection screen. Can you please increase the 20s timeout.

Posted by mschrauf at Jan 25, 2015 15:37

I've created a new build with the 20s timeout increased to 30s, please let me know if this is enough: -

https://www.dropbox.com/s/c1x79vncn4cwnc8/Android_Console_2_2_0.apk?dl=0

Posted by kurrazyman at Jan 25, 2015 18:18

Isn't this timeout the reason of my problem which I've reported previously?

1. Larger designs (>6 screens?) fall to load. After spending some time in 'loading resources' I'm back on the controller selection screen.

I have some designs which load about 2 min. (on iOS, because on Android it is impossible to load them at all).

Posted by aktur at Jan 25, 2015 18:21

Hi Michal,

May well be the same issue you have been having then; I assumed when you said 'failed to load' that some error was being generated.

Do you really have a panel that takes 2mins to load? What hardware is the controller running on? is this over 3G connection?

Posted by kurrazyman at Jan 25, 2015 18:24

Wow, thanks for the quick implementation. Now my design works. That was easy. And I've searched many hours for the error...

My design loads about 27 seconds. The timeout of 20 seconds was too short. But after I would like to extend my design, 30 seconds might still be too short. And for now 3 seconds buffer is not very much.

As Michael says, a design can already take several minutes to be loaded. Maybe it is possible that the timeout can be set via a parameter in the app.

Posted by mschrauf at Jan 25, 2015 18:52

This sounds like the same "error" as it was in my case.

Posted by mschrauf at Jan 25, 2015 19:04

Yesterday I did a quick try on my son's Moto E: Android 4.4.4; 560*960pix. Didn't do any settings. Overall looked better than 2.1.1. Noticed one thing: After a sync operation, the 480*800 background jpg image had shrunk quite a bit.

Posted by pz1 at Jan 26, 2015 09:49


Did install on my PointOfView Mobii ProTab Pro: Android 4.0.1. No problem with the background image after sync.

However the navigation buttons on the left were dead.

Posted by pz1 at Jan 26, 2015 12:53

Hey Richard, [ edit ]

the Android console works great unless the timeout is reached. But the problem is that I added some screens and now again I reach the timeout limit. Unfortunately OpenRemote makes no sense for me if the console does not load the design. After loading it would work perfectly.

So I would ask you. Can you provide me a Version with a timeout limit of 1 minute or even better two minutes. This would be great and i could use Openremote without restrictions.

Posted by mschrauf at Jan 26, 2015 22:48

This is probably addressed to Richard, not me. Anyway, I would not know what is the reason of putting any timeout there. If one wants a protection against hanging then adding interrupt when screen is touched is a better option IMHO.

Posted by aktur at Jan 27, 2015 09:51

Hi Markus,

I've updated the build so that panel XML loading has a timeout of 120s and resource file loading has a timeout of 60s.

Please let us know if this resolves your issues.

Rich

Posted by kurrazyman at Jan 27, 2015 17:20

Apache HTTP Client uses timeouts; these timeouts could be set to very large numbers and an interrupt mechanism could be added to the loading screen; this is not how the code was written and it would just need refactoring.

Posted by kurrazyman at Jan 27, 2015 17:22

Thank you very much for this new android console. It works much better and it's great to be able to adjust the size x, y. By cons, it's a pity not to have android bar at the top and I have a concern with the wallpapers that remains small ( it does not change size depending on x, y )

Posted by pierre2302 at Feb 01, 2015 18:59

I've added more screens and the console starts and runs with this timeout currently very good. But after I wanted to make my system run continuously and use every day. I had to realize that the console could not connect to the server after about 24 hours. The console goes into timeout or simply does not start even though the server is displayed as available. I have no idea what could be the problem. The server is running and in the log files I have found nothing.

Do you have any idea, Richard? It would be very helpful if the console would show any error messages. I almost think it is a server problem. But who knows?

Posted by mschrauf at Feb 02, 2015 21:28

The problem seems to be solved after I updated the firmware.

But now I have bought a Raspberry Pi 2 and I'm thrilled. The OpenRemote Console loads extremely fast compared to the Raspberry Pi B+. I'm sure I will have no more timeout problems.

Posted by mschrauf at Feb 07, 2015 14:53

I noticed if I put the phone vertically during loading of the panel, the wallpapers are the right size with my panel which is horizontal

problem I did not have with older versions of the console android

Posted by pierre2302 at Feb 11, 2015 05:51

Hi Richard,

short question: Is an update planned in the near future, so that the switches with images and the background will be right scaled?

Posted by mschrauf at Mar 22, 2015 10:52

Hi Markus,

There is a release planned which will be pushed to the play store to replace the much outdated release there. This will fix the background sizing issue. To make switches and other widgets work with scaling then you just need to ensure that the images you use are greater than or equal to their largest scaled size (e.g. a switch designed with a size of 200px x 200px that is then displayed with a scaling factor of X = 2 and Y = 2 should use an image size >= 400px x 400px). Unfortunately images will scale down but not scale up at present; to implement scaling up without breaking current widget image behaviour requires a code rework which I just don't have the time for at present but when I find some time I will implement.

Rich

Posted by kurrazyman at Mar 27, 2015 18:49

Android Console 2.3.0 available if anyone would like to try it.

http://openremote.org/display/forums/Android+Console+2.3.0

Posted by kurrazyman at Apr 04, 2015 12:04
Document generated by Confluence on Jun 05, 2016 09:34