1 of 1 people found this helpful
the RhoElements metatags are supported only by the Motorola WebKit Browser, available on Windows Mobile/Windows CE and Android.
To enable it, you need to have in your build.yml file the options:
let me know if this solves the problem for you
EIA RhoMobile Technical Architect
Thanks Pietro, your answer has been very useful, but I've theese two strange behaviours:
- the battery is always full-colored, such as it was completly charged (it isn't), and when I connect the charger at the smartphone the battery doesn't change its aspect to represent it is charging. These issues don't appear if I use an html page deployed on a web server using Rho Elements Runtime...why is there this different behaviour?!?
- Adding the capability and the apptype you suggested to me all layouts elements make smaller (buttons, etc), why ?!?!
Thanks a lot,
What is the OS of the smartphone you are referencing?
Also can you include your build.yml file that has the issues you are talking about in the first bullet?
My intuition believes you might be useing the Motorola Webkit browser for some devices and the native browser for others (should you be using an iOS device).
I'm using Android OS. Anyway I've just discovered that the problem concerning the right battery module displaying is due to the color I setted for it : #FFFFFF
Using others colors it's all ok!!!!
Is this problem only releated with Android SO? I've also found it in this discussion https://developer.motorolasolutions.com/message/2996#2996
As soon as I possible I try with a Windows Mobile device.
Regarding the second bullet (adding app_type: "rhoelements" capabilities: - motorola_browser my native web app layout components make smaller ), any suggestions?!?! I'm developing the interface using jQuery Mobile, is it possible that this app_type and capability modify css???
Luca, you want to use Ruby battery api when using the Rhodes framework (native app). The Meta tags you used are for HTML/Javascipt web apps, hence the positive results when running it with the RhoElements shared runtime.
When working with the Rhodes framework (native app) you may want to use te Battery Ruby Object Syntax: At least for version 2.2 and under.
I'm using meta tags in an html page (layout.erb) of my native app, infact I don't have any problems...only if I try to set white color for the battery module, the battery always remains full-colored, otherwise no issues!
The only aspect I don't understand is that adding
in my build.xml file, layout dimensions change, they make smaller (buttons, labels, etc). The page layout (layout.erb) is written with jquery mobile...Is it possible that inserting rhoelements app_type and motorola_browser capability, any css is import into app?
Thanks a lot for any clue!
Luca, if you're confortable with using an undocumented feature then that's fine.
Regarding use of motorola_browser; just like any other browsers, rendering of objects may vary from one rendering-engine to another. If objects, in this case, appear smaller than expected then perhaps use of the Zoom Module would be helpful here.
Peter, I think the battery module problem I've highlighted is due to a bug, not because I'm using an undocumented feature. It happens also in an HTML/Javascipt web apps. Try this simple page yourself with RhoElements Runtime:
<META HTTP-Equiv="battery" Content="visibility:visible">
<META HTTP-Equiv="battery" Content="Left:100">
<META HTTP-Equiv="battery" Content="Top:100">
<META HTTP-Equiv="battery" Content="Layout:Left">
<META HTTP-Equiv="battery" Content="Color:#FFFFFF"> --> the problem is white color: if you change the color, the battery module is right
<meta http-equiv="quitbutton" content="visibility:visible;" />
Luca, you're correct... I finally got a chance to test it and it clearly exhibits an issue when using white as its color. However, not sure if it's a bug. Since the background of the battery indicator is white by default so if using white in the color setting it would simply show white across. The obvious suggestion here would be to use any color except for white, at least until if or when a "background color" attribute is introducted to the Battery API.