For cordova we have to whitelist some external urls if we have any. By default it will open in external Safari browser to prevent that we have to set following in Cordova.plist file.
Monthly Archives: February 2013
Android Add In-app billing to existing project
If you have ever encountered situation, where you need to add In-app billing to your existing project, than this blog is for you. Please note that for this you need Google Play Account and valid Google Merchant Account.
First open Android SDK manager. You can open it from Window – > Android SDK Manager. If it’s not available in menu go to Window -> Customize Perspective and Go to third tab Command Groups Availability.
And check the Android SDK and AVD Manager. Now it should be available in menu. Open it and Go to Extra.
ExtJs Window Resize on Browser Resize
You must have some main view of app which should be rendered first when app starts. You have to add render event of that view as follow.
this.control({
‘mainView’: {
render: this.onMainViewRender
}
});
Now add the following function in your controller file.
onMainViewRender: function() {
Ext.EventManager.onWindowResize( this.onBrowserResize, this );
}
Above function binds the browser resize event and add a callback function to it. Following is the function definition of onBrowserResize
onBrowserResize: function( width, height ) {
Ext.WindowManager.each( function( window ) {
if( !window.isXType( ‘window’ ) )
return;
if( height < 600 ) {
window.maxHeight = height – 30;
window.doLayout();
window.center();
} else {
window.maxHeight = 600;
window.doLayout();
window.center();
}
});
}
It might be possible that we have some message box open at that time so we have to ignore it. That’w why we are checking the window xtype. Here we are setting maxHeight of window. 600 is just the example here. You can change it with your own preference. Else loop is to restore window to it’s original height and width if browser is resized to bigger height and width than window.
Hope this helps you.
Sencha Touch, Phonegap (Cordova) application not working in Android 4.x – Here is the Solution
What is the Issue?
It’s not issue of sencha touch but it’s an issue of Android. It’s not possible to load any URL in android webview which have certain parameters. This issue is reported since Android 3.0 but still it’s not resolved. We know that when we use cordova it uses file protocol to open any files. We load index.html file using following URL.
Ext.Loader.setConfig({ disableCaching: false });
Also you can disable caching for all the Ajax request.
Ext.Ajax.setDisableCaching(false);
This will remove _dc param from your ajax request also Ext.Loader will not add _dc param in file download request.
Hope this helps you.



