This is a migrated thread and some comments may be shown as answers.

Default options menu error (android)

2 Answers 70 Views
AppBuilder in-browser client
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Daniel
Top achievements
Rank 1
Daniel asked on 08 Dec 2012, 05:02 PM
Hello, what an amazing tool! Congratulations an thank you! :)
A little question. When i export my applications as android apk and install them on a real device, then i  press on option menu button. it shows an error saying "Error  app.icenium.com" even on your demo applications.

Is there a way to remove it? or even better , can i make my own options menu to share and to exit?

2 Answers, 1 is accepted

Sort by
0
Nikolay Tsenkov
Telerik team
answered on 10 Dec 2012, 10:08 AM
Hello Daniel,

Thanks for trying out Icenium.

The options menu button in Android is currently used for updating your deployed-on-device app with the latest bits of your project in Icenium (so you can test the latest version even when not connected with a usb).
This behavior is only when your app is built in Debug mode.

You can change the mode to release through Graphite: RightClick on the first item in the Project Navigator (the solution item) -> Build Settings -> from the dropdown pick Release.

When your app is built in release mode, we are not using the button and you can test your menu. It's a bit uncomfortable, but we will work on improving the workflow. Thanks for reporting this.

You can display a menu on the "menubutton" event triggered on the document.
Here is a blogpost in which the writer explains how to use a little script he wrote for displaying a menu: http://simonmacdonald.blogspot.com/2012/11/building-html-options-menu-for-phonegap.html

You can test this by adding his script directly to the project as "menu.js" file.
Here is how your index.html should look like:

<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <meta name="format-detection" content="telephone=no" />
        <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" />
        <link rel="stylesheet" type="text/css" href="css/index.css" />
        <title>Hello World</title>
    </head>
    <body>
        <script type="text/javascript" src="cordova.js"></script>
        <script type="text/javascript" src="menu.js"></script>
        <script type="text/javascript">
            document.addEventListener("deviceready", function() {debugger;
                var onSettings = function() {
                    console.log("settings");
                };
     
                var onHelp = function() {
                    console.log("help");
                };
     
                var optionsmenu = new OptionsMenu({
                    id: "optionsmenu",
                    items: [
                        [ {
                            label: "Settings",
                            image: "menu/settings.png",
                            action: onSettings
                        },
                        {
                            label: "Help",
                            image: "menu/help.png",
                            action: onHelp
                        } ]
                    ]
                });
            }, false);
        </script>
    </body>
</html>

After setuping the project, you have to set the Build Settings to Release, build and deploy to device.

I hope this is helpful.


Regards,
Nikolay Tsenkov
the Telerik team

Share feedback and vote for features on our Feedback Portal.
Want some Kendo UI online training - head over to Pluralsight.
0
Daniel
Top achievements
Rank 1
answered on 10 Dec 2012, 12:35 PM
Thank you very much for your detailed answer, i really appreciate that and i understand now :)  
I will try it. Thank you!
Tags
AppBuilder in-browser client
Asked by
Daniel
Top achievements
Rank 1
Answers by
Nikolay Tsenkov
Telerik team
Daniel
Top achievements
Rank 1
Share this question
or