1. #1
    Sencha User
    Join Date
    May 2012
    Location
    rome
    Posts
    68
    Answers
    3
    Vote Rating
    0
    alexdran is on a distinguished road

      0  

    Default Unanswered: Sencha touch 2 app abnormal cpu usage on android --- strange

    Unanswered: Sencha touch 2 app abnormal cpu usage on android --- strange


    Hello
    I have a problem with an app created with ST2, the build and the original version run well on chrome browser but the android app; after the login screen is performing an abnormal cpu usage around 50% on 768 mhz (someway too much)-- tested with 2 different devices

    the app has a login page, then after login the view is pushed to a list of option and again, every option leads to a new screen with different components (mainly listviews and panels)

    now after the first login screen the cpu usage problem on android occurs; I know is something hard for anyone to identify the matter without any code but I'm not performing any background process. does someone has some advice on how and where to start to investigate the issue? at least a test i can do to solve it ?


    I'm using
    Sencha Command v2.0.0 Beta 3
    Copyright (c) 2012 Sencha Inc.

    no issues like this since now; this is 4th app experience with this frameword
    thank you in advance
    Alessandro

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,206
    Answers
    3517
    Vote Rating
    856
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    What are you showing after login?
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    May 2012
    Location
    rome
    Posts
    68
    Answers
    3
    Vote Rating
    0
    alexdran is on a distinguished road

      0  

    Default


    I'm showing
    tabPanel with
    - tabBar on top
    - 1 List
    - 1 Panel with fieldset (and form inside)
    - 2 Panels (1 with a button, one with html downloaded from store)

  4. #4
    Sencha User
    Join Date
    May 2012
    Location
    rome
    Posts
    68
    Answers
    3
    Vote Rating
    0
    alexdran is on a distinguished road

      0  

    Default


    after some more tests I have realized probably the problem (this is indeed happening also with chrome that is showing 2 / 2.4 % cpu usage instead of 0.2/0.3 on "Activity Monitoring" of macOSX 10.6.8)

    I have an app with
    - login
    - screen with different objects
    - additional screen with 5 views for each object (selected)

    the app store the login (if successfully done) and also if an object was selected
    on startup then (after these controls) the screens with different objects and (in case) also the screen with views for the selected object is pushed (the controls are in main controller on "login page" activate control):



    Code:
            control: {
                access1: {
                    activate: function() {  // PERSISTENT LOGIN
                        var uid = this.getConfigValue('uid');
                        if (uid) {
                            this.goLogin(uid, false);     // after login page pushed, if ok
                            var idObject = this.getLoadedObject();
                            if (idObject) {
                                this.goO(idObject, false);   // if selected the object page is pushed
                            }
                        }
                    },
    ....



    Code:
        goLogin: function(idUser, persistency) {
    // function that save the user in the store if persistent
    // list view with all the objects (after login)
            this.getAccess1().push({
                xtype: 'MainG'
            });
    }
    Code:
        goO: function(idO, persistency) {
    // Panel with 5 xtype items (2 list views / 2 panels / 1map)
    // function that save the idO in the store if persistent
    
                this.getAccess1().push({
                    xtype: 'MainC'
                });
    }
    I'm continue to investigate creating a very simple version of an app re-creating the problem; for now (if my explanation is clear)
    is my technique not conventional somehow (of pushing views on startup)?

    thank you again for any feedback
    alex

  5. #5
    Sencha User
    Join Date
    May 2012
    Location
    rome
    Posts
    68
    Answers
    3
    Vote Rating
    0
    alexdran is on a distinguished road

      0  

    Default


    so here is the basic example:

    Code:
    Ext.define('p3.view.Main', {
        extend: 'Ext.NavigationView',
        xtype: 'Main',
    
    
        requires: [
            'p3.view.Main1'
        ],
    
    
        config: {
            title: 'Main',
            iconCls: 'home',
            navigationBar: {hidden: true},
    
    
            items: [
                {
                    xtype: 'Main1'
                }
            ]
        }
    
    
    })
    // LOGIN
    Code:
    Ext.define("p3.view.Main1", {
        extend: 'Ext.form.Panel',
    
    
        requires: [
            'Ext.TitleBar',
            'Ext.Button',
    
    
            'Ext.form.FieldSet',
            'Ext.form.Panel',
            'Ext.field.Text',
            'Ext.field.Password',
        ],
    
    
        xtype: 'Main1',
    
    
        config: {
            title: 'Login',
            navigationBar: 'top',
            scroll: 'vertical',scrollable: 'vertical',
            iconCls: 'action',
    
    
            items: [
                {
                    xtype: 'titlebar',
                    docked: 'top',
                    title: 'ppp - login'
                },
                {
                    xtype: 'fieldset',
                    id: 'fieldset',
                    items: [
                        {
                            xtype: 'textfield',
                            name: 'username',
                            label: 'username',
                            placeHolder: 'username or email',
                            required: true
                        },
                        {
                            xtype: 'passwordfield',
                            name: 'password',
                            label: 'password',
                            required: true
                        },
                    ]
                },
                {
                    xtype: 'button',
                    id: 'scLogin',
                    text: 'go',
                    width: '48.50%',
                    ui: 'confirm',
                    left: 3
                }
            ]
        }
    });

    // landing page with a simple list
    Code:
    Ext.define('p3.view.Main2', {
        extend: 'Ext.List',
        xtype: 'Main2',
    
    
        requires: [
            'Ext.dataview.List',
            'Ext.data.Store'
        ],
    
    
        config: {
            title: 'The List',
    
    
            store: {
                fields: ['name'],
                data: [
                    {name: 'data1'},
                    {name: 'data2'},
                    {name: 'data3'},
                    {name: 'data4'}
                ]
            },
            itemTpl: '{name}'
    
    
        }
    })

    // Controller
    Code:
    Ext.define('p3.controller.c1', {
        extend: 'Ext.app.Controller',
    
    
        config: {
            refs: {
                Main: 'Main',
                scLogin: 'Main #scLogin'
    
    
            },
            control: {
                Main: {
                    activate: function() {
    //                    this.go2();
                    }
                },
                scLogin: {
                    tap: function(button) {
                        this.go2();
                    }
                }
            }
        },
    
    
        go2: function() {
            this.getMain().push({
                xtype: 'Main2'
            });
        }
    });

    If you de-comment this.go() function on activate (initialize behave in the same way) control the app will open to the Main2 page (landing page) but you will get 2/3% cpu usage for chrome and around 40% on Android 1Ghz mobile phone (this is not happening if you go to Main2 page with go button)


    any suggestion ??

    thank you again in advance
    Alex!

  6. #6
    Sencha User
    Join Date
    May 2012
    Location
    rome
    Posts
    68
    Answers
    3
    Vote Rating
    0
    alexdran is on a distinguished road

      0  

  7. #7
    Sencha User
    Join Date
    May 2012
    Location
    rome
    Posts
    68
    Answers
    3
    Vote Rating
    0
    alexdran is on a distinguished road

      0  

    Default


    specific topic has been closed:

    any solution for this framework behavior (or workaround)?


    thank you again in advance
    Alex

Thread Participants: 1

Tags for this Thread