Default options menu error (android)

3 posts, 0 answers
  1. Daniel
    Daniel avatar
    3 posts
    Member since:
    Oct 2012

    Posted 08 Dec 2012 Link to this post

    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" 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. Nikolay Tsenkov
    Nikolay Tsenkov avatar
    734 posts

    Posted 10 Dec 2012 Link to this post

    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:

    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>
            <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>
            <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() {
                    var onHelp = function() {
                    var optionsmenu = new OptionsMenu({
                        id: "optionsmenu",
                        items: [
                            [ {
                                label: "Settings",
                                image: "menu/settings.png",
                                action: onSettings
                                label: "Help",
                                image: "menu/help.png",
                                action: onHelp
                            } ]
                }, false);

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

    I hope this is helpful.

    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.
  3. Daniel
    Daniel avatar
    3 posts
    Member since:
    Oct 2012

    Posted 10 Dec 2012 Link to this post

    Thank you very much for your detailed answer, i really appreciate that and i understand now :)  
    I will try it. Thank you!
Back to Top