Hi all i had developed an application using titanium. well i face 2 major problems.
1.When i actually run it on device my application gets hang and it restarts automatically. sometime even the device restarts too. I had tested it on HTC M8, LG G3,Samsung S3,Samsung duos,Moto E,Micromax etc...
2.Font Size is killing me. this is what i wrote
if (Alloy.Globals.dpi > 100 && Alloy.Globals.dpi <= 160) { Ti.API.info("in 100dp and 160dp"); Alloy.Globals.titlefont = ((Ti.Platform.displayCaps.platformHeight * 5) / 100); Alloy.Globals.font = ((Ti.Platform.displayCaps.platformHeight * 3.5 ) / 100); Alloy.Globals.mediumfont = ((Ti.Platform.displayCaps.platformHeight * 3.2) / 100); Alloy.Globals.smallfont = ((Ti.Platform.displayCaps.platformHeight * 2.8) / 100); Alloy.Globals.widgetfont = ((Ti.Platform.displayCaps.platformHeight * 6 ) / 100); } else if (Alloy.Globals.dpi > 160 && Alloy.Globals.dpi <= 240) { Ti.API.info("in 160 and 240dp"); Alloy.Globals.titlefont = ((Ti.Platform.displayCaps.platformHeight * 3) / 100); Alloy.Globals.font = ((Ti.Platform.displayCaps.platformHeight * 2.5 ) / 100); Alloy.Globals.mediumfont = ((Ti.Platform.displayCaps.platformHeight * 2) / 100); Alloy.Globals.smallfont = ((Ti.Platform.displayCaps.platformHeight * 1.5) / 100); Alloy.Globals.widgetfont = ((Ti.Platform.displayCaps.platformHeight * 3.5 ) / 100); } else if (Alloy.Globals.dpi > 240 && Alloy.Globals.dpi < 480) { Ti.API.info("in grater 240dp"); Alloy.Globals.titlefont = ((Ti.Platform.displayCaps.platformHeight * 2.3) / 100); Alloy.Globals.font = ((Ti.Platform.displayCaps.platformHeight * 2 ) / 100); Alloy.Globals.mediumfont = ((Ti.Platform.displayCaps.platformHeight * 1.5) / 100); Alloy.Globals.smallfont = ((Ti.Platform.displayCaps.platformHeight * 1.2) / 100); Alloy.Globals.widgetfont = ((Ti.Platform.displayCaps.platformHeight * 2.8 ) / 100); } else if (Alloy.Globals.dpi >= 480 && Alloy.Globals.dpi < 550) { Alloy.Globals.titlefont = ((Ti.Platform.displayCaps.platformHeight * 1.8) / 100); Alloy.Globals.font = ((Ti.Platform.displayCaps.platformHeight * 1.3 ) / 100); Alloy.Globals.mediumfont = ((Ti.Platform.displayCaps.platformHeight * 0.9) / 100); Alloy.Globals.smallfont = ((Ti.Platform.displayCaps.platformHeight * 0.6) / 100); Alloy.Globals.widgetfont = ((Ti.Platform.displayCaps.platformHeight * 2 ) / 100); } else if (Alloy.Globals.dpi >= 550) { Alloy.Globals.titlefont = ((Ti.Platform.displayCaps.platformHeight * 1) / 100); Alloy.Globals.font = ((Ti.Platform.displayCaps.platformHeight * 0.9 ) / 100); Alloy.Globals.mediumfont = ((Ti.Platform.displayCaps.platformHeight * 0.75) / 100); Alloy.Globals.smallfont = ((Ti.Platform.displayCaps.platformHeight * 0.5) / 100); Alloy.Globals.widgetfont = ((Ti.Platform.displayCaps.platformHeight * 1.2 ) / 100); }and the thing is it show tiny text in 4 inch and kind of medium text in 5 inch and so on.I mean to say is its not adjusting according to the screen size ahh... the font size is like tiny or huge devicess..