Page 35 of 60 FirstFirst ... 25333435363745 ... LastLast
Results 341 to 350 of 591

Thread: Native Android control client

  1. #341
    Join Date
    Mar 2007
    Posts
    277

    Default

    Quote Originally Posted by ewingr View Post
    If I want to display a message, do I need to use Java script?

    I'm interested in displaying a message a couple different ways: one would be where I click OK to dismiss, another for a period of time.
    You have a few built-in options to display messages without touching scripts.

    First you have the 'toasttext' Parameter, which is so named because it's a simple interface to Android's 'Toast' messaging (the little pop-up notification message that displays on-screen for a few seconds, I use it a lot for error/warning messages). This is very simple:

    Code:
    <Parameter name="toastText">My Message here!</Parameter>
    That's all there is to it. Then you have the bonafide dialog box, 'displayDialog'. This is the modal pop-up dialog box with an Ok dismiss button. The format is <title>|<message>, like this:
    Code:
    <Parameter name="displayDialog">Warning!|You have triggered this dialog.</Parameter>
    Do those meet your needs? The existing script demo that pops up a message is exactly the same thing as 'toastText'. I just have it in there as a very simple demonstration of how you can call actual Java code (and Android code at that) through the javascript interface.

  2. #342
    Join Date
    Mar 2007
    Posts
    277

    Default

    Quote Originally Posted by ewingr View Post
    FYI>..I still find that the WOL is not working if Andre has been unloaded after the PC was put to sleep.
    That's expected as I've not had time yet to go back and properly pass the call through the connection-checking code. I've been stalling on this because effectively the WOL stuff is just doing a straight UDP packet broadcast, which is the same stuff as the TCP/UDP stack for talking to devices (like the Onkyo). Instead of crafting connection testing specifically for the WOL call, I wanted to build it out as a framework for all TCP/UDP stuff to share. Ironically enough it's the very nature of UDP (no delivery guarantees) that makes the WOL call not trigger the WiFi re-connection, so I have to build out even more testing than I already have in place for web service calls.

    Quote Originally Posted by ewingr View Post
    In working around the WOL issue, I have an app that will create a widget which I can call with a widget container. Now I would like to call that from another button and not having luck. Here is the code for the widget button, which is working when I directly push it:
    There are a few issues happening here. First, the Button you have defined, btn_wid_wol, isn't actually configured to do anything other than display; you can't associate entities (e.g. Buttons & WidgetContainers) in that fashion; WidgetContainer wid_WOL isn't connected to btn_wid_wol in any way in the code above.

    But there's a much bigger problem than that; Android is very aggressive when it comes to cross-app security. The widgets in particular are really sandboxed/firewalled little windows into another app and Andre isn't allowed to interact with it (unless that app specifically opens up an intent or something). In fact, it is the reason why you place a WidgetContainer and not an actual Widget directly in the config; apps are not allowed to auto-install widgets, there MUST be a user action that calls Android OS to let them pick the widget themselves.

    That does however bring up an interesting workaround possibility though. If there's an exposed intent on that WOL app you have to trigger the actual wake-on-lan event, you could just use the new invokeIntent Parameter to do it. There's a good chance you'll have to ask the developer about this (and to get the name of the intent and any payload it requires) because most apps don't typically call out their intents in their documentation. If you can give me the name of the app and the name of it's developer, I can poke around and see if I can find this out for you, and whip up an invokeIntent call for you to try.

    Otherwise I'd like to have the basics for connection testing for TCP/UDP communication in within a week or two.

  3. #343
    Join Date
    Mar 2004
    Posts
    315

    Default

    Sometimes you can discover an intent by using alogcat. Push the widget and open alogcat, pause it, scroll up looking for relevant info... Warning there is a LOT info logged to the log... Also might be as easy as googling the widget name and the work Intent.

  4. #344
    Join Date
    Mar 2007
    Posts
    277

    Default Andre 1.9.0b Available

    New in version 1.9.0b:

    - Changed <Buttons> tag to <Entities> for consistency
    - Moved <Locale> tag from around Parameters to a Parameter attribute

    - Add ability for serviceDomain / servicePort Parameters to support second value for public network
    - Enable optional page scrolling
    - Enable display animation for all non-Button entities
    - Rewrite and enhance entity background options
    - Speed up Change Location
    - Many small performance enhancements and code cleanups

    http://www.andreapp.com/downloads/Andre-1.9.0b.zip


    Details:

    WARNING: This release has several syntactical changes that WILL break your configs! Read on to see what needs to change.

    Changed <Buttons> tag to <Entities> for consistency

    As previously announced, I have changed the <Buttons> tag to <Entities> to more clearly indicate that more than <Button..> tags belong there. Simply search for the single <Buttons> and </Buttons> tags in each page and change them to <Entities> and </Entities> respectively.


    Moved <Locale> tag from around Parameters to a Parameter attribute

    Also as previously mentioned, there is no longer a <Locale id="xxx"> container around lists of Parameters. In all cases where these tags get defined (optionally for Page and ButtonGroup <Parameters> sets and inside <Button> tags) remove the <Locale id="xxx"> and </Locale> tags. Instead, you assign the Locale as an attribute on each Parameter. "default" locale is implied, you do not need to define the locale if the Parameter is intended for the "default".

    Example:

    OLD
    Code:
    <Page id="demopage">
       <Parameters>
          <Locale id="default">
             <Parameter name="labelColor">ffffff</Parameter>
          </Locale>
          <Locale id="hometheater">
             <Parameter name="labelColor">ffffff</Parameter>
          </Locale>
       </Parameters>
       <Buttons>
          <Button id="demobutton">
             <Locale id="default">
                <Parameter name="buttonLabel">My Label</Parameter>
                <Parameter name="labelSize">35</Parameter>
             </Locale>
             <Locale id="hometheater">
                <Parameter name="buttonLabel">My other Label</Parameter>
                <Parameter name="labelSize">50</Parameter>
             </Locale>
       </Buttons>
    </Page>
    NEW
    Code:
    <Page id="demopage">
       <Parameters>
          <Parameter name="labelColor">ffffff</Parameter>
          <Parameter locale="hometheater" name="labelColor">ffffff</Parameter>
       </Parameters>
       <Entities>
          <Button id="demobutton">
             <Parameter name="buttonLabel">My Label</Parameter>
             <Parameter name="labelSize">35</Parameter>
             <Parameter locale="hometheater" name="buttonLabel">My other Label</Parameter>
             <Parameter locale="hometheater" name="labelSize">50</Parameter>
       </Entities>
    </Page>

    Add ability for serviceDomain / servicePort Parameters to support second value for public net

    The Settings->Server page has two domains and ports so Andre can toggle the IP and port used to fetch assets (config.xml, images,fonts, etc.) depending on if you're on your home network or something else (like the cell data network). To make this same capability work for web service calls, the Parameters 'serviceDomain' and 'servicePort' can take an optional second value, separated by a comma. The first value will be used if you're on your home network (e.g. connected to the WiFi access point defined in Settings->Server), the second if you're not.

    Example:

    Code:
    <Parameter name="serviceDomain">192.168.0.1,www.mydomain.com</Parameter>
    <Parameter name="servicePort">80,8080</Parameter>

    Enable optional page scrolling

    Traditionally, Andre Pages intentionally do not scroll; If the contents of the Page are too big, then Andre squeezes things to fit. I have several Android devices with smaller screens and I wanted to be able to make the Buttons larger but not split everything into a ton of Pages. I added scrolling so you can make a large Page and fling it up and down (or left/right) to quickly access more Buttons.

    Simply add scrollDirection="value" to the <Page> tag, where value is either 'horizontal' or 'vertical'. Then just add more items to the Page than will fit, and the view will let you scroll by dragging the screen.

    Example:
    Code:
    <Page id="home" scrollDirection="vertical">
    Note: Enabling scrollDirection for a page will disable gestures for that page.

    Enable display animation for all non-Button entities

    Last release added the Text entity, and one of the attributes was 'animation' which allowed the display of the Text entity to be animated. I've enabled that attribute on all other Entities other than Button (Button already has animations) including ButtonGroup, Browser, WidgetContainer, and any others that come down the road. There are two attributes, 'animation' which specifies an animation ID that was defined earlier in the config, and 'replayAnimation' which is true or false, and determines if the animation plays every time the page is displayed, or just the first time after Andre is loaded.

    Example:
    Code:
    <Browser id="testbrowser" url="www.google.com" animation="fadein" replayAnimation="true" />

    Rewrite and enhance entity background options

    ButtonGroups and Browsers had a very rudimentary ability to have a border drawn around them, by specifying a borderSize and borderColor attribute in the tag. I completely re-wrote this and enabled it for all entities other than Button. Here are the new options:

    bgFillColor - Color in hex (AARRGGBB e.g. "ff8566aa") for background fill (default transparent)
    borderColor - Color in hex (AARRGGBB e.g. "ff8566aa") for border (default transparent)
    borderWidth - Decimal (e.g. 5.0 or 9.5) that specifies number of pixels wide for the border
    borderOnTop - true or false (default true) to draw the border over or under the entity
    borderCornerRadius - Decimal (e.g. 15.0 or 20.5) radius in degrees to round the corners by (default 0, or square corners)

    This is a nice way to draw a containing line around groups of buttons (with ButtonGroup) or entity like Text or Browser.


    Speed up Change Location

    The Locale feature is intended to let the same page layouts be re-used for equipment in different rooms or locations, and is used by selecting 'Change Location' from the menu. It was kind of slow to switch however (especially for complex pages), so I optimized it considerably, provided that only some of your Buttons will actually have more than one Locale defined.


    Many small performance enhancements and code cleanups

    I've been finally going back and cleaning up a lot of half-baked code, which should improve both stability and performance. With this, there might be new bugs; please report any oddities you encounter.


    Because of the amount of changes, please be sure to let me know if you have any problems with your config (other than those intentionally broken!).

  5. #345
    Join Date
    Jul 2005
    Location
    Gliwice,Poland
    Posts
    82

    Default

    Hallo,
    I'm back for testing after a long break.
    After installing the new versionn 1.9.0b i get black screen on start and refresh.
    Maciej Wąchalski

  6. #346
    Join Date
    Mar 2007
    Posts
    277

    Default

    Welcome back. Did you make the syntax changes to the configuration noted in 1.9.0b release? There was also an earlier version which had a similar change. I highly recommend scanning through the posts (at least the release notes I posted for each incremental version) to catch up with syntax changes and the features that have been added since you last had the opportunity to use it.

    Also you may wish to uninstall and re-install, as there have been some DB schema changes as well. If these things do not fix your problems please let me know and I'll gladly work with you to figure out what's wrong.

  7. #347
    Join Date
    Jul 2005
    Location
    Gliwice,Poland
    Posts
    82

    Default

    I know about the syntax changes. I've been reading posts all the time.
    I just from my HTC Desire HD form service (problems with gps antena), so i did a clear install.

    The configuration looks ok, it seems Andre is fetching all the data from Girder.
    Maciej Wąchalski

  8. #348
    Join Date
    Mar 2007
    Posts
    277

    Default

    Can you simplify the config down to a single button with an imageUrl and see if that works? Or if you're willing, you can send me the config and I can run through it in the debugger.

  9. #349
    Join Date
    Jul 2005
    Location
    Gliwice,Poland
    Posts
    82

    Default

    Nice, this is my config.xml: http://maciej.mewy.net/config.xml
    It is taken from this zip: http://www.andreapp.com/downloads/Andre-1.9.0b.zip

    Thanks
    Maciej Wąchalski

  10. #350
    Join Date
    Mar 2004
    Posts
    315

    Default

    The config in your link still has <Buttons> instead of <Entities>. It's also using the old locale tagging.

    Luke - You must not have updated the sample config?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •