Sencha Touch 2.3 – Orientationchange event does not fire on Viewport

There’s a bug on sencha 2.3 about event orientationChange of viewport

This event isn’t fired: a workaround for this is to create a subcription on app launch

Ext.Viewport.bodyElement.on('resize', Ext.emptyFn, this, { buffer: 1});





Tagged with: , , , , ,
Pubblicato su Uncategorized

Sencha Touch – Remove android toolbar

At default sencha cmd compile app with android toolbar!

To remove it, you must add this attribute


to AndroidManifest.xml in folder ..\Sencha\Cmd\xxxcmd_versionxxx\stbuild\st-res\android



<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="" package="%s" android:versionCode="%d" android:versionName="%s">
	<uses-sdk android:minSdkVersion="%s" android:targetSdkVersion="15" />
%s	<application android:icon="@drawable/icon" android:label="%s" android:theme="@android:style/Theme.NoTitleBar">
		<activity android:name=".STActivity"
%s			android:label="%s">
				<action android:name="android.intent.action.MAIN" />
				<category android:name="android.intent.category.LAUNCHER" />


Tagged with: , , , , , , , , ,
Pubblicato su Uncategorized

Sencha Command – Java Heap

My sencha cmd create me some problems on compilation because it can’t take enough memory!
The building show an error about java heap space after a stop of some minutes.

xml:158: com.sencha.exceptions.
ExScript: Wrapped com.sencha.exceptions.BasicException:
<strong><em> Java heap space</em></strong> (x-app-build#291)

So.. to increase it, you open sencha.cfg in ..\Sencha\Cmd\xxxVersionxxx\ search md.jvm.args variable and increase its value!

Tagged with: , , , , , , , , , , , , , , , , ,
Pubblicato su Uncategorized

Html text overflow!

I have to delimitate the overflow text in a html: I’m happy to know that a css class is enought to accomplish that!

This link explains the text-overflow css property!

Opera usees a different property

p {
  white-space: nowrap;
  width: 100%;                   
  overflow: hidden;   /* "overflow" value must be different from "visible" */
  text-overflow: ellipsis;    /* IE 6+, FF 7+, WebKit (Safari, Chrome), Opera 11+*/
  -o-text-overflow: ellipsis; /* Opera 9 e 10 */
Tagged with: , , ,
Pubblicato su Html

Ext Field: Change value without firing events!

To change a value of a Ext field without firing events it’s enough suspend events, do the action and reactive the events!

Tagged with: , , , , ,
Pubblicato su Uncategorized

Android device manager

Finally google added a method to allow to track down a device registered on our profile!

Now, not only Apple users can find their iPhone (by Find my IPhone feature), infact google introduced Android device manager about a month ago!


To access it open following link:

or, go to playstore page, open setting and click “mange device” item.



It’s important enable this function on device.

From google

Turn on Android Device Manager

Note: If you’re using a tablet with multiple users, only the tablet owner can manage the settings for Android Device Manager.

  1. Open  Google Settings from your device’s apps menu.
  2. Touch Android Device Manager.

You can turn on the following options:

  • Remotely locate this device. Remotely locate a device and find its approximate location on Google Maps. For devices running 4.1 and higher, location access must also be enabled. To turn it on, go to Google Settings > Location > Access location.
  • Allow remote factory reset. Remotely erase all data on your device. Touch this option, then select Activate to turn on the device administrator.
Tagged with: ,
Pubblicato su Uncategorized

Sencha touch – manage ajax error

I’m developing a sencha touch app and I need to manage errors of every ajax call! The most simple solution consist of subscribe to every call and manage response but it’s very repetitive and I don’t like it!

The solution I choose is to extend base class of Connection and override response method.

In the launch method of app.js I added this code:

Ext.define('', {
override: '',

onComplete : function(request) {
var response = this.callParent([request]);

if(response.status != 200){
         var extraMsg = 'response code: ' + response.status;
         Ext.callback(Ext.goToLogin, this, [extraMsg]);
       }else if(response.responseText){
           //parse json resposne
           var resObj = Ext.JSON.decode(response.responseText);
           if(resObj && !resObj.success &&
             resObj.code === Ext.errorCodes.NOT_LOGGED){
             Ext.callback(Ext.goToLogin, this, ['Not logged!']););
   return response;

With this code every ajax call will be verified automatically.

In case of you want avoid this behavior for some request it will enought add ‘disableLoginRedirect=true’ in the request options!

  url: requestUrl,
  disableLoginRedirect : true, //this options!!!!
  failure: function(response, opts) {

If you are using JSONP the class to modify is:

Ext.define('', {
    override: '',

    createRequestCallback: function(request, operation, callback, scope) {
        var jsonPme = this;
        return function(success, response, errorType) {
            delete jsonPme.lastRequest;
            //console.log('jsonp callback');

            if(success && response){                  
                if(!response.success && response.code === Ext.errorCodes.NOT_LOGGED && (!request.options || !request.options.disableLoginRedirect)){
                    var extraMsg = 'not logged!';
                    Ext.callback(Ext.goToLogin, this, [extraMsg]);
                    jsonPme.processResponse(success, operation, request, response, callback, scope);
Tagged with: , , , , , , , , , , ,
Pubblicato su Ext, ExtJs, Sencha