私が開発していて、最近 Google Play ストアにデプロイした Titanium Android アプリがあります。Titanium Studio ワークスペースからデバイスに直接インストールすると、アプリは問題なく動作します。ただし、Google Play ストアからインストールしようとしても機能しません。ここで問題となっている「動作しない」機能は、ユーザーを認証するための https Web サービスへの呼び出しです。また、ICS ユーザーは Play ストアからアプリを動作させることができますが、Gingerbread ユーザーは役に立たない場合はそうではありません。
これは問題を引き起こすコードです:
var actInd=Titanium.UI.createActivityIndicator({height:80, width:200, message:'Logging In...', font:{fontFamily:'Helvetica Neue', fontSize:18,fontWeight:'bold'}, color:'white', style: Titanium.UI.iPhone.ActivityIndicatorStyle.BIG});
actInd.show();
//Validating Data
var xhr2 = Titanium.Network.createHTTPClient();
xhr2.onload = function(){
var response=JSON.parse(this.responseText);
if(response.resultinfo.result){
ticket = response.resultinfo.ticket;
Titanium.App.Properties.setString("uname",username.value);
actInd.message='Successful...';
actInd.show();
}
};
xhr2.onerror = function(){
Ti.API.info('in utf-8 error for GET');
};
xhr2.open("GET","https://example.com/login.cfm");
xhr2.send({"userid":username.value,"password":password.value});
問題の場合、アプリは「Logging In...」メッセージを表示したままハングします。