0

我注意到,當我在Android設備上使用鈦合金部署應用程序時,它的工作速度很慢,它看起來像Android應用程序需要時間觸摸和click.Click後重定向到下一頁到下一個頁3或4秒內我點擊任何UI元素(按鈕,查看,標籤,圖像)如何使我的Android應用程序更快使用鈦應用程序

在另一側,其與IOS設備(iphone和ipad)

我不完全加工後噸知道什麼應該完全是一個問題與Android.I也重置我的工廠數據在Android和測試應用程序再次,但仍然問題到達

是這個android touch/click問題?

請回復我的問題,並給我你的建議如何解決它。在此先感謝

+0

您能發佈一個有此問題的控制器嗎? – Giordano

回答

0

下面是一個頁面我的控制器,查看文件中鈦

---- index.js ---

function login(e) { 
    var uname = $.username.value.split(' ').join(''); 
    var pwd = $.password.value.split(' ').join(''); 

    if(uname == ""){ 
     alert("Enter username."); 
     return false; 
    } 
    if(pwd == ""){ 
     alert("Enter password."); 
     return false; 
    } 




    //if(results.length == 0){ 
    if (Titanium.Network.networkType === Titanium.Network.NETWORK_NONE) { 
      alert('There is no internet connection.'); 
      return false; 
     } 

     var loginReq = Titanium.Network.createHTTPClient(); 
     var params = { 
      func : "'"+Ti.Utils.base64encode('check_login')+"'", 
      username : uname, 
      password : pwd 
     }; 
     loginReq.onload = function() 
     { 
      var json = this.responseText; 
      var response = JSON.parse(json); 
      if(response == 'account_inactive'){ 
       alert('Your account has been inactive. Please contact to your company'); 
       //$.index.close(); 
       var index = Alloy.createController('index').getView(); 
       index.open(); 
       return false; 

      } 


      if(response == 'invalid'){ 
       alert('Invalid username or password'); 
       //$.index.close(); 
       var index = Alloy.createController('index').getView(); 
       index.open(); 
       return false;  
      } 

      else 
      { 
       results = { 
        iuser_id: response.iuser_id, 
        signup_ids: response.signup_ids, 
        staff_id : response.staff_id,   
        vusername: response.vusername, 
        vfirst_name: response.vfirst_name, 
        vlast_name: response.vlast_name, 
        vemail : response.vemail, 
        vpwd : response.vpwd 
        }; 
       Ti.App.Properties.setObject("user_session",results); 
       results = null; 
       var flag = ''; 

       if (!Ti.App.Properties.hasProperty('installed')) 
       { 
        Ti.App.Properties.setBool('app:isLoggedIn', true); 
        Ti.App.Properties.hasProperty('installed'); 
        Ti.App.Properties.setBool('installed', true); 
        var th_sign = Alloy.createController('login').getView(); 
        th_sign.open(); 
       } 
       else 
       { 

        var th_sign = Alloy.createController('account').getView(); 
        th_sign.open(); 
       } 
       }  

      json = null; 
      response = null; 
     }; 
     if(os_name == 'android'){ 
     loginReq.open("GET", WEB_ROOT+"get_init.php"); 
     } 
     else{ 
     loginReq.open("POST", WEB_ROOT+"get_init.php"); 
     } 
     loginReq.send(params); 

} 
$.index.open(); 

---- INDEX.XML --- ----

<Alloy> 
    <Window class="login_container" height="auto" horizontalWrap="true"> 
     <ScrollView id="scrollView_index" showVerticalScrollIndicator="true" height="100%" width="100%" scrollType="vertical"> 
      <View id="index_view"> 

       <ImageView class="logo" image="/images/login/logo.png" top='25' /> 

       <TextField id="username" class="usernameTxt" value="" border="0" top="230" /> 
       <TextField id="password" class="passwordTxt" value="" border="0" top="275" /> 
       <Button id="loginButton" class="login_bg" onClick="login">Login</Button> 


      </View>  

     </ScrollView>  
    </Window> 
</Alloy> 
1

您的問題不在於設備,而可能是您登錄的API。我建議你插入一個指標來彌補這樣的等待時間:

----index.xml---- 
<Alloy> 
    <Window class="login_container" height="auto" horizontalWrap="true"> 
    <ActivityIndicator id="activityIndicator" message="Wait please..."/> 

---- ---- index.js

function login(e) { 
var uname = $.username.value.split(' ').join(''); 
var pwd = $.password.value.split(' ').join(''); 

if(uname == ""){ 
    alert("Enter username."); 
    return false; 
} 
if(pwd == ""){ 
    alert("Enter password."); 
    return false; 
} 

$.activityIndicator.show(); 

而變化控制器前加

$.activityIndicator.hide(); 
0

我明白你說了什麼,並通過使用活動指示器等待一段時間來解釋但這隻會解決登錄活動的問題。但是,無論我在哪裏使用UI實用程序,(Button Onclick,Label onclick,Image Onclick,View Onclick)至少需要4到5秒的時間才能重定向到下一頁。我也在兩頁切換之間使用Loader但是仍然需要花費時間(4到5秒)來實現點擊事件並重定向到下一頁

+0

請不要添加答案,但註釋;無論如何,你的智能手機有多少內存和哪個處理器?你可以嘗試使用其他設備嗎? – Giordano

相關問題