1

I am developing one application using sencha touch 2.

In the app, i am using some images as button and some default buttons also. Even some other components are also there.

The problem is, when i am testing it for different android devices, the UI is not coming properly.

Suppose when i am testing for Samsung S2, it is fitting in the screen. But while testing for 480 * 360 screens, it is going out of the screens.

How can i handle the different screen sizes for android?? Is there any sample code??

Please help..

Shrikant Ballal
  • 7,067
  • 7
  • 41
  • 61
Arindam Mukherjee
  • 2,255
  • 11
  • 48
  • 83

1 Answers1

1

Here is a documentation for Supporting multiple screen sizes: http://developer.android.com/guide/practices/screens_support.html

I suggest you to use density pixels (dp) when setting the image size, this will also set the size in function of the screen density.

For more details, please feel free to ask.

Milos Cuculovic
  • 19,631
  • 51
  • 159
  • 265
  • 1
    Honestly, don't use web applications. Native is ALWAYS a far better choice. – Michell Bak Sep 25 '12 at 12:29
  • But i want to run it both for android and iphone..And i am developing it using sencha touch 2.. – Arindam Mukherjee Sep 25 '12 at 12:30
  • I think that it is much much better to use the native android developpement tool instead of Sencha Touch 2. +1 for @MichellBak – Milos Cuculovic Sep 25 '12 at 12:30
  • @ArindamMukherjee, I am not specialist of Sencha Touch 2 but i will suggest you to developp two separate apps (one for Android and one for iPhone). That's only a suggestion, maybe I am wrong. – Milos Cuculovic Sep 25 '12 at 12:33
  • 1
    agreed, there is no reason to not use native when developing for android. – Green_qaue Sep 25 '12 at 12:34
  • Even i developed the apps using this platform and able to run it in android tablet as well as ipad..with no change of code..and i build them as native apps. I mean i generated apk and ipa and run them. But this time i want to develop for phones. So i need more support to port the app for different screen resolutions.. – Arindam Mukherjee Sep 25 '12 at 12:35
  • @ArindamMukherjee Usualy, more you are using high level frameworks, more you will lose in flexibility. That's a developper's choice then. – Milos Cuculovic Sep 25 '12 at 12:37
  • I dont agree with you..I hope more you change your skills, you will be more flexible. And that the main thing presently require in Mobile app development.. – Arindam Mukherjee Sep 25 '12 at 12:40
  • Using frameworks is a good praktice, but the choice of the framework is really important. If you take a look on stack, there are 19.7k followers of android tag and 243 of the sencha touch 2. It is easy to understnd that the support for this framework will be very very poor. good luck. – Milos Cuculovic Sep 25 '12 at 12:51
  • @Milos It because android is popular from last couple of years..but sencha touch 2 is pretty new..Even day by day this cross platforms like Sencha touch, Jquery, phonegap is coming to the picture. And after all we are developing for android only..And i am also a android and Blackberry developer from last 2 years. So after all it all depends upon your requirement. – Arindam Mukherjee Sep 25 '12 at 12:57
  • @Milos Thanks for your replies..But here i want a solution, not a discussion. :) – Arindam Mukherjee Sep 25 '12 at 13:00
  • @ArindamMukherjee, yes I know, you would like to have a solution but unfortuently, I am not able to give it to you (not enough knowledge in sencha touch 2) – Milos Cuculovic Sep 25 '12 at 13:01